Module MaterialFX

Interface IMultipleSelectionModel<T>

All Known Implementing Classes:
AbstractMultipleSelectionModel, MultipleSelectionModel

public interface IMultipleSelectionModel<T>
Public API that every MultipleSelectionModel must implement.
  • Property Details

  • Method Details

    • clearSelection

      void clearSelection()
      Clears the selection.
    • deselectIndex

      void deselectIndex(int index)
      Deselects the given index.
    • deselectItem

      void deselectItem(T item)
      Deselects the given item.
    • deselectIndexes

      void deselectIndexes(int... indexes)
      Deselects the given indexes.
    • deselectItems

      void deselectItems(T... items)
      Deselects the given items.
    • selectIndex

      void selectIndex(int index)
      Selects the given index.
    • selectItem

      void selectItem(T item)
      Selects the given item.
    • selectIndexes

      void selectIndexes(List<Integer> indexes)
      Selects the given indexes list.
    • selectItems

      void selectItems(List<T> items)
      Selects the given items list.
    • expandSelection

      void expandSelection(int index)
      Expands the selection in the given index direction.
    • replaceSelection

      void replaceSelection(Integer... indexes)
      Clears the selection and replaces it with the given indexes.
    • replaceSelection

      void replaceSelection(T... items)
      Clears the selection and replaces it with the given items.
    • getSelection

      ObservableMap<Integer,T> getSelection()
      Returns:
      the selection ObservableMap
    • selectionProperty

      MapProperty<Integer,T> selectionProperty()
      The MapProperty used to keep track of multiple selection.

      We use a MapProperty to represent multiple selection because this way we can always update it "atomically", meaning that when the selected indexes changes the selected items are updated as well (also true viceversa).
      See Also:
    • setSelection

      void setSelection(ObservableMap<Integer,T> newSelection)
      Replaces the selection with the given ObservableMap.
    • getSelectedValues

      List<T> getSelectedValues()
      Returns an unmodifiable List containing all the selected values extracted from Map.values(). The values order is kept since the selection is backed by a LinkedHashMap.
    • allowsMultipleSelection

      boolean allowsMultipleSelection()
      Specifies if this model allows multiple selection or should act like a SingleSelectionModel.
    • setAllowsMultipleSelection

      void setAllowsMultipleSelection(boolean allowsMultipleSelection)
      Sets the selection behavior of this model to be multiple (true) or single (false).