- Timestamp:
- 2008-08-28T10:34:38+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/cdm/PluginManager.java
r15883 r17035 70 70 private JPanel separator; 71 71 private Plugin separator_plugin; 72 73 /** The number of plugins that are fixed 'below the line' */ 74 private static int NUM_FIXED_PLUGINS = 3; 72 75 /** Constructor. 73 76 */ … … 117 120 if (!plugin.isAbstract()) { 118 121 String plugin_name = plugin.getName(); 119 if (!plugin_name.equals(StaticStrings.ARCPLUG_STR) && !plugin_name.equals(StaticStrings.RECPLUG_STR) ) {120 122 if (!plugin_name.equals(StaticStrings.ARCPLUG_STR) && !plugin_name.equals(StaticStrings.RECPLUG_STR) && !plugin_name.equals(StaticStrings.METADATAXMLPLUG_STR)) { 123 available.add(plugin); 121 124 } 122 125 } … … 196 199 */ 197 200 private void assignPlugin(Plugin plugin) { 198 if(plugin.getName().equals(StaticStrings.RECPLUG_STR) || plugin.getName().equals(StaticStrings.ARCPLUG_STR)) {201 if(plugin.getName().equals(StaticStrings.RECPLUG_STR) || plugin.getName().equals(StaticStrings.ARCPLUG_STR) || plugin.getName().equals(StaticStrings.METADATAXMLPLUG_STR)) { 199 202 addAfter(plugin, separator_plugin); // Adds after separator 200 203 } else { … … 273 276 int result = super.getSize(); 274 277 if(modify_row_count) { 275 result = result-3;278 result = result-(NUM_FIXED_PLUGINS+1); 276 279 } 277 280 return result; … … 295 298 private void movePlugin(Plugin plugin, boolean direction, boolean all) { 296 299 // Can't ever move RecPlug or ArcPlug 297 if(super.getSize() < 4) {300 if(super.getSize() < (NUM_FIXED_PLUGINS+2)) { 298 301 //DebugStream.println("Not enough plugins to allow moving."); 299 302 return; 300 303 } 301 if(plugin.getName().equals(StaticStrings.ARCPLUG_STR) || plugin.getName().equals(StaticStrings.RECPLUG_STR) ) {304 if(plugin.getName().equals(StaticStrings.ARCPLUG_STR) || plugin.getName().equals(StaticStrings.RECPLUG_STR) || plugin.getName().equals(StaticStrings.METADATAXMLPLUG_STR)) { 302 305 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.Move.Fixed"), Dictionary.get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE); 303 306 return; … … 364 367 Plugin plugin = (Plugin) getElementAt(index); 365 368 String name = plugin.getName(); 366 if(name.equals(StaticStrings.RECPLUG_STR) || name.equals(StaticStrings.ARCPLUG_STR) ) {369 if(name.equals(StaticStrings.RECPLUG_STR) || name.equals(StaticStrings.ARCPLUG_STR) || name.equals(StaticStrings.METADATAXMLPLUG_STR)) { 367 370 found_fixed = true; 368 371 index--; … … 398 401 399 402 400 /** Inform the model to hide/show the last threelines on the list.401 * @param modify_row_count true to hide the last threelines, false otherwise403 /** Inform the model to hide/show the last four lines on the list. 404 * @param modify_row_count true to hide the last four lines, false otherwise 402 405 */ 403 406 private void setHideLines(boolean modify_row_count) { … … 405 408 int original_size = super.getSize(); 406 409 if(modify_row_count) { 407 fireIntervalRemoved(this, original_size - 4, original_size - 1);410 fireIntervalRemoved(this, original_size - (NUM_FIXED_PLUGINS+2), original_size - 1); 408 411 } 409 412 else { 410 fireIntervalAdded(this, original_size - 4, original_size - 1);413 fireIntervalAdded(this, original_size - (NUM_FIXED_PLUGINS+2), original_size - 1); 411 414 } 412 415 } … … 724 727 String plugin_name = selected_plugin.getName(); 725 728 // Some buttons are only available for plugins other than ArcPlug and RecPlug 726 if(plugin_name.equals(StaticStrings.ARCPLUG_STR) || plugin_name.equals(StaticStrings.RECPLUG_STR) ) {729 if(plugin_name.equals(StaticStrings.ARCPLUG_STR) || plugin_name.equals(StaticStrings.RECPLUG_STR) || plugin_name.equals(StaticStrings.METADATAXMLPLUG_STR)) { 727 730 move_up_button.setEnabled(false); 728 731 move_down_button.setEnabled(false); 729 732 remove.setEnabled(false); 730 } else if (plugin_name.equals(StaticStrings.METADATAXMLPLUG_STR)) { 731 remove.setEnabled(false); 732 } 733 } 733 734 734 735 else {
Note:
See TracChangeset
for help on using the changeset viewer.