Class CommandAction

    • 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

      Constructors 
      Constructor Description
      CommandAction​(org.eclipse.ui.services.IServiceLocator serviceLocator, String commandIdIn)
      Creates the action backed by a command.
      CommandAction​(org.eclipse.ui.services.IServiceLocator serviceLocator, String commandIdIn, int style, String menuIdIn)
      Creates the action backed by a command.
      CommandAction​(org.eclipse.ui.services.IServiceLocator serviceLocator, String commandIdIn, String menuIdIn)
      Creates the action backed by a command.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      void run()
      void runWithEvent​(org.eclipse.swt.widgets.Event event)
      void selectionChanged​(SelectionChangedEvent event)  
      void update​(ISelection selection)
      Updates the action's enablement state according to the given selection.
      • Methods inherited from class org.eclipse.jface.action.Action

        convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, 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
      • Methods inherited from interface org.eclipse.jface.action.IAction

        addPropertyChangeListener, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, removePropertyChangeListener, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
    • Constructor Detail

      • CommandAction

        public CommandAction​(org.eclipse.ui.services.IServiceLocator serviceLocator,
                             String commandIdIn)
        Creates the action backed by a command. For commands that don't take parameters.
        Parameters:
        serviceLocator - The service locator that is closest in lifecycle to this action.
        commandIdIn - the command id. Must not be null.
      • CommandAction

        public CommandAction​(org.eclipse.ui.services.IServiceLocator serviceLocator,
                             String commandIdIn,
                             String menuIdIn)
        Creates the action backed by a command. For commands that don't take parameters.
        Parameters:
        serviceLocator - The service locator that is closest in lifecycle to this action.
        commandIdIn - the command id. Must not be null.
      • CommandAction

        public CommandAction​(org.eclipse.ui.services.IServiceLocator serviceLocator,
                             String commandIdIn,
                             int style,
                             String menuIdIn)
        Creates the action backed by a command. For commands that don't take parameters.
        Parameters:
        serviceLocator - The service locator that is closest in lifecycle to this action.
        commandIdIn - the command id. Must not be null.
        style - the style
        menuIdIn -
    • Method Detail

      • dispose

        public void dispose()
        Specified by:
        dispose in interface org.eclipse.ui.actions.ActionFactory.IWorkbenchAction
      • run

        public void run()
        Specified by:
        run in interface org.eclipse.jface.action.IAction
        Overrides:
        run in class org.eclipse.jface.action.Action
      • runWithEvent

        public void runWithEvent​(org.eclipse.swt.widgets.Event event)
        Specified by:
        runWithEvent in interface org.eclipse.jface.action.IAction
        Overrides:
        runWithEvent in class org.eclipse.jface.action.Action
      • update

        public void update​(ISelection selection)
        Updates the action's enablement state according to the given selection. This default implementation changes handler enablement state.
        Parameters:
        selection - the selection this action is working on