public static class Tree.SelectionEvent<E extends Entity> extends java.util.EventObject implements HasUserOriginated
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<E> |
oldSelection |
protected java.util.Set<E> |
selected |
protected boolean |
userOriginated |
Constructor and Description |
---|
SelectionEvent(Tree<E> component,
java.util.Set<E> oldSelection,
boolean userOriginated)
Constructor for a selection event.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<E> |
getAdded()
A
Set of all the items that became selected. |
java.util.Set<E> |
getOldSelection()
A
Set of all the items that were selected before the selection was changed. |
java.util.Set<E> |
getRemoved()
A
Set of all the items that became deselected. |
java.util.Set<E> |
getSelected()
A
Set of all the items that are currently selected. |
Tree<E> |
getSource() |
boolean |
isUserOriginated()
Returns whether this event was triggered by user interaction or programmatically.
|
public SelectionEvent(Tree<E> component, java.util.Set<E> oldSelection, boolean userOriginated)
component
- the DataGrid from which this event originatesoldSelection
- the old set of selected itemsuserOriginated
- true
if an event is a result of user interaction,
false
if from the API callpublic java.util.Set<E> getAdded()
Set
of all the items that became selected.
Note: this excludes all items that might have been previously
selected.public java.util.Set<E> getRemoved()
Set
of all the items that became deselected.
Note: this excludes all items that might have been previously
deselected.public java.util.Set<E> getSelected()
Set
of all the items that are currently selected.public java.util.Set<E> getOldSelection()
Set
of all the items that were selected before the selection was changed.public boolean isUserOriginated()
HasUserOriginated
isUserOriginated
in interface HasUserOriginated
true
if this event originates by user interaction, false
otherwise.