Class ContributedAction

  • All Implemented Interfaces:

    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.

    • Constructor Detail

      • ContributedAction

        public ContributedAction​(IServiceLocator locator,
                                 IConfigurationElement element)
                          throws CommandNotMappedException
        Create an action that can call a command.
        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
        CommandNotMappedException - if the element is not mapped to a command
    • 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.
        Specified by:
        runWithEvent in interface IAction
        runWithEvent in class org.eclipse.ui.internal.actions.CommandAction
        event - the SWT event which triggered this action being run
        See Also:
        How radio buttons are handled, How check boxes are handled
      • 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
        isEnabled in class Action
        true if enabled, and false if disabled
        See Also: