Package jaxx.runtime.swing.list
Class DefaultCheckListModel<T>
- java.lang.Object
-
- javax.swing.AbstractListModel
-
- jaxx.runtime.swing.list.DefaultCheckListModel<T>
-
- Type Parameters:
T- list element type
- All Implemented Interfaces:
Serializable,ListModel,CheckListModel<T>
- Direct Known Subclasses:
DefaultFilterableCheckListModel
public class DefaultCheckListModel<T> extends AbstractListModel implements CheckListModel<T>
Default model for check list. It is based on the list of items Implementation of checks is based on HashSet of checked items- Author:
- Eugene Ryzhikov, Kevin Morin
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<T>checksprotected List<T>data-
Fields inherited from class javax.swing.AbstractListModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description DefaultCheckListModel(Collection<? extends T> data)DefaultCheckListModel(T... data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<T>data()Collection<T>getCheckedItems()Returns a collections of checked itemsObjectgetElementAt(int index)intgetOriginalSize()Returns the number of items before the filter was appliedintgetSize()booleanisCheckedIndex(int index)Returns the check state of the element at specified positionvoidsetCheckedIndex(int index, boolean value)Sets the check state of the element at specified positionvoidsetCheckedItems(Collection<T> items)Sets checked items-
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
-
-
-
-
Constructor Detail
-
DefaultCheckListModel
public DefaultCheckListModel(Collection<? extends T> data)
-
DefaultCheckListModel
public DefaultCheckListModel(T... data)
-
-
Method Detail
-
getOriginalSize
public int getOriginalSize()
Description copied from interface:CheckListModelReturns the number of items before the filter was applied- Specified by:
getOriginalSizein interfaceCheckListModel<T>- Returns:
-
getElementAt
public Object getElementAt(int index)
- Specified by:
getElementAtin interfaceListModel<T>
-
isCheckedIndex
public boolean isCheckedIndex(int index)
Description copied from interface:CheckListModelReturns the check state of the element at specified position- Specified by:
isCheckedIndexin interfaceCheckListModel<T>- Parameters:
index- element index- Returns:
- true if element at specified position is checked
-
setCheckedIndex
public void setCheckedIndex(int index, boolean value)Description copied from interface:CheckListModelSets the check state of the element at specified position- Specified by:
setCheckedIndexin interfaceCheckListModel<T>- Parameters:
index- element index
-
getCheckedItems
public Collection<T> getCheckedItems()
Description copied from interface:CheckListModelReturns a collections of checked items- Specified by:
getCheckedItemsin interfaceCheckListModel<T>- Returns:
-
setCheckedItems
public void setCheckedItems(Collection<T> items)
Description copied from interface:CheckListModelSets checked items- Specified by:
setCheckedItemsin interfaceCheckListModel<T>
-
-