T - The type of the elementspublic interface SelectionModel<T>
| Modifier and Type | Method and Description |
|---|---|
void |
addSelectionListener(SelectionListener<T> selectionListener)
Add the given
SelectionListener to be informed about changes
in this selection model |
void |
addToSelection(Collection<? extends T> elements)
Adds the given elements to this selection
|
void |
addToSelection(T element)
Adds the given element to this selection
|
void |
clear()
Removes all elements from this selection
|
Set<T> |
getSelection()
Returns an unmodifiable view on the set of currently selected
elements
|
boolean |
isSelected(T element)
Returns whether the given element is currently selected
|
void |
removeFromSelection(Collection<? extends T> elements)
Remove the given elements from this selection
|
void |
removeFromSelection(T element)
Removes the given element from this selection
|
void |
removeSelectionListener(SelectionListener<T> selectionListener)
Remove the given
SelectionListener |
void |
setSelection(Collection<? extends T> elements)
Sets the given elements to be the selection of this model.
|
void addToSelection(T element)
element - The element to addvoid removeFromSelection(T element)
element - The element to removevoid addToSelection(Collection<? extends T> elements)
elements - The elements to addvoid removeFromSelection(Collection<? extends T> elements)
elements - The elements to removevoid setSelection(Collection<? extends T> elements)
SelectionEvent to be fired. The
removed elements
and added elements
of this event will precisely describe the state change:
When the initial selection is {0,1,2,3}, and
this method is called with the set {2,3,4,5},
then the removed elements
of the resulting event will be {0,1}, and the
added elements will
be {4,5}.elements - The elements to selectvoid clear()
boolean isSelected(T element)
element - The elementSet<T> getSelection()
void addSelectionListener(SelectionListener<T> selectionListener)
SelectionListener to be informed about changes
in this selection modelselectionListener - The SelectionListener to addvoid removeSelectionListener(SelectionListener<T> selectionListener)
SelectionListenerselectionListener - The SelectionListener to removeCopyright © 2015. All rights reserved.