Class ObjectPluginAction
- All Implemented Interfaces:
EventListener
,IAction
,ISelectionChangedListener
,INullSelectionListener
,IPartListener2
,IPluginContribution
,ISelectionListener
For backward compatibility, the delegate object can implement either
IActionDelegate
or IObjectActionDelegate
.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The configuration element attribute for the identifier of the action which this action is intended to override (i.e., replace).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, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
-
Constructor Summary
ConstructorDescriptionObjectPluginAction
(IConfigurationElement actionElement, String id, int style) Constructs a new ObjectPluginAction. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes this plugin action.Returns the action identifier this action overrides.protected void
Initialize the action delegate by calling its lifecycle method.void
partActivated
(IWorkbenchPartReference partRef) Notifies this listener that the given part has been activated.void
partBroughtToTop
(IWorkbenchPartReference partRef) Notifies this listener that the given part has been brought to the top.void
partClosed
(IWorkbenchPartReference partRef) Notifies this listener that the given part has been closed.void
partDeactivated
(IWorkbenchPartReference partRef) Notifies this listener that the given part has been deactivated.void
partHidden
(IWorkbenchPartReference partRef) Notifies this listener that the given part is hidden or obscured by another part.void
partInputChanged
(IWorkbenchPartReference partRef) Notifies this listener that the given part's input was changed.void
partOpened
(IWorkbenchPartReference partRef) Notifies this listener that the given part has been opened.void
partVisible
(IWorkbenchPartReference partRef) Notifies this listener that the given part is visible.void
setActivePart
(IWorkbenchPart targetPart) Sets the active part for the delegate.Methods inherited from class org.eclipse.ui.internal.PluginAction
createDelegate, disposeDelegate, getConfigElement, getDelegate, getLocalId, getMenuCreator, getPluginId, getSelection, isOkToCreateDelegate, refreshEnablement, run, runWithEvent, selectionChanged, selectionChanged, selectionChanged, validateDelegate
Methods inherited from class org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
Methods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Field Details
-
ATT_OVERRIDE_ACTION_ID
The configuration element attribute for the identifier of the action which this action is intended to override (i.e., replace).- See Also:
-
-
Constructor Details
-
ObjectPluginAction
Constructs a new ObjectPluginAction.- Parameters:
actionElement
- The configuration element used to construct this action; must not benull
.id
- The identifier for this action; must not benull
.style
- The style bits
-
-
Method Details
-
partActivated
Description copied from interface:IPartListener2
Notifies this listener that the given part has been activated.- Specified by:
partActivated
in interfaceIPartListener2
- Parameters:
partRef
- the part that was activated- See Also:
-
partBroughtToTop
Description copied from interface:IPartListener2
Notifies this listener that the given part has been brought to the top.These events occur when an editor is brought to the top in the editor area, or when a view is brought to the top in a page book with multiple views. They are normally only sent when a part is brought to the top programmatically (via
IPerspective.bringToTop
). When a part is activated by the user clicking on it, onlypartActivated
is sent.- Specified by:
partBroughtToTop
in interfaceIPartListener2
- Parameters:
partRef
- the part that was surfaced- See Also:
-
partClosed
Description copied from interface:IPartListener2
Notifies this listener that the given part has been closed.Note that if other perspectives in the same page share the view, this notification is not sent. It is only sent when the view is being removed from the page entirely (it is being disposed).
- Specified by:
partClosed
in interfaceIPartListener2
- Parameters:
partRef
- the part that was closed- See Also:
-
partDeactivated
Description copied from interface:IPartListener2
Notifies this listener that the given part has been deactivated.- Specified by:
partDeactivated
in interfaceIPartListener2
- Parameters:
partRef
- the part that was deactivated- See Also:
-
partHidden
Description copied from interface:IPartListener2
Notifies this listener that the given part is hidden or obscured by another part.- Specified by:
partHidden
in interfaceIPartListener2
- Parameters:
partRef
- the part that is hidden or obscured by another part
-
partInputChanged
Description copied from interface:IPartListener2
Notifies this listener that the given part's input was changed.- Specified by:
partInputChanged
in interfaceIPartListener2
- Parameters:
partRef
- the part whose input was changed
-
partOpened
Description copied from interface:IPartListener2
Notifies this listener that the given part has been opened.Note that if other perspectives in the same page share the view, this notification is not sent. It is only sent when the view is being newly opened in the page (it is being created).
- Specified by:
partOpened
in interfaceIPartListener2
- Parameters:
partRef
- the part that was opened- See Also:
-
partVisible
Description copied from interface:IPartListener2
Notifies this listener that the given part is visible.- Specified by:
partVisible
in interfaceIPartListener2
- Parameters:
partRef
- the part that is visible
-
initDelegate
protected void initDelegate()Description copied from class:PluginAction
Initialize the action delegate by calling its lifecycle method. Subclasses may override but must call this implementation first.- Overrides:
initDelegate
in classPluginAction
-
setActivePart
Sets the active part for the delegate.This method will be called every time the action appears in a popup menu. The targetPart may change with each invocation.
- Parameters:
targetPart
- the new part target
-
getOverrideActionId
Returns the action identifier this action overrides.- Overrides:
getOverrideActionId
in classPluginAction
- Returns:
- the action identifier to override or
null
-
dispose
public void dispose()Description copied from class:PluginAction
Disposes this plugin action.- Overrides:
dispose
in classPluginAction
-