- Timestamp:
- 2009-02-23T15:33:19+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/cdm/PluginManager.java
r18525 r18588 124 124 } 125 125 } 126 }127 128 // Now remove any assigned plugins129 if (Configuration.getMode() < Configuration.SYSTEMS_MODE) {130 available.removeAll(children());131 126 } 132 127 … … 549 544 plugin_list_pane.add(plugin_list_label, BorderLayout.NORTH); 550 545 plugin_list_pane.add(new JScrollPane(plugin_list), BorderLayout.CENTER); 551 modeChanged(Configuration.getMode()); // Whether the movement buttons are visible is mode dependant 546 plugin_list_pane.add(movement_pane, BorderLayout.LINE_END); 547 modeChanged(Configuration.getMode()); // Whether the special plugins are hidden or not is mode dependant 552 548 553 549 plugin_label.setBorder(BorderFactory.createEmptyBorder(0,0,5,0)); … … 600 596 public void modeChanged(int mode) { 601 597 // First of all we clear the current selection, as there can be some serious problems if the user selects the plugins we're hiding, or had the last plugin selected before we unhid the last three 602 plugin_list.clearSelection(); 603 // The first change is dependant on whether the user is systems mode or higher 604 598 plugin_list.clearSelection(); 605 599 plugin_combobox.setModel(new DefaultComboBoxModel(getAvailablePlugins())); 606 607 if(mode >= Configuration.SYSTEMS_MODE) { 608 // Show movement buttons 609 610 plugin_list_pane.add(movement_pane, BorderLayout.EAST); 611 // Do we show Arc and RecPlugs or hide them and the separator line 612 setHideLines(!(mode >= Configuration.EXPERT_MODE)); 613 } 614 // Otherwise hide the movement buttons and fixed plugins 615 else { 616 plugin_list_pane.remove(movement_pane); 617 setHideLines(true); 618 } 600 setHideLines(!(mode >= Configuration.EXPERT_MODE)); 601 619 602 plugin_list_pane.updateUI(); 620 603 } … … 663 646 assignPlugin(new_plugin); 664 647 plugin_list.setSelectedValue(new_plugin, true); 665 666 // Remove the plugin from the available list (unless we're in a high mode, or it's UnknownPlug)667 if (Configuration.getMode() < Configuration.SYSTEMS_MODE && !plugin_name.equals(StaticStrings.UNKNOWNPLUG_STR)) {668 plugin_combobox.removeItem(plugin);669 plugin_combobox.setSelectedIndex(0);670 }671 648 } 672 649 } … … 752 729 else { 753 730 // don't let people remove special plugins such GreenstoneXMLPlug and GreenstoneMETSPlug, 754 // unless they are in systemsmode or above731 // unless they are in expert mode or above 755 732 int mode = Configuration.getMode(); 756 733 for (int i=0; i<StaticStrings.KEEP_PLUG.length; i++) { 757 734 if ((plugin_name.equals(StaticStrings.KEEP_PLUG[i])) && 758 (mode < Configuration. SYSTEMS_MODE)) {735 (mode < Configuration.EXPERT_MODE)) { 759 736 remove.setEnabled(false); 760 737 break; … … 883 860 884 861 // don't let people remove special plugins such GAPlug an METSPlug, 885 // unless they are in systemsmode or above862 // unless they are in expert mode or above 886 863 int mode = Configuration.getMode(); 887 864 for (int i=0; i<StaticStrings.KEEP_PLUG.length; i++) { … … 893 870 remove.setEnabled(false); 894 871 }else if ((selected_plugin_name.equals(StaticStrings.KEEP_PLUG[i])) && 895 (mode < Configuration. SYSTEMS_MODE)) {872 (mode < Configuration.EXPERT_MODE)) { 896 873 remove.setEnabled(false); 897 874 break;
Note:
See TracChangeset
for help on using the changeset viewer.