Class 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 Detail

      • CheckList

        public CheckList()
        Wraps the standard JList and makes it work like check list
    • 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 -
      • 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)