Changeset 10962


Ignore:
Timestamp:
2005-11-30T15:42:20+13:00 (18 years ago)
Author:
kjdon
Message:

added a getAll() method, and also made the mouse listener check for isEnabled() before responding, so can disable the checklist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/util/CheckList.java

    r9249 r10962  
    9797    }
    9898
     99    /** Retrieve all the entries from the list
     100     */
     101    public ArrayList getAll()
     102    {
     103    ArrayList result = new ArrayList();
     104    DefaultListModel model = (DefaultListModel) getModel();
     105    for (int i = 0; i < model.size(); i++) {
     106        CheckListEntry entry = (CheckListEntry) model.get(i);
     107        result.add(entry.getObject());
     108    }
     109    return result;
     110    }
     111   
    99112
    100113    /** Retrieve the currently ticked entries from this list.
     
    209222    public void mousePressed(MouseEvent e)
    210223    {
     224        if (!isEnabled()) return;
    211225        JList list = (JList) e.getSource();
    212226        int index = list.locationToIndex(e.getPoint());
Note: See TracChangeset for help on using the changeset viewer.