com.ezware.oxbow.swingbits.list
Class CheckList<T>

java.lang.Object
  extended by com.ezware.oxbow.swingbits.list.CheckList<T>
Type Parameters:
T - list item type

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

Nested Class Summary
static class CheckList.Builder
           
 
Method Summary
 void filter(String filter, IObjectToStringTranslator translator, CheckListFilterType filterType)
          Filters list view without losing actual data
 Collection<T> getCheckedItems()
          Returns a collection of checked items.
 JList getList()
           
 ICheckListModel<T> getModel()
           
 void setCheckedItems(Collection<T> elements)
          Resets checked elements
 void setData(Collection<T> data)
          Sets data to a check list.
 void setModel(ICheckListModel<T> model)
          Sets the model for check list.
 void toggleIndex(int index)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(ICheckListModel<T> model)
Sets the model for check list.

Parameters:
model -

getModel

public ICheckListModel<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 -

filter

public void filter(String filter,
                   IObjectToStringTranslator translator,
                   CheckListFilterType filterType)
Filters list view without losing actual data

Parameters:
filter -
translator -

toggleIndex

public void toggleIndex(int index)


Copyright © 2011. All Rights Reserved.