Changeset 12816


Ignore:
Timestamp:
2006-09-21T17:02:52+12:00 (18 years ago)
Author:
mdewsnip
Message:

Changed format_map to default_format_map to be a bit more obvious, and fixed a bug where DocumentHeading, DocumentText and DocumentButtons defaults weren't available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java

    r12815 r12816  
    7575    static final private String SEARCHTYPES_DEFAULT_FORMAT = "plain,form";
    7676
    77     static private  HashMap format_map = null ;     
     77    static private HashMap default_format_map = null;
    7878
    7979    /** The controls used to edit the format commands. */
     
    8888    this.model = this;
    8989
    90         format_map = new HashMap();
    91     format_map.put(DATELIST, DATELIST_DEFAULT_FORMAT);
    92     format_map.put(HLIST, HLIST_DEFAULT_FORMAT);
    93     format_map.put(VLIST, VLIST_DEFAULT_FORMAT);
    94     format_map.put(DOCUMENTHEADING, DOCUMENTHEADING_DEFAULT_FORMAT);
    95     format_map.put(DOCUMENTTEXT, DOCUMENTTEXT_DEFAULT_FORMAT);
    96     format_map.put(DOCUMENTBUTTONS, DOCUMENTBUTTONS_DEFAULT_FORMAT);
    97         format_map.put("", "");
     90        default_format_map = new HashMap();
     91    default_format_map.put(DATELIST, DATELIST_DEFAULT_FORMAT);
     92    default_format_map.put(HLIST, HLIST_DEFAULT_FORMAT);
     93    default_format_map.put(VLIST, VLIST_DEFAULT_FORMAT);
     94    default_format_map.put(DOCUMENTHEADING, DOCUMENTHEADING_DEFAULT_FORMAT);
     95    default_format_map.put(DOCUMENTTEXT, DOCUMENTTEXT_DEFAULT_FORMAT);
     96    default_format_map.put(DOCUMENTBUTTONS, DOCUMENTBUTTONS_DEFAULT_FORMAT);
     97        default_format_map.put("", "");
    9898
    9999    DebugStream.println("FormatManager: parsed " + getSize() + " format statements.");
     
    162162    }
    163163    }
     164
    164165
    165166    private Format getFormat(String name) {
     
    687688                // Initial value
    688689
    689                 editor_textarea.setText(part.getDefaultFormat());
     690                editor_textarea.setText((String) default_format_map.get(f.toString()));
    690691                                editor_textarea.setCaretPosition(0);
    691692                       
     
    973974            // Initial value
    974975            if (pname !=null && pname.length()!=0 ){
    975                 editor_textarea.setText((String)format_map.get(pname));
     976                editor_textarea.setText((String) default_format_map.get(pname));
    976977                editor_textarea.setCaretPosition(0);
    977978            }
    978979            else{
    979                 editor_textarea.setText((String)format_map.get(name));
     980                editor_textarea.setText((String) default_format_map.get(name));
    980981                editor_textarea.setCaretPosition(0);
    981982            }
Note: See TracChangeset for help on using the changeset viewer.