Changeset 5651 for trunk/gli/src/org/greenstone/gatherer/cdm
- Timestamp:
- 2003-10-16T11:22:08+13:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java
r5593 r5651 48 48 import org.greenstone.gatherer.cdm.Format; 49 49 import org.greenstone.gatherer.msm.ElementWrapper; 50 import org.greenstone.gatherer.util.GSDLSiteConfig;51 50 import org.greenstone.gatherer.util.Utility; 52 51 import org.w3c.dom.*; … … 103 102 } 104 103 104 /** Have the formats changed since the last save. */ 105 public boolean formatsChanged() { 106 return formats_changed; 107 } 108 105 109 /** Gets the format indicated by the index. 106 110 * @param index The location of the desired format, as an <i>int</i>. … … 144 148 } 145 149 150 /** Set the state of the formats changed flag. 151 * @param state the new state as a boolean 152 */ 153 public void setFormatsChanged(boolean state) { 154 formats_changed = state; 155 } 156 146 157 private HashMap buildDefaultMappings(ArrayList features_model, ArrayList parts_model) { 147 158 System.err.println("buildDefaultMappings(): replace me with something that reads in a data xml file."); … … 385 396 public void destroy() { 386 397 } 387 398 388 399 /** Overriden to ensure that the instructions pane is scrolled to the top. 389 400 */ … … 414 425 format = null; 415 426 } 416 417 // Now if the formats have changed, and the greenstone local library is being used and the collection has been built for previewing, then remove the add the collection to Greenstone to ensure the formatting updates correctly.418 if(formats_changed && Gatherer.c_man.built() && Gatherer.config.exec_file != null) {419 // Release the collection420 Gatherer.g_man.preview_pane.configServer(GSDLSiteConfig.RELEASE_COMMAND + Gatherer.c_man.getCollection().getName());421 // Then re-add it to force format commands to be processed422 Gatherer.g_man.preview_pane.configServer(GSDLSiteConfig.ADD_COMMAND + Gatherer.c_man.getCollection().getName());423 }424 formats_changed = false;425 427 } 426 428 … … 735 737 implements ActionListener { 736 738 737 public void actionPerformed(ActionEvent event) { 738 /** @todo **/ 739 } 739 public void actionPerformed(ActionEvent event) { 740 ignore_event = true; // Prevent format_list excetera propagating events 741 742 if(!format_list.isSelectionEmpty()) { 743 744 // Remove the current format 745 removeFormat((Format)format_list.getSelectedValue()); 746 747 Entry entry = (Entry)feature_combobox.getSelectedItem(); 748 Object f = entry.getFeature(); 749 String p = (String)part_combobox.getSelectedItem(); 750 Format format = null; 751 if(view_type.equals(FLAG)) { 752 format = new Format(f, p, enabled_checkbox.isSelected()); 753 } 754 else { 755 format = new Format(f, p, editor_textarea.getText()); 756 } 757 addFormat(format); 758 add_button.setEnabled(false); 759 remove_button.setEnabled(true); 760 // Update list selection 761 format_list.setSelectedValue(format, true); 762 format = null; 763 p = null; 764 f = null; 765 entry = null; 766 } 767 replace_button.setEnabled(false); 768 ignore_event = false; 769 } 740 770 } 741 771 }
Note:
See TracChangeset
for help on using the changeset viewer.