Package jaxx.runtime.swing.list
Class CheckList<T>
- java.lang.Object
-
- jaxx.runtime.swing.list.CheckList<T>
-
- Type Parameters:
T- list item type
- Direct Known Subclasses:
FilterableCheckList
public class CheckList<T> extends Object
The decorator for JList which makes it work like check list UI can be designed using JList and which can be later decorated to become a check list- Author:
- Eugene Ryzhikov, Kevin Morin
-
-
Constructor Summary
Constructors Constructor Description CheckList()Wraps the standard JList and makes it work like check list
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<T>getCheckedItems()Returns a collection of checked items.JListgetList()CheckListModel<T>getModel()voidsetCheckedItems(Collection<T> elements)Resets checked elementsvoidsetData(Collection<T> data)Sets data to a check list.voidsetModel(CheckListModel<T> model)Sets the model for check list.voidtoggleIndex(int index)
-
-
-
Method Detail
-
getList
public JList getList()
-
setData
public void setData(Collection<T> data)
Sets data to a check list. Simplification for setting new the model- Parameters:
data-
-
setModel
public void setModel(CheckListModel<T> model)
Sets the model for check list.- Parameters:
model-
-
getModel
public CheckListModel<T> getModel()
-
getCheckedItems
public Collection<T> getCheckedItems()
Returns a collection of checked items.- Returns:
- collection of checked items. Empty collection if nothing is selected
-
setCheckedItems
public void setCheckedItems(Collection<T> elements)
Resets checked elements- Parameters:
elements-
-
toggleIndex
public void toggleIndex(int index)
-
-