Class PerspectiveAction

All Implemented Interfaces:
IAction, ActionFactory.IWorkbenchAction
Direct Known Subclasses:
ToggleEditorsVisibilityAction

public abstract class PerspectiveAction extends Action implements ActionFactory.IWorkbenchAction
Abstract superclass of actions which are enabled iff there is an active perspective in the window.
Since:
3.1
  • Constructor Details

    • PerspectiveAction

      protected PerspectiveAction(IWorkbenchWindow window)
      Constructs a new perspective action for the given window.
      Parameters:
      window - the window
  • Method Details

    • getWindow

      protected IWorkbenchWindow getWindow()
      Returns the window, or null if the action has been disposed.
      Returns:
      the window or null
    • run

      public void run()
      Description copied from class: Action
      The default implementation of this IAction method does nothing. Subclasses should override this method if they do not need information from the triggering event, or override runWithEvent(Event) if they do.
      Specified by:
      run in interface IAction
      Overrides:
      run in class Action
      See Also:
    • run

      protected abstract void run(IWorkbenchPage page, IPerspectiveDescriptor persp)
      Runs the action, passing the active page and perspective.
      Parameters:
      page - the active page
      persp - the active perspective
    • dispose

      public void dispose()
      Description copied from interface: ActionFactory.IWorkbenchAction
      Disposes of this action. Once disposed, this action cannot be used. This operation has no effect if the action has already been disposed.
      Specified by:
      dispose in interface ActionFactory.IWorkbenchAction