Changeset 6032


Ignore:
Timestamp:
2003-11-28T17:42:04+13:00 (20 years ago)
Author:
jmt12
Message:

Added a method to retrieve the hierarchy classifiers of a collection

File:
1 edited

Legend:

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

    r5984 r6032  
    162162    }
    163163    return controls;
     164    }
     165
     166    public ArrayList getHierarchyClassifiers() {
     167    ArrayList result = new ArrayList();
     168    for(int i = 0; i < getSize(); i++) {
     169        Classifier classifier = (Classifier) getElementAt(i);
     170        if(classifier.getName().equalsIgnoreCase(StaticStrings.HIERARCHY_CLASSIFIER)) {
     171        result.add(classifier);
     172        }
     173        classifier = null;
     174    }
     175    return result;
     176
    164177    }
    165178
     
    550563        classifier.setBackgroundSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false));
    551564        classifier.setEditable(true);
    552         classifier.setSelectedIndex(0);
    553565        classifier.setTextNonSelectionColor(Gatherer.config.getColor("coloring.workspace_tree_foreground", false));
    554566        classifier.setTextSelectionColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false));
    555         ccl.itemStateChanged(new ItemEvent(classifier, 0, null, ItemEvent.SELECTED));
     567        if(classifier.getItemCount() > 0) {
     568        classifier.setSelectedIndex(0);
     569        ccl.itemStateChanged(new ItemEvent(classifier, 0, null, ItemEvent.SELECTED));
     570        }
    556571
    557572        JLabel classifier_label = new JLabel();
Note: See TracChangeset for help on using the changeset viewer.