VR - The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public class SelectionModel<VR> extends java.lang.Object implements IPropertyChangeNotifier
SelectionModel is used to store the current viewer's
IContentPart selection. A selection tool is used to update the
SelectionModel as the result of input events.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SELECTION_PROPERTY
"selection"
The property name which is used for
PropertyChangeEvents. |
| Constructor and Description |
|---|
SelectionModel() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
appendSelection(java.util.List<? extends IContentPart<VR,? extends VR>> contentParts)
Appends the given
IContentParts to the current selection, i.e. |
void |
deselect(java.util.Collection<? extends IContentPart<VR,? extends VR>> contentParts)
Removes the given
IContentParts from the current selection. |
void |
deselectAll()
Clears the current selection.
|
java.util.List<IContentPart<VR,? extends VR>> |
getSelected()
Returns an unmodifiable list of the currently selected
IContentParts. |
boolean |
isSelected(IContentPart<VR,? extends VR> contentPart)
Returns
true if the given IContentPart is part of
the current selection. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
select(java.util.List<? extends IContentPart<VR,? extends VR>> additionalSelected)
Updates the current selection by adding the given list of
IContentParts, preserving already selected elements. |
void |
updateSelection(java.util.List<? extends IContentPart<VR,? extends VR>> newSelection)
Replaces the whole selection with the given list of
IContentPart
s. |
public static final java.lang.String SELECTION_PROPERTY
"selection"The property name which is used for
PropertyChangeEvents.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface IPropertyChangeNotifierpublic void appendSelection(java.util.List<? extends IContentPart<VR,? extends VR>> contentParts)
IContentParts to the current selection, i.e.
inserts them at the end of the selection.contentParts - The IContentParts which are appended to the selection.public void deselect(java.util.Collection<? extends IContentPart<VR,? extends VR>> contentParts)
IContentParts from the current selection.contentParts - The IContentParts which are removed from the
selection.public void deselectAll()
public java.util.List<IContentPart<VR,? extends VR>> getSelected()
IContentParts.IContentParts.public boolean isSelected(IContentPart<VR,? extends VR> contentPart)
true if the given IContentPart is part of
the current selection.contentPart - The IContentPart which is checked for containment.true if the IContentPart is contained by the
current selection.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface IPropertyChangeNotifierpublic void select(java.util.List<? extends IContentPart<VR,? extends VR>> additionalSelected)
IContentParts, preserving already selected elements. That is, if
a member of the given list is not contained in the current selection, it
will be added to it. If a member of the current selection is not
contained in the given list, it will remain selected. The selection order
will be adjusted, so that the given elements are in front.additionalSelected - The IContentParts to add to/move within the current
selection.public void updateSelection(java.util.List<? extends IContentPart<VR,? extends VR>> newSelection)
IContentPart
s.newSelection - The list of IContentParts constituting the new
selection.Copyright (c) 2014 itemis AG and others. All rights reserved.