Class SingleSelectionProperty<T>
java.lang.Object
dev.prozilla.pine.common.property.VariableProperty<T>
dev.prozilla.pine.common.property.MutableProperty<T>
dev.prozilla.pine.common.property.observable.ObservableProperty<T>
dev.prozilla.pine.common.property.selection.SelectionProperty<T,T>
dev.prozilla.pine.common.property.selection.SingleSelectionProperty<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
items, wrapMode
Fields inherited from class dev.prozilla.pine.common.property.observable.ObservableProperty
logger
Fields inherited from class dev.prozilla.pine.common.property.VariableProperty
random
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
boolean
boolean
isItemSelected
(T item) boolean
removeItem
(T item) boolean
selectIndex
(int index) Selects an item from the list of items at a given index.boolean
selectItem
(T item) Selects an item from the list of items.void
Selects the next item.void
Selects the previous item.boolean
Sets the value of this property.Methods inherited from class dev.prozilla.pine.common.property.selection.SelectionProperty
addItem, getItem, getItemCount, getItems, selectFirst, selectLast, setWrapMode, transformIndex
Methods inherited from class dev.prozilla.pine.common.property.observable.ObservableProperty
addObserver, onValueChange, read, removeObserver, setLogger
Methods inherited from class dev.prozilla.pine.common.property.MutableProperty
exists, getValue
-
Constructor Details
-
SingleSelectionProperty
public SingleSelectionProperty() -
SingleSelectionProperty
-
SingleSelectionProperty
-
-
Method Details
-
removeItem
- Overrides:
removeItem
in classSelectionProperty<T,
T>
-
setValue
Description copied from class:MutableProperty
Sets the value of this property.- Overrides:
setValue
in classMutableProperty<T>
- Parameters:
value
- The new value- Returns:
true
if the value was changed.
-
selectItem
Description copied from class:SelectionProperty
Selects an item from the list of items.- Overrides:
selectItem
in classSelectionProperty<T,
T> - Parameters:
item
- The item to select- Returns:
false
if 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:SelectionProperty
Selects the previous item.- Specified by:
selectPrevious
in classSelectionProperty<T,
T>
-
selectNext
public void selectNext()Description copied from class:SelectionProperty
Selects the next item.- Specified by:
selectNext
in classSelectionProperty<T,
T>
-
selectIndex
public boolean selectIndex(int index) Description copied from class:SelectionProperty
Selects an item from the list of items at a given index.- Specified by:
selectIndex
in classSelectionProperty<T,
T> - Parameters:
index
- The index of the item to select- Returns:
false
if the item was already selected.
-
clearSelection
public boolean clearSelection() -
getSelectedItem
-
getSelectedIndex
public int getSelectedIndex() -
isItemSelected
-
isAnyItemSelected
public boolean isAnyItemSelected()
-