ObservableListSize
An ObservableInt whose value is the size of an ObservableList.
As example of where this might be useful. Suppose we want to disable a button when a list is empty. Simply bind its disabledProperty
to :
ObservableListSize(list).equalTo(0)
Alternatively, we might want a label to contain a list's size, in which case, bind its textProperty
to :
ObservableListSize(list).toObservableString()
See also, the extension functions sizeProperty, isEmptyProperty, isNotEmptyProperty
Properties
Functions
Identical to addChangeListener, but these listeners are guaranteed to fire BEFORE other listeners. These should be used for the sole purpose of updating single ObservableValues which are dependent on this ObservableValue. This helps (but doesn't guarantee) that properties change atomically. i.e. when one property changes, a related property also changes before other (regular) listeners fire. Therefore, the (regular) listeners cannot read inconsistent values.
Identical to addListener, but these listeners are guaranteed to fire BEFORE regular listeners. These should be used for the sole purpose of updating other ObservableValues which are dependent on this Observable.
Converts an ObservableValue, with a non-nullable to value, to an ObservableValue whose value IS nullable.
Converts an ObservableValue, with a nullable to value, to an ObservableValue whose value is NOT nullable, by supplying a defaultValue.