Changeset 5755


Ignore:
Timestamp:
2003-10-29T12:19:15+13:00 (20 years ago)
Author:
jmt12
Message:

Repaired the thing I broke last week which caused flag formats to be displayed as value types

File:
1 edited

Legend:

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

    r5720 r5755  
    8383    // Ensure the default formats for DateList, HList and VList are assigned
    8484    if(getFormat("DateList") == null) {
    85        addFormat(new Format("","DateList","<td>[link][icon][/link]</td><td>[highlight]{Or}{[Title],Untitled}[/highlight]</td><td>[Date]</td>"));
     85       addFormat(new Format("","DateList","<td>[link][icon][/link]</td><td>[highlight]{Or}{[dls.Title],[dc.Title],[Title],Untitled}[/highlight]</td><td>[Date]</td>"));
    8686    }
    8787   
    8888    if(getFormat("HList") == null) {
    89        addFormat(new Format("","HList","[link][highlight][Title][/highlight][/link]"));
     89       addFormat(new Format("","HList","[link][highlight]{Or}{[dls.Title],[dc.Title],[Title],Untitled}[/highlight][/link]"));
    9090    }
    9191   
    9292    if(getFormat("VList") == null) {
    93        addFormat(new Format("","VList","<td valign=top>[link][icon][/link]</td><td valign=top>[srclink]{Or}{[thumbicon],[srcicon]}[/srclink]</td><td valign=top>[highlight]{Or}{[Title],[dc.Title],[dls.Title],Untitled}[/highlight]{If}{[Source],<br><i>([Source])</i>}</td>"));
     93       addFormat(new Format("","VList","<td valign=top>[link][icon][/link]</td><td valign=top>[srclink]{Or}{[thumbicon],[srcicon]}[/srclink]</td><td valign=top>[highlight]{Or}{[dls.Title],[dc.Title],[Title],Untitled}[/highlight]{If}{[Source],<br><i>([Source])</i>}</td>"));
    9494    }
    9595    }
     
    170170   
    171171    private HashMap buildDefaultMappings(ArrayList features_model, ArrayList parts_model) {
    172        System.err.println("buildDefaultMappings(): replace me with something that reads in a data xml file.");
     172       Gatherer.println("buildDefaultMappings(): replace me with something that reads in a data xml file.");
    173173    return new HashMap();
    174174    }
     
    190190
    191191    private ArrayList buildPartModel() {
    192     System.err.println("buildPartModel(): replace me with something that reads in a data xml file.");
     192    Gatherer.println("buildPartModel(): replace me with something that reads in a data xml file.");
    193193    ArrayList part_model = new ArrayList();
    194194    part_model.add(new Part("", ""));
     
    201201
    202202    private ArrayList buildVariableModel() {
    203     System.err.println("buildVariableModel(): replace me with something that reads in a data xml file.");
     203    Gatherer.println("buildVariableModel(): replace me with something that reads in a data xml file.");
    204204    ArrayList variable_model = new ArrayList();
    205205    variable_model.add("[Text]");
     
    531531            Entry entry = (Entry) feature_combobox.getSelectedItem();
    532532            String name = entry.toString();
    533             if(Format.isParamType(name)) {
    534             // Flags first.
    535                selection_pane.remove(part_pane);
    536                //selection_pane.add(blank_pane);
    537             card_layout.show(control_pane, FLAG);
    538             view_type = FLAG;
    539             }
    540             else {
    541                //selection_pane.remove(blank_pane);
    542                selection_pane.add(part_pane);
    543             card_layout.show(control_pane, VALUE);
    544             view_type = VALUE;
    545             }
    546             control_pane.updateUI();
    547533            // Add is only enabled if there isn't already a format for the choosen feature and part. Create a dummy format and test if itsa already in the model
    548534            Object f = entry.getFeature();
     
    556542            }
    557543            else {
    558             name = Format.generateName(f, pname);
    559             Format format = getFormat(name);
    560             // If there is an existing feature, select it.
    561             if(format != null) {
     544               Format format = getFormat(Format.generateName(f, pname));
     545               // If there is an existing feature, select it, and use it to determine what controls are visible
     546               if(format != null) {
     547              ///ystem.err.println("There is an existing format!");
    562548                format_list.setSelectedValue(format, true);
    563549                // Now use type to determine what controls are visible, and what have initial values.
    564550                if(format.isParamType()) {
     551                   ///ystem.err.println("Flag type");
    565552                // Flags first.
    566553                selection_pane.remove(part_pane);
     
    571558                }
    572559                else {
     560                   ///ystem.err.println("Value type");
    573561                selection_pane.add(part_pane);
    574562                card_layout.show(control_pane, VALUE);
     
    579567                control_pane.updateUI();
    580568                remove_button.setEnabled(true);
    581             }
     569               }
     570               // Otherwise there is no existing format, so we proceed by checking against the feature name
    582571            else {
     572               ///ystem.err.println("No existing format");
    583573                format_list.clearSelection();
    584574                if(Format.isParamType(name)) {
     575                   ///ystem.err.println("Flag type");
    585576                // Flags first.
    586577                selection_pane.remove(part_pane);
     
    591582                }
    592583                else {
     584                   ///ystem.err.println("Value type");
    593585                selection_pane.add(part_pane);
    594586                card_layout.show(control_pane, VALUE);
Note: See TracChangeset for help on using the changeset viewer.