Changeset 12095
- Timestamp:
- 2006-07-07T13:17:52+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java
r11046 r12095 63 63 /** A list of formating strings to use at build time. */ 64 64 static public FormatManager format_manager; 65 /** The manager in charge of displaying this manager and the controls for other managers.*/65 /** A manager of general options */ 66 66 static public GeneralManager general_manager; 67 /** List of indexes to be built, and the default index. */ 68 static public IndexManager index_manager; 67 /** List of indexes to be built, and the default index. 68 also handles build type and levels */ 69 static public IndexingManager index_manager; 69 70 /** Contains instructions dealing with the collection language. */ 70 71 static public LanguageManager language_manager; 72 /** Handling writing extra.dm file */ 73 static public MacrosManager macros_manager; 71 74 /** A simple manager for the visual review of metadata sets. */ 72 75 static public MetadataSetView metadataset_view; 73 76 /** A list of plugins to use at build time. */ 74 77 static public PluginManager plugin_manager; 75 /** The manager in charge of all aspects of searchtypes. We also ask this manager whether we are MG or MGPP enabled. */76 static public Search TypeManager searchtype_manager;78 /** a manager of searching metadata such as index names*/ 79 static public SearchMetadataManager searchmetadata_manager; 77 80 /** Contains: A list of subcollections, (defined on metadatadata), a list of which subcollection indexes to build and the default subcollection index. */ 78 81 static public SubcollectionManager subcollection_manager; … … 82 85 static public SuperCollectionManager supercollection_manager; // Just cause I could ;p 83 86 /** The text translation manager. */ 84 static public TranslationView translation_ view;87 static public TranslationView translation_manager; 85 88 /** These mark what needs to happen when building a collection where ONLY design options have been changed. 86 89 The build requirements of the higher numbers must include doing everything from the lower numbers. */ … … 119 122 * @see org.greenstone.gatherer.cdm.MetadataSetView 120 123 * @see org.greenstone.gatherer.cdm.PluginManager 121 * @see org.greenstone.gatherer.cdm.SearchTypeManager122 124 * @see org.greenstone.gatherer.cdm.SubcollectionIndexManager 123 125 * @see org.greenstone.gatherer.cdm.SubcollectionManager … … 131 133 classifier_manager = new ClassifierManager(); 132 134 general_manager = new GeneralManager(); 133 134 searchtype_manager = new SearchTypeManager(collect_config.getSearchType()); 135 if(searchtype_manager.isSearchTypeEnabled()) { 136 // note this this could be lucene now, the format is the same as for mgpp 137 index_manager = new IndexManager(collect_config.getMGPPIndexes()); 138 } 139 else { 140 index_manager = new IndexManager(collect_config.getMGIndexes()); 141 } 142 135 macros_manager = new MacrosManager(); 136 index_manager = new IndexingManager(); 143 137 metadataset_view = new MetadataSetView(); 144 138 plugin_manager = new PluginManager(); … … 147 141 subcollectionindex_manager = new SubcollectionIndexManager(collect_config.getSubIndexes()); 148 142 supercollection_manager = new SuperCollectionManager(collect_config.getSuperCollection()); 149 translation_view = new TranslationView(); 143 searchmetadata_manager = new SearchMetadataManager(); 144 translation_manager = new TranslationView(); 150 145 format_manager = new FormatManager(); // Parse formats at the very end, given that they depend upon several other managers to appear properly. 151 146 } … … 154 149 */ 155 150 public void destroy() { 156 // Remove visual the component from its parent.157 if(general_manager.getParent() != null) {158 general_manager.getParent().remove(general_manager);159 }160 151 // Remove references from persistant listeners. 161 152 classifier_manager.destroy(); 162 153 classifier_manager = null; 154 searchmetadata_manager.destroy(); 155 searchmetadata_manager = null; 163 156 format_manager.destroy(); 164 157 format_manager = null; … … 177 170 supercollection_manager.destroy(); 178 171 supercollection_manager = null; 179 translation_view.destroy(); 180 translation_view = null; 181 } 182 183 /** Display the GUI interface for the CollectionDesignManager in the centre of the indicated panel. 184 * @param target the JPanel you wish to display the gui on 185 */ 186 public void display(JPanel target) { 187 target.add(general_manager, BorderLayout.CENTER); 188 } 189 /** When the tab on the JTabbedPane that contains the GUI is selected, this method is called to ensure that the controls are all up to date, in terms of references to metadata etc. 190 */ 191 public void gainFocus() { 192 general_manager.gainFocus(); 172 translation_manager.destroy(); 173 translation_manager = null; 193 174 } 194 175 … … 198 179 public void modeChanged(int mode) { 199 180 plugin_manager.modeChanged(mode); 181 classifier_manager.modeChanged(mode); 200 182 subcollection_manager.modeChanged(mode); 183 supercollection_manager.modeChanged(mode); 184 format_manager.modeChanged(mode); 185 index_manager.modeChanged(mode); 186 translation_manager.modeChanged(mode); 187 metadataset_view.modeChanged(mode); 188 general_manager.modeChanged(mode); 189 language_manager.modeChanged(mode); 190 searchmetadata_manager.modeChanged(mode); 201 191 } 202 192 … … 208 198 } 209 199 210 /** Ensure that saving will actually work. This can return false if there is a collection filename clash for instance. */211 public boolean canSave() {212 return (general_manager == null || general_manager.canSave());213 }214 215 200 216 201 public void save() { … … 221 206 public void save(boolean force_save) 222 207 { 223 224 208 general_manager.loseFocus(); 225 209 if (!update_collect_cfg_required && !force_save) { … … 229 213 230 214 DebugStream.println("Saving the collection config file"); 231 232 215 // Release collection as necessary 233 216 String collection_name = Gatherer.c_man.getCollection().getName();
Note:
See TracChangeset
for help on using the changeset viewer.