Ignore:
Timestamp:
2008-08-28T10:34:38+12:00 (16 years ago)
Author:
kjdon
Message:

moved MetadataXMLPlugin 'below the line' in plugin list. you always need it in gli, and so Ian thought it should go with the other two that you can't remove or move

File:
1 edited

Legend:

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

    r15883 r17035  
    7070    private JPanel separator;
    7171    private Plugin separator_plugin;
     72
     73  /** The number of plugins that are fixed 'below the line' */
     74  private static int NUM_FIXED_PLUGINS = 3;
    7275    /** Constructor.
    7376     */
     
    117120        if (!plugin.isAbstract()) {
    118121        String plugin_name = plugin.getName();
    119         if (!plugin_name.equals(StaticStrings.ARCPLUG_STR) && !plugin_name.equals(StaticStrings.RECPLUG_STR)) {
    120             available.add(plugin);
     122        if (!plugin_name.equals(StaticStrings.ARCPLUG_STR) && !plugin_name.equals(StaticStrings.RECPLUG_STR) && !plugin_name.equals(StaticStrings.METADATAXMLPLUG_STR)) {
     123          available.add(plugin);
    121124        }
    122125        }
     
    196199     */
    197200    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)) {
    199202        addAfter(plugin, separator_plugin); // Adds after separator
    200203    } else {
     
    273276    int result = super.getSize();
    274277    if(modify_row_count) {
    275         result = result-3;
     278      result = result-(NUM_FIXED_PLUGINS+1);
    276279    }
    277280    return result;
     
    295298    private void movePlugin(Plugin plugin, boolean direction, boolean all) {
    296299    // Can't ever move RecPlug or ArcPlug
    297     if(super.getSize() < 4) {
     300      if(super.getSize() < (NUM_FIXED_PLUGINS+2)) {
    298301        //DebugStream.println("Not enough plugins to allow moving.");
    299302        return;
    300303    }
    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)) {
    302305        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.Move.Fixed"), Dictionary.get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);
    303306        return;
     
    364367        Plugin plugin = (Plugin) getElementAt(index);
    365368        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)) {
    367370            found_fixed = true;
    368371            index--;
     
    398401
    399402
    400     /** Inform the model to hide/show the last three lines on the list.
    401      * @param modify_row_count true to hide the last three lines, false otherwise
     403    /** 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
    402405     */
    403406    private void setHideLines(boolean modify_row_count) {
     
    405408    int original_size = super.getSize();
    406409    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);
    408411    }
    409412    else {
    410         fireIntervalAdded(this, original_size - 4, original_size - 1);
     413      fireIntervalAdded(this, original_size - (NUM_FIXED_PLUGINS+2), original_size - 1);
    411414    }
    412415    }
     
    724727            String plugin_name = selected_plugin.getName();
    725728            // 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)) {
    727730              move_up_button.setEnabled(false);
    728731              move_down_button.setEnabled(false);
    729732              remove.setEnabled(false);
    730             } else if (plugin_name.equals(StaticStrings.METADATAXMLPLUG_STR)) {
    731               remove.setEnabled(false);
    732             }
     733            }
    733734           
    734735            else {
Note: See TracChangeset for help on using the changeset viewer.