com.ezware.oxbow.swingbits.list
Class DefaultCheckListModel<T>
java.lang.Object
javax.swing.AbstractListModel
com.ezware.oxbow.swingbits.list.DefaultCheckListModel<T>
- Type Parameters:
T
- list element type
- All Implemented Interfaces:
- ICheckListModel<T>, Serializable, ListModel
public class DefaultCheckListModel<T>
- extends AbstractListModel
- implements ICheckListModel<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
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_TRANSLATOR
public static IObjectToStringTranslator DEFAULT_TRANSLATOR
DefaultCheckListModel
public DefaultCheckListModel(Collection<? extends T> data)
DefaultCheckListModel
public DefaultCheckListModel(T... data)
getSize
public int getSize()
- Specified by:
getSize
in interface ListModel
getElementAt
public Object getElementAt(int index)
- Specified by:
getElementAt
in interface ListModel
isCheckedIndex
public boolean isCheckedIndex(int index)
- Description copied from interface:
ICheckListModel
- Returns the check state of the element at specified position
- Specified by:
isCheckedIndex
in interface ICheckListModel<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:
ICheckListModel
- Sets the check state of the element at specified position
- Specified by:
setCheckedIndex
in interface ICheckListModel<T>
- Parameters:
index
- element index
getCheckedItems
public Collection<T> getCheckedItems()
- Description copied from interface:
ICheckListModel
- Returns a collections of checked items
- Specified by:
getCheckedItems
in interface ICheckListModel<T>
- Returns:
setCheckedItems
public void setCheckedItems(Collection<T> items)
- Description copied from interface:
ICheckListModel
- Sets checked items
- Specified by:
setCheckedItems
in interface ICheckListModel<T>
filter
public void filter(String filter,
IObjectToStringTranslator translator,
CheckListFilterType filterType)
- Description copied from interface:
ICheckListModel
- Allows filtered view. Setting empty or null filter will clear filter and show all items
- Specified by:
filter
in interface ICheckListModel<T>
- Parameters:
filter
- filter stringtranslator
- object to string translator to aid the search
Copyright © 2011. All Rights Reserved.