java.lang.Object
io.github.palexdev.materialfx.selection.base.AbstractSingleSelectionModel<T>
io.github.palexdev.materialfx.selection.SingleSelectionModel<T>
- All Implemented Interfaces:
ISingleSelectionModel<T>
- Direct Known Subclasses:
ComboBoxSelectionModel
Implementation of
AbstractSingleSelectionModel to implement the API
specified by ISingleSelectionModel.
The logic is handled by SingleSelectionManager, in fact all methods are just delegates.-
Property Summary
PropertiesTypePropertyDescriptionDelegate method forSingleSelectionManager.selectedIndexProperty(), but a read-only property is returned.Delegate method forSingleSelectionManager.selectedItemProperty(), but a read-only property is returned. -
Field Summary
Fields inherited from class io.github.palexdev.materialfx.selection.base.AbstractSingleSelectionModel
items, selectionManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbindIndex(SingleSelectionModel<T> selectionModel) Binds this selection model's index to the given selection model's index, callsSingleSelectionManager.bindIndex(ObservableValue, Function).voidDelegate method forSingleSelectionManager.bindIndex(ObservableValue, Function).voidbindIndexBidirectional(SingleSelectionModel<T> selectionModel) Binds this selection model's index bidirectionally to the given selection model's index, callsSingleSelectionManager.bindIndexBidirectional(Property, Function, TriConsumer).voidbindIndexBidirectional(Property<Number> other, Function<Integer, T> indexConverter, TriConsumer<Boolean, Integer, Property<Number>> updateOther) Delegate method forSingleSelectionManager.bindIndexBidirectional(Property, Function, TriConsumer).voidbindItem(SingleSelectionModel<T> selectionModel) Binds this selection model's item to the given selection model's item, callsSingleSelectionManager.bindItem(ObservableValue, Function).voidDelegate method forSingleSelectionManager.bindItem(ObservableValue, Function).voidbindItemBidirectional(SingleSelectionModel<T> selectionModel) Binds this selection model's item bidirectionally to the given selection model's item, callsSingleSelectionManager.bindItemBidirectional(Property, Function, TriConsumer).voidbindItemBidirectional(Property<T> other, Function<T, Integer> itemConverter, TriConsumer<Boolean, T, Property<T>> updateOther) Delegate method forSingleSelectionManager.bindItemBidirectional(Property, Function, TriConsumer).voidDelegate method forSingleSelectionManager.clearSelection().intDelegate method forSingleSelectionManager.getSelectedIndex()}.Delegate method forSingleSelectionManager.getSelectedItem().booleanisBound()Delegate method forSingleSelectionManager.isBound().Delegate method forSingleSelectionManager.selectedIndexProperty(), but a read-only property is returned.Delegate method forSingleSelectionManager.selectedItemProperty(), but a read-only property is returned.voidselectIndex(int index) Delegate method forSingleSelectionManager.updateSelection(int).voidselectItem(T item) Delegate method forSingleSelectionManager.updateSelection(Object).voidunbind()Delegate method forSingleSelectionManager.unbind().voidDelegate method forSingleSelectionManager.unbindBidirectional().voidunbindIndexBidirectional(Property<Number> other) Delegate method forSingleSelectionManager.unbindIndexBidirectional(Property).voidunbindItemBidirectional(Property<T> other) Delegate method forSingleSelectionManager.unbindItemBidirectional(Property).Methods inherited from class io.github.palexdev.materialfx.selection.base.AbstractSingleSelectionModel
getItems, getUnmodifiableItems
-
Property Details
-
selectedIndex
Delegate method forSingleSelectionManager.selectedIndexProperty(), but a read-only property is returned.- See Also:
-
selectedItem
Delegate method forSingleSelectionManager.selectedItemProperty(), but a read-only property is returned.- See Also:
-
-
Constructor Details
-
SingleSelectionModel
-
SingleSelectionModel
-
-
Method Details
-
clearSelection
public void clearSelection()Delegate method forSingleSelectionManager.clearSelection(). -
selectIndex
public void selectIndex(int index) Delegate method forSingleSelectionManager.updateSelection(int). -
selectItem
Delegate method forSingleSelectionManager.updateSelection(Object). -
getSelectedIndex
public int getSelectedIndex()Delegate method forSingleSelectionManager.getSelectedIndex()}.- Returns:
- the current selected index
-
selectedIndexProperty
Delegate method forSingleSelectionManager.selectedIndexProperty(), but a read-only property is returned.- See Also:
-
getSelectedItem
Delegate method forSingleSelectionManager.getSelectedItem().- Returns:
- the current selected item
-
selectedItemProperty
Delegate method forSingleSelectionManager.selectedItemProperty(), but a read-only property is returned.- See Also:
-
bindIndex
Binds this selection model's index to the given selection model's index, callsSingleSelectionManager.bindIndex(ObservableValue, Function). Default implementation:selectionManager.bindIndex(selectionModel.selectionManager.selectedIndexProperty(), getItems()::get); -
bindIndexBidirectional
Binds this selection model's index bidirectionally to the given selection model's index, callsSingleSelectionManager.bindIndexBidirectional(Property, Function, TriConsumer). Default implementation:selectionManager.bindIndexBidirectional( selectionModel.selectionManager.selectedIndexProperty(), getItems()::get, (clearing, i, other) -> { selectionModel.selectionManager.setClearing(clearing); selectionModel.selectionManager.updateSelection(i); } ); -
bindItem
Binds this selection model's item to the given selection model's item, callsSingleSelectionManager.bindItem(ObservableValue, Function). Default implementation:selectionManager.bindItem(selectionModel.selectionManager.selectedItemProperty(), getItems()::indexOf); -
bindItemBidirectional
Binds this selection model's item bidirectionally to the given selection model's item, callsSingleSelectionManager.bindItemBidirectional(Property, Function, TriConsumer). Default implementation:selectionManager.bindItemBidirectional( selectionModel.selectionManager.selectedItemProperty(), getItems()::indexOf, (clearing, item, other) -> { selectionModel.selectionManager.setClearing(clearing); selectionModel.selectionManager.updateSelection(item); } ); -
bindIndex
Delegate method forSingleSelectionManager.bindIndex(ObservableValue, Function). -
bindIndexBidirectional
public void bindIndexBidirectional(Property<Number> other, Function<Integer, T> indexConverter, TriConsumer<Boolean, Integer, Property<Number>> updateOther) Delegate method forSingleSelectionManager.bindIndexBidirectional(Property, Function, TriConsumer). -
bindItem
Delegate method forSingleSelectionManager.bindItem(ObservableValue, Function). -
bindItemBidirectional
public void bindItemBidirectional(Property<T> other, Function<T, Integer> itemConverter, TriConsumer<Boolean, T, Property<T>> updateOther) Delegate method forSingleSelectionManager.bindItemBidirectional(Property, Function, TriConsumer). -
unbind
public void unbind()Delegate method forSingleSelectionManager.unbind(). -
unbindIndexBidirectional
Delegate method forSingleSelectionManager.unbindIndexBidirectional(Property). -
unbindItemBidirectional
Delegate method forSingleSelectionManager.unbindItemBidirectional(Property). -
unbindBidirectional
public void unbindBidirectional()Delegate method forSingleSelectionManager.unbindBidirectional(). -
isBound
public boolean isBound()Delegate method forSingleSelectionManager.isBound().
-