Class AbstractRulerActionDelegate

java.lang.Object
org.eclipse.ui.actions.ActionDelegate
org.eclipse.ui.texteditor.AbstractRulerActionDelegate
All Implemented Interfaces:
EventListener, IMenuListener, MouseListener, SWTEventListener, IActionDelegate, IActionDelegate2, IEditorActionDelegate
Direct Known Subclasses:
BookmarkRulerAction, RulerEnableDisableBreakpointActionDelegate, RulerRunToLineActionDelegate, RulerToggleBreakpointActionDelegate, SelectRulerAction, TaskRulerAction

public abstract class AbstractRulerActionDelegate extends ActionDelegate implements IEditorActionDelegate, MouseListener, IMenuListener
This class serves as an adapter for actions contributed to the vertical ruler's context menu. This adapter provides the contributed actions access to their editor and the editor's vertical ruler. These actions gain only limited access to the vertical ruler as defined by IVerticalRulerInfo. The adapter updates the adapter (inner) action on menu and mouse action on the vertical ruler.

Extending classes must implement the factory method createAction(ITextEditor editor, IVerticalRulerInfo).

Since:
2.0
  • Constructor Details

    • AbstractRulerActionDelegate

      public AbstractRulerActionDelegate()
  • Method Details

    • createAction

      protected abstract IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo)
      The factory method creating the underlying action.
      Parameters:
      editor - the editor the action to be created will work on
      rulerInfo - the vertical ruler the action to be created will work on
      Returns:
      the created action
    • setActiveEditor

      public void setActiveEditor(IAction callerAction, IEditorPart targetEditor)
      Description copied from interface: IEditorActionDelegate
      Sets the active editor for the delegate. Implementors should disconnect from the old editor, connect to the new editor, and update the action to reflect the new editor.
      Specified by:
      setActiveEditor in interface IEditorActionDelegate
      Parameters:
      callerAction - the action proxy that handles presentation portion of the action
      targetEditor - the new editor target
    • run

      public void run(IAction callerAction)
      Description copied from class: ActionDelegate
      The ActionDelegate implementation of this IActionDelegate method does nothing. Subclasses may reimplement.

      Note: This method is not called directly by the proxy action. Only by the default implementation of runWithEvent of this abstract class.

      Specified by:
      run in interface IActionDelegate
      Overrides:
      run in class ActionDelegate
      Parameters:
      callerAction - the action proxy that handles the presentation portion of the action
    • runWithEvent

      public void runWithEvent(IAction action, Event event)
      Description copied from class: ActionDelegate
      The ActionDelegate implementation of this IActionDelegate2 method redirects to the run method. Subclasses may reimplement.
      Specified by:
      runWithEvent in interface IActionDelegate2
      Overrides:
      runWithEvent in class ActionDelegate
      Parameters:
      action - the action proxy that handles the presentation portion of the action
      event - the SWT event which triggered this action being run
    • selectionChanged

      public void selectionChanged(IAction action, ISelection selection)
      Description copied from class: ActionDelegate
      The ActionDelegate implementation of this IActionDelegate method does nothing. Subclasses may reimplement.
      Specified by:
      selectionChanged in interface IActionDelegate
      Overrides:
      selectionChanged in class ActionDelegate
      Parameters:
      action - the action proxy that handles presentation portion of the action
      selection - the current selection, or null if there is no selection.
    • mouseDoubleClick

      public void mouseDoubleClick(MouseEvent e)
      Description copied from interface: MouseListener
      Sent when a mouse button is pressed twice within the (operating system specified) double click period.
      Specified by:
      mouseDoubleClick in interface MouseListener
      Parameters:
      e - an event containing information about the mouse double click
      See Also:
    • mouseDown

      public void mouseDown(MouseEvent e)
      Description copied from interface: MouseListener
      Sent when a mouse button is pressed.
      Specified by:
      mouseDown in interface MouseListener
      Parameters:
      e - an event containing information about the mouse button press
    • mouseUp

      public void mouseUp(MouseEvent e)
      Description copied from interface: MouseListener
      Sent when a mouse button is released.
      Specified by:
      mouseUp in interface MouseListener
      Parameters:
      e - an event containing information about the mouse button release