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
PropertyChangeEvent s. |
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
IContentPart s to the current selection, i.e. |
void |
deselect(java.util.Collection<? extends IContentPart<VR,? extends VR>> contentParts)
Removes the given
IContentPart s 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
IContentPart s. |
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
IContentPart s, 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
PropertyChangeEvent
s.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface IPropertyChangeNotifier
public void appendSelection(java.util.List<? extends IContentPart<VR,? extends VR>> contentParts)
IContentPart
s to the current selection, i.e.
inserts them at the end of the selection.contentParts
- The IContentPart
s which are appended to the selection.public void deselect(java.util.Collection<? extends IContentPart<VR,? extends VR>> contentParts)
IContentPart
s from the current selection.contentParts
- The IContentPart
s which are removed from the
selection.public void deselectAll()
public java.util.List<IContentPart<VR,? extends VR>> getSelected()
IContentPart
s.IContentPart
s.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 IPropertyChangeNotifier
public void select(java.util.List<? extends IContentPart<VR,? extends VR>> additionalSelected)
IContentPart
s, 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 IContentPart
s 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 IContentPart
s constituting the new
selection.Copyright (c) 2014 itemis AG and others. All rights reserved.