public abstract class SelectionAction extends WorkbenchPartAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT| Constructor and Description |
|---|
SelectionAction(IWorkbenchPart part)
Creates a
SelectionAction and associates it with the given
workbench part. |
SelectionAction(IWorkbenchPart part,
int style)
Creates a
SelectionAction and associates it with the given
editor. |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Disposes the action when it is no longer needed.
|
protected java.util.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.
|
calculateEnabled, execute, getCommandStack, getWorkbenchPart, init, isEnabled, refresh, setLazyEnablementCalculation, setWorkbenchPartconvertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, run, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipTextaddPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListeneraddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectpublic SelectionAction(IWorkbenchPart part, int style)
SelectionAction and associates it with the given
editor.part - The workbench part associated with this actionstyle - the style for this actionpublic SelectionAction(IWorkbenchPart part)
SelectionAction and associates it with the given
workbench part.part - the workbench partpublic void dispose()
WorkbenchPartActiondispose in interface Disposabledispose in class WorkbenchPartActionDisposable.dispose()protected java.util.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()
UpdateActionupdate in interface UpdateActionupdate in class WorkbenchPartActionWorkbenchPartAction.update()Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.