public abstract class AbstractTreeAction
extends org.eclipse.jface.action.Action
implements org.eclipse.ui.ISelectionListener
Action
s done based on the current
selection in an Eclipse UI part that contains TreeComposite
s.
By default, this class listens for the selection in the
TreeCompositeViewer
. The source of the selections can be changed via
setPartId(String)
, but the source is expected to provide an
IStructuredSelection
containing at least one
TreeComposite
.
Constructor and Description |
---|
AbstractTreeAction()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
run()
Overrides the default behavior and forces sub-classes to implement the
run action.
|
void |
selectionChanged(org.eclipse.ui.IWorkbenchPart part,
org.eclipse.jface.viewers.ISelection selection)
Updates the
selectedNode based on the selection in the current
Eclipse view corresponding to the partId . |
void |
setPartId(java.lang.String partId)
Changes the workbench part this
Action listens to for
selection changes. |
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
addPropertyChangeListener, removePropertyChangeListener
public void setPartId(java.lang.String partId)
Action
listens to for
selection changes.partId
- The ID of the part whose selections will be used by this
Action
.public abstract void run()
run
in interface org.eclipse.jface.action.IAction
run
in class org.eclipse.jface.action.Action
public void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection)
selectedNode
based on the selection in the current
Eclipse view corresponding to the partId
. If the selection is
empty, this value is null. The action is also enabled or disabled
depending on whether the selection is valid.selectionChanged
in interface org.eclipse.ui.ISelectionListener