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.
Trait that indicates a Change in an
ObservableBuffer
. It is a simpler version of JavaFX'sListChangeListener.Change
, where each subclass indicates a specific change operation. Unlike JavaFX, all subclasses are exclusive to each other. This enables using pattern matching:"replace" is represented as two changes
Remove
andAdd
.