public final class ContributedAction
extends org.eclipse.ui.internal.actions.CommandAction
This is a legacy bridge class, and should not be used outside of the Eclipse SDK. Please use menu contributions to display a command in a menu or toolbar.
Note: Clients may instantiate.
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 |
---|
ContributedAction(IServiceLocator locator,
IConfigurationElement element)
Create an action that can call a command.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isEnabled()
Returns whether this action is enabled.
|
void |
runWithEvent(Event event)
The default implementation of this
IAction method ignores
the event argument, and simply calls run() . |
dispose, getActionDefinitionId, getCommandListener, getParameterizedCommand, init, run
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, removePropertyChangeListener
public ContributedAction(IServiceLocator locator, IConfigurationElement element) throws CommandNotMappedException
locator
- The appropriate service locator to use. If you use a part site
as your locator, this action will be tied to your part.element
- the contributed action elementCommandNotMappedException
public void runWithEvent(Event event)
Action
IAction
method ignores
the event argument, and simply calls run()
. Subclasses
should override this method if they need information from the triggering
event, or override run()
if not.runWithEvent
in interface IAction
runWithEvent
in class org.eclipse.ui.internal.actions.CommandAction
event
- the SWT event which triggered this action being runpublic boolean isEnabled()
IAction
This method is associated with the ENABLED
property;
property change events are reported when its value changes.
isEnabled
in interface IAction
isEnabled
in class Action
true
if enabled, and
false
if disabledIAction.ENABLED
Copyright (c) 2000, 2013 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.