Package org.eclipse.ui.internal
Class WWinPluginAction
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
org.eclipse.ui.internal.PluginAction
org.eclipse.ui.internal.WWinPluginAction
- All Implemented Interfaces:
EventListener,IAction,ISelectionChangedListener,IActionSetContributionItem,INullSelectionListener,IPluginContribution,ISelectionListener
- Direct Known Subclasses:
WWinPluginPulldown
This class extends regular plugin action with the additional requirement that
the delegate has to implement interface
IWorkbenchWindowActionDelegate. This interface has one
additional method (init) whose purpose is to initialize the delegate with the
window in which the action is intended to run.-
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, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT -
Constructor Summary
ConstructorsConstructorDescriptionWWinPluginAction(IConfigurationElement actionElement, IWorkbenchWindow window, String id, int style) Constructs a newWWinPluginActionobject. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Disposes of the action and any resources held.Returns the action set id.protected voidInitialize the action delegate by calling its lifecycle method.booleanReturns true if the window has been set.static voidCreates any actions which belong to an activated plugin.protected voidRefresh the selection for the action.voidrunWithEvent(Event event) The default implementation of thisIActionmethod ignores the event argument, and simply callsrun().voidsetActionSetId(String newActionSetId) Sets the action set id.voidsetChecked(boolean checked) Sets the checked status of this action.voidsetHelpListener(HelpListener listener) TheWWinPluginActionimplementation of this method declared onIActionstores the help listener in a local field.toString()protected IActionDelegatevalidateDelegate(Object obj) Validates the object is a delegate of the expected type.Methods inherited from class org.eclipse.ui.internal.PluginAction
createDelegate, disposeDelegate, getConfigElement, getDelegate, getLocalId, getMenuCreator, getOverrideActionId, getPluginId, getSelection, refreshEnablement, run, selectionChanged, selectionChanged, selectionChangedMethods 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, setDescription, setDisabledImageDescriptor, setEnabled, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipTextMethods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListenerMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Constructor Details
-
WWinPluginAction
public WWinPluginAction(IConfigurationElement actionElement, IWorkbenchWindow window, String id, int style) Constructs a newWWinPluginActionobject.- Parameters:
actionElement- the configuration elementwindow- the window to contribute toid- the identifierstyle- the style
-
-
Method Details
-
refreshActionList
public static void refreshActionList()Creates any actions which belong to an activated plugin. -
validateDelegate
Description copied from class:PluginActionValidates the object is a delegate of the expected type. Subclasses can override to check for specific delegate types.Note: Calls to the object are not allowed during this method.
- Overrides:
validateDelegatein classPluginAction- Parameters:
obj- a possible action delegate implementation- Returns:
- the
IActionDelegateimplementation for the object - Throws:
WorkbenchException- if not of the expected delegate type
-
initDelegate
protected void initDelegate()Description copied from class:PluginActionInitialize the action delegate by calling its lifecycle method. Subclasses may override but must call this implementation first.- Overrides:
initDelegatein classPluginAction
-
dispose
public void dispose()Disposes of the action and any resources held.- Overrides:
disposein classPluginAction
-
getActionSetId
Returns the action set id.- Specified by:
getActionSetIdin interfaceIActionSetContributionItem
-
isOkToCreateDelegate
public boolean isOkToCreateDelegate()Returns true if the window has been set. The window may be null after the constructor is called and before the window is stored. We cannot create the delegate at that time.- Overrides:
isOkToCreateDelegatein classPluginAction
-
runWithEvent
Description copied from class:ActionThe default implementation of thisIActionmethod ignores the event argument, and simply callsrun(). Subclasses should override this method if they need information from the triggering event, or overriderun()if not.- Specified by:
runWithEventin interfaceIAction- Overrides:
runWithEventin classPluginAction- Parameters:
event- the SWT event which triggered this action being run- See Also:
-
setActionSetId
Sets the action set id.- Specified by:
setActionSetIdin interfaceIActionSetContributionItem
-
setHelpListener
TheWWinPluginActionimplementation of this method declared onIActionstores the help listener in a local field. The supplied listener is only used if there is no retarget action.- Specified by:
setHelpListenerin interfaceIAction- Overrides:
setHelpListenerin classAction- Parameters:
listener- a help listener for this action
-
setChecked
public void setChecked(boolean checked) Description copied from interface:IActionSets the checked status of this action. Applicable for the stylesAS_CHECK_BOXorAS_RADIO_BUTTON.Fires a property change event for the
CHECKEDproperty if the checked status actually changes as a consequence.- Specified by:
setCheckedin interfaceIAction- Overrides:
setCheckedin classAction- Parameters:
checked- the new checked status- See Also:
-
refreshSelection
protected void refreshSelection()Refresh the selection for the action. -
toString
-