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 IActioncreateAction(ITextEditor editor, IVerticalRulerInfo rulerInfo)The factory method creating the underlying action.voidmenuAboutToShow(IMenuManager manager)Notifies this listener that the menu is about to be shown by the given menu manager.voidmouseDoubleClick(MouseEvent e)Sent when a mouse button is pressed twice within the (operating system specified) double click period.voidmouseDown(MouseEvent e)Sent when a mouse button is pressed.voidmouseUp(MouseEvent e)Sent when a mouse button is released.voidrun(IAction callerAction)TheActionDelegateimplementation of thisIActionDelegatemethod does nothing.voidrunWithEvent(IAction action, Event event)TheActionDelegateimplementation of thisIActionDelegate2method redirects to therunmethod.voidselectionChanged(IAction action, ISelection selection)TheActionDelegateimplementation of thisIActionDelegatemethod does nothing.voidsetActiveEditor(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:IEditorActionDelegateSets 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:
setActiveEditorin 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:ActionDelegateTheActionDelegateimplementation of thisIActionDelegatemethod does nothing. Subclasses may reimplement.Note: This method is not called directly by the proxy action. Only by the default implementation of
runWithEventof this abstract class.- Specified by:
runin interfaceIActionDelegate- Overrides:
runin 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:ActionDelegateTheActionDelegateimplementation of thisIActionDelegate2method redirects to therunmethod. Subclasses may reimplement.- Specified by:
runWithEventin interfaceIActionDelegate2- Overrides:
runWithEventin 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:ActionDelegateTheActionDelegateimplementation of thisIActionDelegatemethod does nothing. Subclasses may reimplement.- Specified by:
selectionChangedin interfaceIActionDelegate- Overrides:
selectionChangedin classActionDelegate- Parameters:
action- the action proxy that handles presentation portion of the actionselection- the current selection, ornullif there is no selection.
-
menuAboutToShow
public void menuAboutToShow(IMenuManager manager)
Description copied from interface:IMenuListenerNotifies this listener that the menu is about to be shown by the given menu manager.- Specified by:
menuAboutToShowin interfaceIMenuListener- Parameters:
manager- the menu manager
-
mouseDoubleClick
public void mouseDoubleClick(MouseEvent e)
Description copied from interface:MouseListenerSent when a mouse button is pressed twice within the (operating system specified) double click period.- Specified by:
mouseDoubleClickin 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:MouseListenerSent when a mouse button is pressed.- Specified by:
mouseDownin interfaceMouseListener- Parameters:
e- an event containing information about the mouse button press
-
mouseUp
public void mouseUp(MouseEvent e)
Description copied from interface:MouseListenerSent when a mouse button is released.- Specified by:
mouseUpin interfaceMouseListener- Parameters:
e- an event containing information about the mouse button release
-
-