BindableValue
BindableValue<T> is a lightweight, invisible element that holds a single value of any type and notifies registered listeners whenever the value changes. It is useful as a non-visual reactive binding point inside a UI tree.
BindableValue extends BindableUIElement<T> and inherits the full data-binding and event system.
Everything documented on UIElement (layout, styles, events, data bindings, etc.) applies here too.
Usage
Value Binding
BindableValue extends BindableUIElement<T> and participates fully in the data-binding system:
See Data Bindings for full details.
Fields
| Name | Type | Access | Description |
|---|---|---|---|
value |
T (nullable) |
private (getter) |
The currently held value. |
Methods
| Method | Returns | Description |
|---|---|---|
setValue(T, boolean) |
BindableUIElement<T> |
Sets the value. Second param controls notification. No-op if the value is equal to the current. |
getValue() |
T |
Returns the current value. |
registerValueListener(Consumer<T>) |
void |
Registers a listener called when the value changes. |