Changeset 12292
- Timestamp:
- 2006-07-24T17:00:16+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/ExplodeMetadataPrompt.java
r12119 r12292 67 67 /** the file we wil be exploding */ 68 68 private File metadata_file = null; 69 /** the name of the pluginto be used */70 private String plugin_name= null;69 /** the list of potential plugins to be used */ 70 private Argument plugin_arg = null; 71 71 /** holds all the available options for the exploding script */ 72 72 private ScriptOptions options = null; … … 85 85 86 86 // check that we actually have an explodable file 87 Plugin plugin = CollectionDesignManager.plugin_manager.getExploderPlugin(source_file);88 if ( plugin==null) {87 ArrayList exp_plugins = CollectionDesignManager.plugin_manager.getExploderPlugins(source_file); 88 if (exp_plugins.size() == 0) { 89 89 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("ExplodeMetadataPrompt.NotExplodable"), Dictionary.get("ExplodeMetadataPrompt.Title"), JOptionPane.ERROR_MESSAGE); 90 90 return; 91 91 } 92 plugin_ name = plugin.getName();92 plugin_arg = createPluginArgument(exp_plugins); 93 93 setJMenuBar(new SimpleMenuBar("explodingmetadata")); 94 94 setSize(SIZE); … … 176 176 } 177 177 178 private Argument createPluginArgument(ArrayList plugin_list) { 179 Argument arg = new Argument(); 180 arg.setName("plugin"); 181 arg.setDescription(Dictionary.get("ExplodeMetadataPrompt.Plugin")); 182 arg.setRequired(true); 183 arg.setType(Argument.ENUM); 184 for (int i=0; i<plugin_list.size(); i++) { 185 Plugin p = (Plugin)plugin_list.get(i); 186 arg.addOption(p.getName(), p.getName()); 187 } 188 return arg; 189 } 178 190 private void addScriptOptions(JPanel options_pane) { 179 191 … … 185 197 int total_argument_count = options.getArgumentCount(); 186 198 199 // first we add the plugin arg 200 ArgumentControl argument_control = new ArgumentControl(plugin_arg,true, null); 201 argument_control.setBackground(Configuration.getColor("coloring.collection_heading_background", false)); 202 options_pane.add((JComponent)argument_control); 187 203 for(int i = 0; i < total_argument_count; i++) { 188 204 // Retrieve the argument so we know how to format the control. … … 193 209 } 194 210 // by default, all args are disabled, and no value 195 ArgumentControlargument_control = new ArgumentControl(argument,false, null);211 argument_control = new ArgumentControl(argument,false, null); 196 212 // make sure they are coloured the way we want - this is not the standard arg control coloring 197 213 argument_control.setBackground(Configuration.getColor("coloring.collection_heading_background", false)); … … 239 255 } 240 256 command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "explode_metadata_database.pl"); 241 command_parts_list.add("-plugin"); 242 command_parts_list.add(plugin_name); 243 257 244 258 // Add in all the options from the user 245 259 String[] explode_options = options.getValues(); … … 250 264 // Add in the filename 251 265 command_parts_list.add(metadata_file.getPath()); 252 253 266 // Run the explode_metadata_database.pl command 254 267 String[] command_parts = (String[]) command_parts_list.toArray(new String[0]);
Note:
See TracChangeset
for help on using the changeset viewer.