public interface ObservableList<T>
extends java.util.List<T>
List
that notifies when changes are made. An ObservableList bound to the UI
will keep the it up-to-date when changes occur.
The ObservableList must notify its callbacks whenever a change to the list occurs, using
ObservableList.OnListChangedCallback
.
ObservableArrayList implements ObservableList with an underlying ArrayList. ListChangeRegistry can help in maintaining the callbacks of other implementations.
Observable
,
ObservableMap
Modifier and Type | Interface and Description |
---|---|
static class |
ObservableList.OnListChangedCallback<T extends ObservableList>
The callback that is called by ObservableList when the list has changed.
|
Modifier and Type | Method and Description |
---|---|
void |
addOnListChangedCallback(ObservableList.OnListChangedCallback<? extends ObservableList<T>> callback)
Adds a callback to be notified when changes to the list occur.
|
void |
removeOnListChangedCallback(ObservableList.OnListChangedCallback<? extends ObservableList<T>> callback)
Removes a callback previously added.
|
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
void addOnListChangedCallback(ObservableList.OnListChangedCallback<? extends ObservableList<T>> callback)
callback
- The callback to be notified on list changesvoid removeOnListChangedCallback(ObservableList.OnListChangedCallback<? extends ObservableList<T>> callback)
callback
- The callback to remove.