|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jface.action.Action | +--org.eclipse.gef.ui.actions.WorkbenchPartAction | +--org.eclipse.gef.ui.actions.EditorPartAction | +--org.eclipse.gef.ui.actions.SelectionAction
Superclass for an action needing the current selection.
Field Summary |
Fields inherited from interface org.eclipse.jface.action.IAction |
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, IMAGE, TEXT, TOOL_TIP_TEXT |
Constructor Summary | |
SelectionAction(IEditorPart editor)
Deprecated. use IWorkbenchPart constructor, SelectionAction will be changed to inherit from WorkbenchPartAction in next release |
|
SelectionAction(IWorkbenchPart part)
Creates a SelectionAction and associates it with the given workbench part. |
Method Summary | |
void |
dispose()
Performs and necessary cleanup. |
protected List |
getSelectedObjects()
Returns a List containing the currently
selected objects. |
protected ISelection |
getSelection()
Gets the current selection. |
protected void |
handleSelectionChanged()
Called when the selection is changed. |
protected void |
setSelection(ISelection selection)
Sets the current selection and calls on subclasses to handle the selectionChanged event. |
void |
setSelectionProvider(ISelectionProvider provider)
May be used to provide an alternative selection source other than the workbench's selection service. |
void |
update()
Called to update the receiver. |
Methods inherited from class org.eclipse.gef.ui.actions.EditorPartAction |
getEditorPart, setEditorPart |
Methods inherited from class org.eclipse.gef.ui.actions.WorkbenchPartAction |
calculateEnabled, execute, getCommandStack, getWorkbenchPart, init, isEnabled, refresh, setLazyEnablementCalculation, setWorkbenchPart |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SelectionAction(IEditorPart editor)
SelectionAction
and associates it with the given editor.
editor
- The editor that this action is associated with.public SelectionAction(IWorkbenchPart part)
SelectionAction
and associates it with the given workbench part.
part
- the workbench partMethod Detail |
public void dispose()
Disposable
dispose
in interface Disposable
dispose
in class WorkbenchPartAction
Disposable.dispose()
protected List getSelectedObjects()
List
containing the currently
selected objects.
protected ISelection getSelection()
protected void handleSelectionChanged()
protected void setSelection(ISelection selection)
selection
- The new selection.public void setSelectionProvider(ISelectionProvider provider)
null
, in which case the selection is obtained using the partsite's
selection service.
provider
- null
or a selection providerpublic void update()
UpdateAction
update
in interface UpdateAction
update
in class WorkbenchPartAction
WorkbenchPartAction.update()
|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |