Changeset 5755
- Timestamp:
- 2003-10-29T12:19:15+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java
r5720 r5755 83 83 // Ensure the default formats for DateList, HList and VList are assigned 84 84 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>")); 86 86 } 87 87 88 88 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]")); 90 90 } 91 91 92 92 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>")); 94 94 } 95 95 } … … 170 170 171 171 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."); 173 173 return new HashMap(); 174 174 } … … 190 190 191 191 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."); 193 193 ArrayList part_model = new ArrayList(); 194 194 part_model.add(new Part("", "")); … … 201 201 202 202 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."); 204 204 ArrayList variable_model = new ArrayList(); 205 205 variable_model.add("[Text]"); … … 531 531 Entry entry = (Entry) feature_combobox.getSelectedItem(); 532 532 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();547 533 // 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 548 534 Object f = entry.getFeature(); … … 556 542 } 557 543 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!"); 562 548 format_list.setSelectedValue(format, true); 563 549 // Now use type to determine what controls are visible, and what have initial values. 564 550 if(format.isParamType()) { 551 ///ystem.err.println("Flag type"); 565 552 // Flags first. 566 553 selection_pane.remove(part_pane); … … 571 558 } 572 559 else { 560 ///ystem.err.println("Value type"); 573 561 selection_pane.add(part_pane); 574 562 card_layout.show(control_pane, VALUE); … … 579 567 control_pane.updateUI(); 580 568 remove_button.setEnabled(true); 581 } 569 } 570 // Otherwise there is no existing format, so we proceed by checking against the feature name 582 571 else { 572 ///ystem.err.println("No existing format"); 583 573 format_list.clearSelection(); 584 574 if(Format.isParamType(name)) { 575 ///ystem.err.println("Flag type"); 585 576 // Flags first. 586 577 selection_pane.remove(part_pane); … … 591 582 } 592 583 else { 584 ///ystem.err.println("Value type"); 593 585 selection_pane.add(part_pane); 594 586 card_layout.show(control_pane, VALUE);
Note:
See TracChangeset
for help on using the changeset viewer.