Package org.eclipse.gef
Class SelectionManager
java.lang.Object
org.eclipse.gef.SelectionManager
Manages a viewer's selection model. Selection management includes
representing a form of selection which is available to clients of a viewer as
an ISelection. It also includes managing the notion of focus, which is
closely tied to the current selection. The selection manager provides the
mechanism for modifying the selection and any validation.
WARNING: Subclassing this class is considered experimental at this point.
- Since:
- 3.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendSelection
(EditPart editpart) Appends theEditPart
to the current selection.static SelectionManager
Creates the default implementation for a selection manager.void
Removes theEditPart
from the current selection.void
Deselects everything.protected final void
Causes the viewer to fire selection changed notification to all listeners.protected EditPart
getFocus()
Returns the focus editpart.Returns the current selection.protected EditPartViewer
Returnsnull
or the viewer whose selection is managed.protected void
hookViewer
(EditPartViewer viewer) Provides a hook for when the viewer has been set.void
internalHookControl
(Control control) For internal use only.void
internalInitialize
(EditPartViewer viewer, List<EditPart> selection, Runnable notifier) For internal use only.void
For internal use only.void
Sets the focus part.void
setSelection
(ISelection newSelection) Sets the selection.
-
Constructor Details
-
SelectionManager
protected SelectionManager()Default Constructor- Since:
- 3.2
-
-
Method Details
-
createDefault
Creates the default implementation for a selection manager.- Returns:
- the default selection manager
- Since:
- 3.2
-
appendSelection
Appends theEditPart
to the current selection. The EditPart becomes the new primary selection. Fires selection changed to allISelectionChangedListener
s.- Parameters:
editpart
- the EditPart to append- Since:
- 3.2
-
deselect
Removes theEditPart
from the current selection.- Parameters:
editpart
- the editpart- Since:
- 3.2
-
deselectAll
public void deselectAll()Deselects everything.- Since:
- 3.2
-
fireSelectionChanged
protected final void fireSelectionChanged()Causes the viewer to fire selection changed notification to all listeners.- Since:
- 3.2
-
getFocus
Returns the focus editpart.- Returns:
- the focus editpart
- Since:
- 3.2
-
getSelection
Returns the current selection.- Returns:
- the selection
- Since:
- 3.2
-
getViewer
Returnsnull
or the viewer whose selection is managed.- Returns:
null
or the viewer- Since:
- 3.2
-
internalHookControl
For internal use only. This API is subject to change.- Parameters:
control
- the control- Since:
- 3.2
-
internalUninstall
public void internalUninstall()For internal use only. This API is subject to change.- Since:
- 3.2
-
hookViewer
Provides a hook for when the viewer has been set.- Parameters:
viewer
- the viewer.- Since:
- 3.2
-
internalInitialize
For internal use only.- Parameters:
viewer
- viewerselection
- selectionnotifier
- notifier- Since:
- 3.2
-
setFocus
Sets the focus part.- Parameters:
part
- the focus part- Since:
- 3.2
-
setSelection
Sets the selection.- Parameters:
newSelection
- the new selection- Since:
- 3.2
-