- Timestamp:
- 2003-10-06T13:32:25+13:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/checklist/CheckList.java
r5159 r5581 35 35 *######################################################################## 36 36 */ 37 38 39 40 41 42 43 /* GPL_HEADER */44 37 package org.greenstone.gatherer.checklist; 38 45 39 /************************************************************************************** 46 40 * Title: Gatherer … … 56 50 import javax.swing.border.*; 57 51 import org.greenstone.gatherer.checklist.Entry; 52 58 53 /** This class provides a visual component that has the form of a list, as provided by JList but uses JCheckBox for data selection. Thus several elements can be 'ticked' in the list, and this selection returned using the method getSelected().<BR>Parts of this code modified from Trevor Harmon's posting on www.dejanews.com. 59 54 * @author John Thompson … … 156 151 157 152 /** Retrieve the currently ticked entries from this list. 158 159 160 153 * @return An <strong>ArrayList</strong> containing only those entries from the initial list that are checked. 154 * @see org.greenstone.gatherer.checklist.CheckList.Entry 155 */ 161 156 public ArrayList getSelected() { 162 157 ArrayList result = new ArrayList(); … … 230 225 231 226 /** Checks the entries in the list whose name appear in the given array. 232 233 234 227 * @param names The name of entries to be checked as a <strong>String[]</strong>. 228 * @see org.greenstone.gatherer.checklist.CheckList.Entry 229 */ 235 230 public void setSelected(String names[]) { 236 231 DefaultListModel model = (DefaultListModel) getModel(); … … 260 255 * @param cell_has_focus <i>true</i> if and only if the specified cell has the focus. 261 256 * @return A <strong>Component</strong> whose paint() method will render the specified value. 262 257 */ 263 258 public Component getListCellRendererComponent(JList list, Object value, int index, boolean is_selected, boolean cell_has_focus) { 264 259 JCheckBox checkbox = (JCheckBox) value; … … 301 296 } 302 297 } 303
Note:
See TracChangeset
for help on using the changeset viewer.