Class SingleSelectionProperty<T>
java.lang.Object
dev.prozilla.pine.common.property.mutable.SimpleMutableObjectProperty<T>
dev.prozilla.pine.common.property.observable.SimpleObservableObjectProperty<T>
dev.prozilla.pine.common.property.selection.SelectionProperty<T,T>
dev.prozilla.pine.common.property.selection.SingleSelectionProperty<T>
- All Implemented Interfaces:
Destructible,MutableObjectProperty<T>,MutableProperty<T>,ObservableObjectProperty<T>,ObservableProperty<T>,SimpleObservableProperty<T>,Property<T>,Functor<T>
Represents a selection of zero or one item(s) from a list.
-
Field Summary
Fields inherited from class dev.prozilla.pine.common.property.selection.SelectionProperty
DEFAULT_WRAP_MODE, items, wrapModeFields inherited from class dev.prozilla.pine.common.property.observable.SimpleObservableObjectProperty
loggerFields inherited from interface dev.prozilla.pine.common.property.observable.ObservableProperty
OBSERVER_ERROR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintbooleanbooleanisItemSelected(T item) booleanremoveItem(T item) booleanselectIndex(int index) Selects an item from the list of items at a given index.booleanselectItem(T item) Selects an item from the list of items.voidSelects the next item.voidSelects the previous item.booleanSets the value of this property.Methods inherited from class dev.prozilla.pine.common.property.selection.SelectionProperty
addItem, getItem, getItemCount, getItems, selectFirst, selectLast, setWrapMode, transformIndexMethods inherited from class dev.prozilla.pine.common.property.observable.SimpleObservableObjectProperty
addObserver, destroy, getLogger, onValueChange, removeObserver, setLoggerMethods inherited from class dev.prozilla.pine.common.property.mutable.SimpleMutableObjectProperty
getValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableObjectProperty
setNull, stealMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableProperty
modifyValue, swapValue, viewPropertyMethods inherited from interface dev.prozilla.pine.common.property.observable.ObservableProperty
readMethods inherited from interface dev.prozilla.pine.common.property.Property
getValue, getValueOr, hasValue, hasValueProperty, isNotNull, isNotNullProperty, isNull, map, replaceNull, requireValue, snapshot, toStringProperty
-
Constructor Details
-
SingleSelectionProperty
public SingleSelectionProperty() -
SingleSelectionProperty
-
SingleSelectionProperty
-
-
Method Details
-
removeItem
- Overrides:
removeItemin classSelectionProperty<T,T>
-
setValue
Description copied from interface:MutablePropertySets the value of this property.- Specified by:
setValuein interfaceMutableProperty<T>- Overrides:
setValuein classSimpleMutableObjectProperty<T>- Parameters:
value- The new value- Returns:
trueif the value was changed.
-
selectItem
Description copied from class:SelectionPropertySelects an item from the list of items.- Overrides:
selectItemin classSelectionProperty<T,T> - Parameters:
item- The item to select- Returns:
falseif the item was already selected.- Throws:
IllegalArgumentException- If the item is not in the list of items.
-
selectPrevious
public void selectPrevious()Description copied from class:SelectionPropertySelects the previous item.- Specified by:
selectPreviousin classSelectionProperty<T,T>
-
selectNext
public void selectNext()Description copied from class:SelectionPropertySelects the next item.- Specified by:
selectNextin classSelectionProperty<T,T>
-
selectIndex
public boolean selectIndex(int index) Description copied from class:SelectionPropertySelects an item from the list of items at a given index.- Specified by:
selectIndexin classSelectionProperty<T,T> - Parameters:
index- The index of the item to select- Returns:
falseif the item was already selected.
-
clearSelection
public boolean clearSelection() -
getSelectedItem
-
getSelectedIndex
public int getSelectedIndex() -
isItemSelected
-
isAnyItemSelected
public boolean isAnyItemSelected()
-