Module MaterialFX
Interface IMultipleSelectionModel<T>
- All Known Implementing Classes:
AbstractMultipleSelectionModel,MultipleSelectionModel
public interface IMultipleSelectionModel<T>
Public API that every MultipleSelectionModel must implement.
-
Property Summary
Properties -
Method Summary
Modifier and TypeMethodDescriptionbooleanSpecifies if this model allows multiple selection or should act like a SingleSelectionModel.voidClears the selection.voiddeselectIndex(int index) Deselects the given index.voiddeselectIndexes(int... indexes) Deselects the given indexes.voiddeselectItem(T item) Deselects the given item.voiddeselectItems(T... items) Deselects the given items.voidexpandSelection(int index) Expands the selection in the given index direction.Returns an unmodifiableListcontaining all the selected values extracted fromMap.values().voidreplaceSelection(Integer... indexes) Clears the selection and replaces it with the given indexes.voidreplaceSelection(T... items) Clears the selection and replaces it with the given items.voidselectIndex(int index) Selects the given index.voidselectIndexes(List<Integer> indexes) Selects the given indexes list.TheMapPropertyused to keep track of multiple selection.voidselectItem(T item) Selects the given item.voidselectItems(List<T> items) Selects the given items list.voidsetAllowsMultipleSelection(boolean allowsMultipleSelection) Sets the selection behavior of this model to be multiple (true) or single (false).voidsetSelection(ObservableMap<Integer, T> newSelection) Replaces the selection with the givenObservableMap.
-
Property Details
-
selection
MapProperty<Integer,T> selectionPropertyTheMapPropertyused to keep track of multiple selection. We use aMapPropertyto 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:
-
-
Method Details
-
clearSelection
void clearSelection()Clears the selection. -
deselectIndex
void deselectIndex(int index) Deselects the given index. -
deselectItem
Deselects the given item. -
deselectIndexes
void deselectIndexes(int... indexes) Deselects the given indexes. -
deselectItems
Deselects the given items. -
selectIndex
void selectIndex(int index) Selects the given index. -
selectItem
Selects the given item. -
selectIndexes
Selects the given indexes list. -
selectItems
Selects the given items list. -
expandSelection
void expandSelection(int index) Expands the selection in the given index direction. -
replaceSelection
Clears the selection and replaces it with the given indexes. -
replaceSelection
Clears the selection and replaces it with the given items. -
getSelection
ObservableMap<Integer,T> getSelection()- Returns:
- the selection
ObservableMap
-
selectionProperty
MapProperty<Integer,T> selectionProperty()TheMapPropertyused to keep track of multiple selection. We use aMapPropertyto 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
Replaces the selection with the givenObservableMap. -
getSelectedValues
Returns an unmodifiableListcontaining all the selected values extracted fromMap.values(). The values order is kept since the selection is backed by aLinkedHashMap. -
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).
-