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 TypeMethodDescriptionvoid
bindIndex
(SingleSelectionModel<T> selectionModel) Binds this selection model's index to the given selection model's index, callsSingleSelectionManager.bindIndex(ObservableValue, Function)
.void
Delegate method forSingleSelectionManager.bindIndex(ObservableValue, Function)
.void
bindIndexBidirectional
(SingleSelectionModel<T> selectionModel) Binds this selection model's index bidirectionally to the given selection model's index, callsSingleSelectionManager.bindIndexBidirectional(Property, Function, TriConsumer)
.void
bindIndexBidirectional
(Property<Number> other, Function<Integer, T> indexConverter, TriConsumer<Boolean, Integer, Property<Number>> updateOther) Delegate method forSingleSelectionManager.bindIndexBidirectional(Property, Function, TriConsumer)
.void
bindItem
(SingleSelectionModel<T> selectionModel) Binds this selection model's item to the given selection model's item, callsSingleSelectionManager.bindItem(ObservableValue, Function)
.void
Delegate method forSingleSelectionManager.bindItem(ObservableValue, Function)
.void
bindItemBidirectional
(SingleSelectionModel<T> selectionModel) Binds this selection model's item bidirectionally to the given selection model's item, callsSingleSelectionManager.bindItemBidirectional(Property, Function, TriConsumer)
.void
bindItemBidirectional
(Property<T> other, Function<T, Integer> itemConverter, TriConsumer<Boolean, T, Property<T>> updateOther) Delegate method forSingleSelectionManager.bindItemBidirectional(Property, Function, TriConsumer)
.void
Delegate method forSingleSelectionManager.clearSelection()
.int
Delegate method forSingleSelectionManager.getSelectedIndex()
}.Delegate method forSingleSelectionManager.getSelectedItem()
.boolean
isBound()
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.void
selectIndex
(int index) Delegate method forSingleSelectionManager.updateSelection(int)
.void
selectItem
(T item) Delegate method forSingleSelectionManager.updateSelection(Object)
.void
unbind()
Delegate method forSingleSelectionManager.unbind()
.void
Delegate method forSingleSelectionManager.unbindBidirectional()
.void
unbindIndexBidirectional
(Property<Number> other) Delegate method forSingleSelectionManager.unbindIndexBidirectional(Property)
.void
unbindItemBidirectional
(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()
.
-