Changeset 18588

Show
Ignore:
Timestamp:
23.02.2009 15:33:19 (11 years ago)
Author:
kjdon
Message:

GLI three modes change: duplicate plugins can be added now in librarian mode. plugin movement can also occur in all modes. The only mode dependent thing left is that special plugs are hidden/non-removable in lower modes, visible in expert mode.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/cdm/PluginManager.java

    r18525 r18588  
    124124        } 
    125125        } 
    126     } 
    127  
    128     // Now remove any assigned plugins 
    129     if (Configuration.getMode() < Configuration.SYSTEMS_MODE) { 
    130         available.removeAll(children()); 
    131126    } 
    132127         
     
    549544        plugin_list_pane.add(plugin_list_label, BorderLayout.NORTH); 
    550545        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 
    552548 
    553549        plugin_label.setBorder(BorderFactory.createEmptyBorder(0,0,5,0)); 
     
    600596    public void modeChanged(int mode) { 
    601597        // 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();     
    605599        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 
    619602        plugin_list_pane.updateUI(); 
    620603    } 
     
    663646            assignPlugin(new_plugin); 
    664647            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             } 
    671648        } 
    672649        } 
     
    752729            else { 
    753730              // don't let people remove special plugins such GreenstoneXMLPlug and GreenstoneMETSPlug, 
    754               // unless they are in systems mode or above 
     731              // unless they are in expert mode or above 
    755732              int mode = Configuration.getMode(); 
    756733              for (int i=0; i<StaticStrings.KEEP_PLUG.length; i++) { 
    757734                if ((plugin_name.equals(StaticStrings.KEEP_PLUG[i])) && 
    758                   (mode < Configuration.SYSTEMS_MODE)) { 
     735                  (mode < Configuration.EXPERT_MODE)) { 
    759736                  remove.setEnabled(false); 
    760737                  break; 
     
    883860             
    884861            // don't let people remove special plugins such GAPlug an METSPlug, 
    885             // unless they are in systems mode or above 
     862            // unless they are in expert mode or above 
    886863            int mode = Configuration.getMode(); 
    887864            for (int i=0; i<StaticStrings.KEEP_PLUG.length; i++) { 
     
    893870                remove.setEnabled(false); 
    894871              }else if ((selected_plugin_name.equals(StaticStrings.KEEP_PLUG[i])) && 
    895                 (mode < Configuration.SYSTEMS_MODE)) { 
     872                (mode < Configuration.EXPERT_MODE)) { 
    896873                remove.setEnabled(false); 
    897874                break;