Class OutlineContextMenuContribution
- All Implemented Interfaces:
IOutlineContribution
Contributes an empty menu which has no id and is not eligible for extension. Subclasses may override corresponding methods to configure the menu as necessary.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
contextMenuAboutToShow
(org.eclipse.jface.action.IMenuManager manager) Notifies that the context menu of the outline page is about to be shown by the given menu manager.void
dispose()
Disposes of this contribution.protected String
Returns the unique id to use for registration the context menu with the workbench, ornull
if the menu is not eligible for extension.protected String
Returns the id of the context menu manager, ornull
if the menu has no id.void
init
(ICommonOutlinePage outlinePage) Initializes this contribution.Methods inherited from class org.eclipse.handly.ui.outline.OutlineContribution
getOutlinePage
-
Constructor Details
-
OutlineContextMenuContribution
public OutlineContextMenuContribution()
-
-
Method Details
-
init
Initializes this contribution. This method is called after the outline page's tree viewer has been created.This method may be extended by subclasses. Subclasses must call the superclass implementation.
OutlineContextMenuContribution
extends this method to create a context menu for the outline page's tree viewer. The menu will have id as computed bygetContextMenuId()
and will invokecontextMenuAboutToShow(IMenuManager)
when it is about to be shown. If anextension id
is provided, the menu will be registered with the workbench for extension.- Specified by:
init
in interfaceIOutlineContribution
- Overrides:
init
in classOutlineContribution
- Parameters:
outlinePage
- the contribution's outline page (nevernull
)
-
dispose
public void dispose()Description copied from class:OutlineContribution
Disposes of this contribution. Implementors should clean up any resources associated with this contribution. Note that there is no guarantee thatinit()
has been called. This method has no effect if this contribution has already been disposed.This method may be extended by subclasses. Subclasses must call the superclass implementation.
- Specified by:
dispose
in interfaceIOutlineContribution
- Overrides:
dispose
in classOutlineContribution
-
getContextMenuId
Returns the id of the context menu manager, ornull
if the menu has no id.Default implementation returns
null
. Subclasses may override this method. -
getContextMenuExtensionId
Returns the unique id to use for registration the context menu with the workbench, ornull
if the menu is not eligible for extension.Default implementation returns
null
. Subclasses may override this method. -
contextMenuAboutToShow
protected void contextMenuAboutToShow(org.eclipse.jface.action.IMenuManager manager) Notifies that the context menu of the outline page is about to be shown by the given menu manager.Default implementation contributes
IWorkbenchActionConstants.MB_ADDITIONS
group if the context menu was registered with the workbench for extension. Subclasses may extend this method and contribute other items.- Parameters:
manager
- the menu manager (nevernull
)
-