Changeset 12303 for trunk/gli/src/org
- Timestamp:
- 2006-07-25T13:48:53+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/PluginManager.java
r12293 r12303 848 848 Object selected_object = plugin_combobox.getSelectedItem(); 849 849 if(selected_object != null) { 850 // Retrieve the base plugin if any850 // Retrieve the base plugin 851 851 Plugin base_plugin = getBasePlugin(selected_object.toString()); 852 852 if (base_plugin == null) { 853 // shouldn't happen 854 return; 855 } 856 853 857 // Create a new element in the DOM 854 858 Element element = CollectionDesignManager.collect_config.document.createElement(CollectionConfiguration.PLUGIN_ELEMENT); … … 863 867 plugin_list.setSelectedValue(new_plugin, true); 864 868 // Since we weren't cancelled, if we are in a low mode, remove the plugin from the available list (except for UnknownPlug 865 if( base_plugin != null &&Configuration.getMode() <= Configuration.SYSTEMS_MODE && !base_plugin.getName().equals(StaticStrings.UNKNOWNPLUG_STR)) {869 if(Configuration.getMode() <= Configuration.SYSTEMS_MODE && !base_plugin.getName().equals(StaticStrings.UNKNOWNPLUG_STR)) { 866 870 plugin_combobox.removeItem(base_plugin); 867 871 plugin_combobox.setSelectedIndex(0); … … 1196 1200 Object selected_object = suitable_plugins_combobox.getSelectedItem(); 1197 1201 Plugin base_plugin = getBasePlugin(selected_object.toString()); 1198 1202 if (base_plugin == null) { 1203 // shouldn't happen - we are not allowed custom plugins anymore 1204 setVisible(false); 1205 return; 1206 } 1199 1207 // Create a new element in the DOM 1200 1208 Element element = CollectionDesignManager.collect_config.document.createElement(CollectionConfiguration.PLUGIN_ELEMENT); 1201 // Remember that the plugin supplied might be a custom string rather than a base plugin 1202 Plugin new_plugin = null; 1203 if(base_plugin != null) { 1204 //DebugStream.println("New Plugin based on existing Plugin"); 1205 element.setAttribute(CollectionConfiguration.TYPE_ATTRIBUTE, base_plugin.getName()); 1206 new_plugin = new Plugin(element, base_plugin); 1207 } 1208 else { 1209 //DebugStream.println("New Custom Plugin"); 1210 element.setAttribute(CollectionConfiguration.TYPE_ATTRIBUTE, selected_object.toString()); 1211 new_plugin = new Plugin(element, null); 1212 } 1209 element.setAttribute(CollectionConfiguration.TYPE_ATTRIBUTE, base_plugin.getName()); 1210 Plugin new_plugin = new Plugin(element, base_plugin); 1213 1211 assignPlugin(new_plugin); 1214 1212 } // else do nothing … … 1238 1236 1239 1237 /** This class behaves just like a normal JSeparator except that, no matter what the current settings in the UIManager are, it always paints itself with BasicSeparatorUI. */ 1240 private class BasicSeparator1238 private static class BasicSeparator 1241 1239 extends JSeparator { 1242 1240
Note:
See TracChangeset
for help on using the changeset viewer.