Changeset 12808
- Timestamp:
- 2006-09-21T15:24:25+12:00 (18 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java
r12798 r12808 112 112 Node target_node = CollectionConfiguration.findInsertionPoint(element); 113 113 add(root, classifier, target_node); 114 Gatherer.c_man.configurationChanged();115 114 } 116 115 } … … 230 229 } 231 230 232 Gatherer.c_man.configurationChanged();233 231 // tell the format manager to update the names of its format statements 234 232 Gatherer.c_man.getCollection().cdm.format_manager.refresh(); … … 241 239 private void removeClassifier(Classifier classifier) { 242 240 remove(classifier); 243 Gatherer.c_man.configurationChanged();244 241 } 245 242 … … 467 464 ac.destroy(); 468 465 ac = null; 469 // cos I can't be bothered checking every argument to see if it has changed or not, we'll asasume that the configuration has changed if someone has clicked configure470 Gatherer.c_man.configurationChanged();471 466 } 472 467 } … … 493 488 ac.destroy(); 494 489 ac = null; 495 // cos I can't be bothered checking every argument to see if it has changed or not, we'll asasume that the configuration has changed if someone has clicked configure496 Gatherer.c_man.configurationChanged();497 490 } 498 491 } -
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java
r12806 r12808 90 90 static final public int NOTHING = 0; 91 91 static private int rebuildTypeRequired = NOTHING; //Rebuild type required if only design options have changed 92 static public boolean update_collect_cfg_required = false;93 92 94 93 /** Constructor. Loads a certain collection configuration file, which is parsed into a DOM. This model is then registered with the command information managers, each of whom knows how to, and provides controls to, alter certain commands. -
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMeta.java
r12798 r12808 171 171 // And determine if this makes the metadata assigned 172 172 setAssigned(raw_value != null && raw_value.length() > 0); 173 Gatherer.c_man.configurationChanged();174 173 } 175 174 } -
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMetaManager.java
r10556 r12808 59 59 Node target_node = CollectionConfiguration.findInsertionPoint(element); 60 60 add(root, metadata, target_node); 61 if (!metadata.getValue(CollectionMeta.TEXT).equals("")) { 62 // if just adding an empty metadata, the configuration hasn't changed. 63 Gatherer.c_man.configurationChanged(); 64 } 65 } 66 //Gatherer.c_man.configurationChanged(); 61 } 67 62 } 68 63 … … 180 175 if(name.equals(other.getName()) && language.equals(other.getLanguage())) { 181 176 remove(i); 182 Gatherer.c_man.configurationChanged();183 177 return; 184 178 } … … 192 186 /** Removes all of the metadata with a certain name, regardless of language or value. */ 193 187 public void removeMetadata(String name) { 194 boolean removed_entry = false;195 188 for(int i = getSize(); i != 0; i--) { 196 189 CollectionMeta other = (CollectionMeta) getElementAt(i - 1); 197 190 if(name.equals(other.getName())) { 198 191 remove(i - 1); 199 removed_entry = true;200 192 } 201 193 other = null; 202 194 } 203 if(removed_entry) {204 Gatherer.c_man.configurationChanged();205 }206 195 } 207 196 -
trunk/gli/src/org/greenstone/gatherer/cdm/DesignChangeListener.java
r10237 r12808 50 50 51 51 public void maybeSetRebuildRequired() { 52 if (rebuildType > CollectionDesignManager.getRebuildTypeRequired()) {52 if (rebuildType > CollectionDesignManager.getRebuildTypeRequired()) { 53 53 CollectionDesignManager.setRebuildTypeRequired(rebuildType); 54 }55 //We need to keep track of this seperately, as collect.cfg is uploaded if needed, when the collect.cfg is saved.56 if(rebuildType == CollectionDesignManager.UPDATE_COLLECT_CFG) {57 CollectionDesignManager.update_collect_cfg_required = true;58 54 } 59 55 } -
trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java
r12708 r12808 152 152 Node target_node = CollectionConfiguration.findInsertionPoint(element); 153 153 add(root, format, target_node); 154 Gatherer.c_man.configurationChanged();155 154 } 156 155 } … … 207 206 private void removeFormat(Format format) { 208 207 remove(format); 209 Gatherer.c_man.configurationChanged();210 211 208 } 212 209 … … 528 525 addFormat(format); 529 526 existingFormat(); 530 // Save the collection configuration file immediately531 532 Gatherer.c_man.configurationChanged();533 527 534 528 // Update list selection … … 582 576 if (shouldSave){ 583 577 format.setValue(editor_textarea.getText()); 584 Gatherer.c_man.configurationChanged();585 578 model.refresh((DOMProxyListEntry)format); 586 579 } … … 605 598 if (shouldSave){ 606 599 format.setState(enabled_checkbox.isSelected()); 607 Gatherer.c_man.configurationChanged();608 600 model.refresh((DOMProxyListEntry)format); 609 601 } … … 933 925 removeFormat((Format)format_list.getSelectedValue()); 934 926 935 // Save the collection configuration file immediately936 Gatherer.c_man.configurationChanged();937 927 // Change buttons 938 928 add_button.setEnabled(true); 939 929 newFormat(); 940 941 930 } 942 931 } -
trunk/gli/src/org/greenstone/gatherer/cdm/IndexManager.java
r12800 r12808 104 104 setDefault(index); 105 105 } 106 Gatherer.c_man.configurationChanged();107 106 } 108 107 else { … … 330 329 add(position, index); 331 330 } 332 333 // Schedule the collection for saving334 Gatherer.c_man.configurationChanged();335 331 } 336 332 … … 361 357 default_index.setAssigned(false); 362 358 } 363 } 364 Gatherer.c_man.configurationChanged(); 359 } 365 360 } 366 361 } … … 389 384 // add the new one at that position 390 385 add(position, new_index); 391 392 // Schedule the collection for saving393 Gatherer.c_man.configurationChanged();394 386 } 395 387 … … 424 416 } 425 417 } 426 Gatherer.c_man.configurationChanged();427 428 418 } 429 419 -
trunk/gli/src/org/greenstone/gatherer/cdm/LanguageManager.java
r12800 r12808 112 112 CollectionDesignManager.collectionmeta_manager.addMetadatum(metadatum); 113 113 add(getSize(), language); 114 Gatherer.c_man.configurationChanged();115 114 } 116 115 } … … 204 203 } 205 204 206 // Schedule the collection for saving207 Gatherer.c_man.configurationChanged();208 205 return new_position; 209 206 } … … 221 218 setDefault(null); 222 219 } 223 Gatherer.c_man.configurationChanged();224 220 } 225 221 … … 239 235 remove(old_language); 240 236 add(position, new_language); 241 242 // Schedule the collection for saving 243 Gatherer.c_man.configurationChanged(); 244 245 } 237 } 238 239 246 240 /** Method to set the default language. 247 241 * @param language The <strong>Language</strong> to use as a default, or <i>null</i> for no default. … … 271 265 } 272 266 } 273 Gatherer.c_man.configurationChanged();274 267 } 275 268 … … 372 365 language_metadata.setAttribute(StaticStrings.ASSIGNED_ATTRIBUTE, StaticStrings.TRUE_STR); 373 366 language_metadata.setAttribute(StaticStrings.NAME_ATTRIBUTE, value); 374 Gatherer.c_man.configurationChanged();375 367 } 376 368 }); -
trunk/gli/src/org/greenstone/gatherer/cdm/LevelManager.java
r12800 r12808 58 58 meta.setValue(level); 59 59 CollectionDesignManager.collectionmeta_manager.addMetadatum(meta); 60 61 Gatherer.c_man.configurationChanged(); 62 } 63 60 } 64 61 } 65 62 … … 110 107 if ((level_elem = getLevel(level_name)) != null) { 111 108 levels_model.remove(level_elem); 112 Gatherer.c_man.configurationChanged();113 109 } 114 110 } … … 143 139 } 144 140 } 145 Gatherer.c_man.configurationChanged();146 141 } 147 142 -
trunk/gli/src/org/greenstone/gatherer/cdm/PluginManager.java
r12798 r12808 157 157 addBefore(plugin, separator_plugin); 158 158 } 159 Gatherer.c_man.configurationChanged();160 159 } 161 160 … … 270 269 addBefore(plugin, first_plugin); 271 270 first_plugin = null; 272 Gatherer.c_man.configurationChanged();273 271 } 274 272 else { … … 277 275 // Add the moving plugin before the separator 278 276 addBefore(plugin, separator_plugin); 279 Gatherer.c_man.configurationChanged();280 277 } 281 278 } … … 295 292 remove(plugin); 296 293 add(index, plugin); 297 Gatherer.c_man.configurationChanged();298 294 } 299 295 else { … … 309 305 remove(plugin); 310 306 add(index, plugin); 311 Gatherer.c_man.configurationChanged();312 307 } 313 308 } … … 355 350 private void removePlugin(Plugin plugin) { 356 351 remove(plugin); 357 Gatherer.c_man.configurationChanged();358 352 } 359 353 … … 626 620 ac.destroy(); 627 621 ac = null; 628 // cos I can't be bothered checking every argument to see if it has changed or not, we'll asasume that the configuration has changed if someone has clicked configure629 Gatherer.c_man.configurationChanged();630 622 } 631 623 } … … 653 645 ac.destroy(); 654 646 ac = null; 655 // cos I can't be bothered checking every argument to see if it has changed or not, we'll asasume that the configuration has changed if someone has clicked configure656 Gatherer.c_man.configurationChanged();657 647 } 658 648 } -
trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndexManager.java
r12800 r12808 84 84 CollectionDesignManager.collectionmeta_manager.addMetadatum(metadatum); 85 85 add(getSize(), subcollection_index); 86 Gatherer.c_man.configurationChanged();87 86 } 88 87 } … … 154 153 } 155 154 156 // Schedule the collection for saving157 Gatherer.c_man.configurationChanged();158 155 return new_position; 159 156 } … … 174 171 // Remove the index 175 172 remove(subcollection_index); 176 Gatherer.c_man.configurationChanged();177 173 } 178 174 } … … 211 207 remove(old_subcollection); 212 208 add(position, new_subcollection); 213 214 // Schedule the collection for saving215 Gatherer.c_man.configurationChanged();216 217 209 } 218 210 … … 246 238 } 247 239 } 248 Gatherer.c_man.configurationChanged();249 240 } 250 241 -
trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionManager.java
r12123 r12808 88 88 // Failing that we insert immediately after a language string 89 89 add(root, subcollection, target_node); 90 Gatherer.c_man.configurationChanged();91 90 } 92 91 } … … 142 141 private void removeSubcollection(Subcollection subcollection) { 143 142 remove(subcollection); 144 Gatherer.c_man.configurationChanged();145 143 } 146 144 … … 152 150 subcollection.setSource(source); 153 151 refresh(subcollection); 154 Gatherer.c_man.configurationChanged();155 152 } 156 153 -
trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollectionManager.java
r12121 r12808 75 75 if(!contains(supercollection)) { 76 76 add(getSize(), supercollection); 77 Gatherer.c_man.configurationChanged(); 78 } 79 77 } 80 78 } 81 79 … … 113 111 if(contains(supercollection)) { 114 112 remove(supercollection); 115 Gatherer.c_man.configurationChanged();116 113 } 117 114 } -
trunk/gli/src/org/greenstone/gatherer/cdm/TranslationView.java
r12748 r12808 366 366 translation_text = null; 367 367 remove_button.setEnabled(true); 368 Gatherer.c_man.configurationChanged();369 368 } 370 369 add_button.setEnabled(false); … … 386 385 // If a remove occured then enable add 387 386 add_button.setEnabled(true); 388 Gatherer.c_man.configurationChanged();389 387 } 390 388 // Either way disable replace and remove … … 410 408 metadata = null; 411 409 remove_button.setEnabled(true); 412 Gatherer.c_man.configurationChanged();413 410 } 414 411 // Either way disable replace -
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r12806 r12808 251 251 } 252 252 253 254 /** Method that is called whenever something has changed in the configuration of this collection. */ 255 public void configurationChanged() { 256 if(collection != null) { 257 collection.setSaved(false); 258 collection.cdm.update_collect_cfg_required = true; 259 } 260 } 261 262 253 263 254 public void convertToGS3Collection() { 264 255 // Generate the convert_coll_from_gs2.pl command
Note:
See TracChangeset
for help on using the changeset viewer.