Package org.eclipse.ui.texteditor
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 byIVerticalRulerInfo
. 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 Summary
Constructors Constructor Description AbstractRulerActionDelegate()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract IAction
createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo)
The factory method creating the underlying action.void
menuAboutToShow(IMenuManager manager)
Notifies this listener that the menu is about to be shown by the given menu manager.void
mouseDoubleClick(MouseEvent e)
Sent when a mouse button is pressed twice within the (operating system specified) double click period.void
mouseDown(MouseEvent e)
Sent when a mouse button is pressed.void
mouseUp(MouseEvent e)
Sent when a mouse button is released.void
run(IAction callerAction)
TheActionDelegate
implementation of thisIActionDelegate
method does nothing.void
runWithEvent(IAction action, Event event)
TheActionDelegate
implementation of thisIActionDelegate2
method redirects to therun
method.void
selectionChanged(IAction action, ISelection selection)
TheActionDelegate
implementation of thisIActionDelegate
method does nothing.void
setActiveEditor(IAction callerAction, IEditorPart targetEditor)
Sets the active editor for the delegate.-
Methods inherited from class org.eclipse.ui.actions.ActionDelegate
dispose, init
-
-
-
-
Method Detail
-
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 onrulerInfo
- 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 interfaceIEditorActionDelegate
- Parameters:
callerAction
- the action proxy that handles presentation portion of the actiontargetEditor
- the new editor target
-
run
public void run(IAction callerAction)
Description copied from class:ActionDelegate
TheActionDelegate
implementation of thisIActionDelegate
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 interfaceIActionDelegate
- Overrides:
run
in classActionDelegate
- 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
TheActionDelegate
implementation of thisIActionDelegate2
method redirects to therun
method. Subclasses may reimplement.- Specified by:
runWithEvent
in interfaceIActionDelegate2
- Overrides:
runWithEvent
in classActionDelegate
- Parameters:
action
- the action proxy that handles the presentation portion of the actionevent
- the SWT event which triggered this action being run
-
selectionChanged
public void selectionChanged(IAction action, ISelection selection)
Description copied from class:ActionDelegate
TheActionDelegate
implementation of thisIActionDelegate
method does nothing. Subclasses may reimplement.- Specified by:
selectionChanged
in interfaceIActionDelegate
- Overrides:
selectionChanged
in classActionDelegate
- Parameters:
action
- the action proxy that handles presentation portion of the actionselection
- the current selection, ornull
if there is no selection.
-
menuAboutToShow
public void menuAboutToShow(IMenuManager manager)
Description copied from interface:IMenuListener
Notifies this listener that the menu is about to be shown by the given menu manager.- Specified by:
menuAboutToShow
in interfaceIMenuListener
- Parameters:
manager
- the menu manager
-
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 interfaceMouseListener
- Parameters:
e
- an event containing information about the mouse double click- See Also:
Display.getDoubleClickTime()
-
mouseDown
public void mouseDown(MouseEvent e)
Description copied from interface:MouseListener
Sent when a mouse button is pressed.- Specified by:
mouseDown
in interfaceMouseListener
- 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 interfaceMouseListener
- Parameters:
e
- an event containing information about the mouse button release
-
-