Changeset 12238
- Timestamp:
- 2006-07-17T11:09:28+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/MetadataSetDialog.java
r12142 r12238 132 132 public void actionPerformed(ActionEvent event) { 133 133 MetadataSet metadata_set = (MetadataSet) current_set_list.getSelectedValue(); 134 current_metadata_model.removeElement(metadata_set); 134 135 Gatherer.c_man.removeMetadataSet(metadata_set); 135 current_metadata_model.removeElement(metadata_set);136 136 sets_changed = true; 137 137 … … 179 179 super(Gatherer.g_man, true); 180 180 add_set_dialog = this; 181 182 181 setModal(true); 183 182 setJMenuBar(new SimpleMenuBar("choosingmetadatasets")); … … 282 281 } 283 282 MetadataSet metadata_set = (MetadataSet) available_sets_list.getSelectedValue(); 283 String namespace = metadata_set.getNamespace(); 284 // have we got a variant already in the collection?? 285 MetadataSet existing_set = null; 286 if ((existing_set = MetadataSetManager.getMetadataSet(namespace)) != null) { 287 // warn that we are replacing 288 String [] args = new String [] {metadata_set.toString(), existing_set.toString()}; 289 WarningDialog namespace_clash_dialog = new WarningDialog("warning.MetadataSetNamespaceClash", Dictionary.get("MetadataSetNamespaceClash.Title"), Dictionary.get("MetadataSetNamespaceClash.Message", args), null, true); 290 if (namespace_clash_dialog.display()==JOptionPane.CANCEL_OPTION) { 291 namespace_clash_dialog.dispose(); 292 return; 293 } 294 // if we have got here, then we remove the old set 295 current_metadata_model.removeElement(existing_set); 296 Gatherer.c_man.removeMetadataSet(existing_set); 297 sets_changed = true; 298 namespace_clash_dialog.dispose(); 299 } 300 301 284 302 Gatherer.c_man.importMetadataSet(metadata_set); 303 metadata_set = MetadataSetManager.getMetadataSet(namespace); 285 304 current_metadata_model.addElement(metadata_set); 305 sets_changed = true; 286 306 cancelled = false; 287 307 add_set_dialog.dispose();
Note:
See TracChangeset
for help on using the changeset viewer.