Interface SelectionModel<R>

    • Method Detail

      • selectionEmptyObserver

        StateObserver selectionEmptyObserver()
        Returns:
        a StateObserver indicating whether the selection is empty
      • selectionNotEmptyObserver

        StateObserver selectionNotEmptyObserver()
        Returns:
        a StateObserver indicating whether one or more items are selected
      • multipleSelectionObserver

        StateObserver multipleSelectionObserver()
        Returns:
        a StateObserver indicating whether multiple rows are selected
      • singleSelectionObserver

        StateObserver singleSelectionObserver()
        Returns:
        a StateObserver indicating whether a single row is selected
      • singleSelectionModeState

        State singleSelectionModeState()
        Returns:
        a State controlling the single selection mode of this selection model
      • addSelectionChangedListener

        void addSelectionChangedListener​(EventListener listener)
        Parameters:
        listener - a listener to be notified each time the selection changes
      • removeSelectionChangedListener

        void removeSelectionChangedListener​(EventListener listener)
        Parameters:
        listener - the listener to remove
      • addSelectedIndexListener

        void addSelectedIndexListener​(EventDataListener<Integer> listener)
        Parameters:
        listener - a listener to be notified each time the selected index changes
      • removeSelectedIndexListener

        void removeSelectedIndexListener​(EventDataListener<Integer> listener)
        Parameters:
        listener - the listener to remove
      • addSelectedIndexesListener

        void addSelectedIndexesListener​(EventDataListener<List<Integer>> listener)
        Parameters:
        listener - a listener to be notified each time the selected indexes change
      • removeSelectedIndexesListener

        void removeSelectedIndexesListener​(EventDataListener<List<Integer>> listener)
        Parameters:
        listener - the listener to remove
      • addSelectedItemListener

        void addSelectedItemListener​(EventDataListener<R> listener)
        Parameters:
        listener - a listener to be notified each time the selected item changes
      • removeSelectedItemListener

        void removeSelectedItemListener​(EventDataListener<R> listener)
        Parameters:
        listener - the listener to remove
      • addSelectedItemsListener

        void addSelectedItemsListener​(EventDataListener<List<R>> listener)
        Parameters:
        listener - a listener to be notified each time the selected items change
      • removeSelectedItemsListener

        void removeSelectedItemsListener​(EventDataListener<List<R>> listener)
        Parameters:
        listener - the listener to remove
      • moveSelectionDown

        void moveSelectionDown()
        Moves all selected indexes down one index, wraps around. If the selection is empty the first item in this model is selected.
        See Also:
        addSelectionChangedListener(EventListener)
      • moveSelectionUp

        void moveSelectionUp()
        Moves all selected indexes up one index, wraps around. If the selection is empty the last item in this model is selected.
        See Also:
        addSelectionChangedListener(EventListener)
      • getSelectedIndex

        int getSelectedIndex()
        Returns:
        the index of the selected record, -1 if none is selected and the lowest index if more than one record is selected
      • addSelectedIndex

        void addSelectedIndex​(int index)
        Selects the item at index
        Parameters:
        index - the index
      • removeSelectedIndex

        void removeSelectedIndex​(int index)
        Removes the item at index from the selection
        Parameters:
        index - the index
      • removeSelectedIndexes

        void removeSelectedIndexes​(Collection<Integer> indexes)
        Removes the given indexes from the selection
        Parameters:
        indexes - the indexes
      • setSelectedIndex

        void setSelectedIndex​(int index)
        Clears the selection and selects the item at index
        Parameters:
        index - the index
      • setSelectedIndexes

        void setSelectedIndexes​(Collection<Integer> indexes)
        Selects the given indexes
        Parameters:
        indexes - the indexes to select
      • getSelectedIndexes

        List<Integer> getSelectedIndexes()
        Returns:
        the selected indexes, an empty list if selection is empty
      • addSelectedIndexes

        void addSelectedIndexes​(Collection<Integer> indexes)
        Adds these indexes to the selection
        Parameters:
        indexes - the indexes to add to the selection
      • selectionCount

        int selectionCount()
        Returns:
        the number of selected indexes in the underlying selection model.
      • setSelectedItems

        void setSelectedItems​(Collection<R> items)
        Selects the given items
        Parameters:
        items - the items to select
      • getSelectedItems

        List<R> getSelectedItems()
        Returns:
        a list containing the selected items
      • getSelectedItem

        R getSelectedItem()
        Returns:
        the item at the lowest selected index, null if none is selected
      • setSelectedItem

        void setSelectedItem​(R item)
        Sets the selected item
        Parameters:
        item - the item to select
      • addSelectedItem

        void addSelectedItem​(R item)
        Adds the given item to the selection
        Parameters:
        item - the item to add to the selection
      • addSelectedItems

        void addSelectedItems​(Collection<R> items)
        Adds the given items to the selection
        Parameters:
        items - the items to add to the selection
      • removeSelectedItem

        void removeSelectedItem​(R item)
        Remove the given item from the selection
        Parameters:
        item - the item to remove from the selection
      • removeSelectedItems

        void removeSelectedItems​(Collection<R> items)
        Remove the given items from the selection
        Parameters:
        items - the items to remove from the selection
      • clearSelection

        void clearSelection()
        Clears the selection
      • isSelectionEmpty

        boolean isSelectionEmpty()
        Returns:
        true if the selection is empty
      • isSelectionNotEmpty

        boolean isSelectionNotEmpty()
        Returns:
        true if the selection is not empty