Class BeanDoubleListModel<O>

  • Type Parameters:
    O - the type of the object in the list
    All Implemented Interfaces:
    Serializable

    public class BeanDoubleListModel<O>
    extends org.jdesktop.beans.AbstractSerializableBean
    The model of the BeanDoubleList widget
    Since:
    2.5.8
    Author:
    Kevin Morin - kmorin@codelutin.com
    See Also:
    BeanDoubleList, Serialized Form
    • Field Detail

      • universe

        protected List<O> universe
        List of all the available items
      • universeModel

        protected final JaxxFilterableListModel<O> universeModel
        Model containing the remaining available items
      • selected

        protected final List<O> selected
        List of the selected items
      • selectedModel

        protected final JaxxDefaultListModel<O> selectedModel
        Model containing the selected items
      • addEnabled

        protected boolean addEnabled
      • removeEnabled

        protected boolean removeEnabled
      • selectedUpEnabled

        protected boolean selectedUpEnabled
      • selectedDownEnabled

        protected boolean selectedDownEnabled
      • useMultiSelect

        protected boolean useMultiSelect
    • Constructor Detail

      • BeanDoubleListModel

        public BeanDoubleListModel()
    • Method Detail

      • getSelected

        public List<O> getSelected()
        To get the selected items.
        Returns:
        a list of O
      • setSelected

        public void setSelected​(List<O> selected)
        Sets the list of selected items. It fills the model of the list of the selected items with these items and removes them from the model of list of the universe.
        Parameters:
        selected - a list of O
      • getUniverse

        public List<O> getUniverse()
        To get all the available items.
        Returns:
        a list of O
      • setUniverse

        public void setUniverse​(List<O> universe)
        Sets the list of the available items. It fills the model of the universe list with these items.
        Parameters:
        universe - a list of O
      • resetUniverse

        protected void resetUniverse()
      • getSelectedModel

        public ListModel<O> getSelectedModel()
      • addToSelected

        public void addToSelected​(O item)
        Adds an item to the selected items.
        Parameters:
        item - the item to select
      • addToSelected

        public void addToSelected​(List<O> items)
        Adds a list of items to the selected items.
        Parameters:
        items - the list of the items to select
      • removeFromSelected

        public void removeFromSelected​(O item)
        Removes an item from the selected items.
        Parameters:
        item - the item to unselect
      • removeFromSelected

        public void removeFromSelected​(List<O> items)
        Removes a list of items from the list of selected items.
        Parameters:
        items - the list of the items to unselect
      • moveUpSelected

        public void moveUpSelected​(O item)
        Move up a selected item.
        Parameters:
        item - the selected item
        Since:
        2.5.26
      • moveDownSelected

        public void moveDownSelected​(O item)
        Move down a selected item.
        Parameters:
        item - the selected item
        Since:
        2.5.26
      • isAddEnabled

        public boolean isAddEnabled()
      • setAddEnabled

        public void setAddEnabled​(boolean addEnabled)
      • isRemoveEnabled

        public boolean isRemoveEnabled()
      • setRemoveEnabled

        public void setRemoveEnabled​(boolean removeEnabled)
      • isSelectedUpEnabled

        public boolean isSelectedUpEnabled()
      • setSelectedUpEnabled

        public void setSelectedUpEnabled​(boolean selectedUpEnabled)
      • isSelectedDownEnabled

        public boolean isSelectedDownEnabled()
      • setSelectedDownEnabled

        public void setSelectedDownEnabled​(boolean selectedDownEnabled)
      • isUseMultiSelect

        public boolean isUseMultiSelect()
      • setUseMultiSelect

        public void setUseMultiSelect​(boolean useMultiSelect)
      • addToUniverseList

        protected void addToUniverseList​(O item)
        Adds an item to the available items list at the right index to keep always the same order.
        Parameters:
        item - the item to add to the universe list
      • getSelectedListSize

        public int getSelectedListSize()
      • addCanRemoveItemsPredicate

        public void addCanRemoveItemsPredicate​(Predicate<List<O>> canRemoveItemsPredicate)
      • removeCanRemoveItemsPredicate

        public void removeCanRemoveItemsPredicate​(Predicate<List<O>> canRemoveItemsPredicate)
      • computeRemoveEnabled

        public boolean computeRemoveEnabled​(List<O> toRemoveItems)