Eclipse Platform
Release 3.3

org.eclipse.ui.actions
Class ContributedAction

java.lang.Object
  extended byorg.eclipse.core.commands.common.EventManager
      extended byorg.eclipse.jface.action.AbstractAction
          extended byorg.eclipse.jface.action.Action
              extended byorg.eclipse.ui.internal.actions.CommandAction
                  extended byorg.eclipse.ui.actions.ContributedAction
All Implemented Interfaces:
IAction

public final class ContributedAction
extends org.eclipse.ui.internal.actions.CommandAction

For a declarative editor action, see if we can link it to a command.

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.

Since:
3.3

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
ContributedAction(IServiceLocator locator, IConfigurationElement element)
          Create an action that can call a command.
 
Method Summary
 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().
 
Methods inherited from class org.eclipse.ui.internal.actions.CommandAction
dispose, getActionDefinitionId, getCommandListener, getParameterizedCommand, init, run
 
Methods inherited from class org.eclipse.jface.action.Action
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
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.action.IAction
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

ContributedAction

public ContributedAction(IServiceLocator locator,
                         IConfigurationElement element)
                  throws CommandNotMappedException
Create an action that can call a command.

Parameters:
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 element
Method Detail

runWithEvent

public void runWithEvent(Event event)
Description copied from class: Action
The default implementation of this 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.


isEnabled

public boolean isEnabled()
Description copied from interface: IAction
Returns whether this action is enabled.

This method is associated with the ENABLED property; property change events are reported when its value changes.

Specified by:
isEnabled in interface IAction
Overrides:
isEnabled in class Action

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.