Package com.illumon.iris.gui.widget
Class JCheckBoxListModel<E>
java.lang.Object
javax.swing.AbstractListModel<E>
javax.swing.DefaultListModel<E>
com.illumon.iris.gui.widget.JCheckBoxListModel<E>
- Type Parameters:
E
- the type of the elements of this model
- All Implemented Interfaces:
Serializable
,ListModel<E>
public class JCheckBoxListModel<E> extends DefaultListModel<E>
List model for JCheckBoxLIst
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description JCheckBoxListModel()
-
Method Summary
Modifier and Type Method Description void
deselectAll()
Deselects all elements in the list model.Set<E>
getSelectedSet()
Gets the selected set of elements.boolean
isSelected(E element)
Checks if an element is selected.void
selectAll()
Selects all the elements in the list model.void
toggleSelection(E element)
Toggles the selection of an element on or off.Methods inherited from class javax.swing.DefaultListModel
add, addAll, addAll, addElement, capacity, clear, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, get, getElementAt, getSize, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeAllElements, removeElement, removeElementAt, removeRange, set, setElementAt, setSize, size, toArray, toString, trimToSize
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
Constructor Details
-
JCheckBoxListModel
public JCheckBoxListModel()
-
-
Method Details
-
toggleSelection
Toggles the selection of an element on or off.- Parameters:
element
- the element to toggle
-
isSelected
Checks if an element is selected.- Parameters:
element
- the element to check- Returns:
- true if it selected, false otherwise
-
getSelectedSet
Gets the selected set of elements.- Returns:
- the selected set of elements
-
selectAll
public void selectAll()Selects all the elements in the list model. -
deselectAll
public void deselectAll()Deselects all elements in the list model.
-