Interface MultiSelection.IndexStore
- Enclosing interface:
MultiSelection<T>
The selected indexes a MultiSelection is a view over, the one part of a selection that differs per toolkit.
A store notifies changing() before its indexes are changed by request, and changed() after
they change, whoever changed them, the selection deriving its index and item values from get() on each
changed().
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionObserver<?> Observer<?> changed()Observer<?> changing()booleancontains(int index) get()grouping()voidrestore(Collection<Integer> indexes) Replaces the selected indexes asset(Collection)does, without notifyingchanging().voidset(Collection<Integer> indexes) Replaces the selected indexes.intsize()
-
Method Details
-
get
- Returns:
- an unmodifiable snapshot of the selected indexes, iterated in ascending order
-
set
Replaces the selected indexes. A no-op if they are unchanged, otherwise
changing()is notified before andchanged()after, the latter at the end of the adjustment whilegrouping().Under
singleSelection()only the highest of the given indexes is selected.- Parameters:
indexes- the indexes to select
-
restore
Replaces the selected indexes as
set(Collection)does, without notifyingchanging().For a model restoring the selection after its items changed, which re-indexes the selection rather than changing it by request, see
MultiSelection.Items.restore(Collection).- Parameters:
indexes- the indexes to select
-
size
int size()- Returns:
- the number of stored indexes
-
contains
boolean contains(int index) - Parameters:
index- the index- Returns:
- true if the given index is selected
-
singleSelection
State singleSelection()- Returns:
- the
Statecontrolling single selection mode, the selection is cleared when it changes
-
grouping
MultiSelection.Grouping grouping()- Returns:
- the
MultiSelection.Groupinginstance
-
changing
Observer<?> changing()- Returns:
- an observer notified before the selected indexes are changed by request
- See Also:
-
changed
Observer<?> changed()- Returns:
- an observer notified after the selected indexes changed, by whoever changed them
-
adjusting
Observer<?> adjusting()- Returns:
- an observer notified on every change to the selected indexes, grouped or not, as the changes happen
- See Also:
-