Change
scalafx.collections.ObservableBuffer.Change
Trait that indicates a Change in an ObservableBuffer. It is a simpler version of JavaFX's `ListChangeListener.Change`, where each subclass indicates a specific change operation. Unlike JavaFX, all subclasses are exclusive to each other. This enables using pattern matching:
items.onChange((_, changes) => {
for (change <- changes)
change match {
case Add(pos, added) => ...
case Remove(pos, removed) => ...
case Reorder(from, to, permutation) => ...
case Update(pos, updated) => ...
}
})
"replace" is represented as two changes Remove and Add.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
In this article