Selection exposing public support for mutating the underlying
selection data. This is useful for clients of
SelectionTracker that wish to
manipulate a copy of selection data obtained via
Selection class is not intrinsically immutable, it is not mutable
by non-library code. Furthermore the value returned from
is a live view of the underlying selection, mutable by the library itself.
MutableSelection allows clients to obtain a mutable copy of the Selection
state held by the selection library. This is useful in situations where a stable
snapshot of the selection is required.
MutableSelection snapshot = new MutableSelection(); selectionTracker.copySelection(snapshot); // Clear the user visible selection. selectionTracker.clearSelection(); // tracker.getSelection().isEmpty() will be true. // shapshot has a copy of the previous selection.
Adds a new item to the primary selection.
Clears the primary selection.
Clones primary and provisional selection from supplied
Removes an item from the primary selection.