Class OutlineContextMenuContribution
- java.lang.Object
-
- org.eclipse.handly.ui.outline.OutlineContribution
-
- org.eclipse.handly.ui.outline.OutlineContextMenuContribution
-
- All Implemented Interfaces:
IOutlineContribution
public class OutlineContextMenuContribution extends OutlineContribution
A base class for outline context menu contributions.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 Constructor Description OutlineContextMenuContribution()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcontextMenuAboutToShow(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.voiddispose()Disposes of this contribution.protected java.lang.StringgetContextMenuExtensionId()Returns the unique id to use for registration the context menu with the workbench, ornullif the menu is not eligible for extension.protected java.lang.StringgetContextMenuId()Returns the id of the context menu manager, ornullif the menu has no id.voidinit(ICommonOutlinePage outlinePage)Initializes this contribution.-
Methods inherited from class org.eclipse.handly.ui.outline.OutlineContribution
getOutlinePage
-
-
-
-
Method Detail
-
init
public void init(ICommonOutlinePage outlinePage)
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.
OutlineContextMenuContributionextends 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 idis provided, the menu will be registered with the workbench for extension.- Specified by:
initin interfaceIOutlineContribution- Overrides:
initin classOutlineContribution- Parameters:
outlinePage- the contribution's outline page (nevernull)
-
dispose
public void dispose()
Description copied from class:OutlineContributionDisposes 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:
disposein interfaceIOutlineContribution- Overrides:
disposein classOutlineContribution
-
getContextMenuId
protected java.lang.String getContextMenuId()
Returns the id of the context menu manager, ornullif the menu has no id.Default implementation returns
null. Subclasses may override this method.
-
getContextMenuExtensionId
protected java.lang.String getContextMenuExtensionId()
Returns the unique id to use for registration the context menu with the workbench, ornullif 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_ADDITIONSgroup 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)
-
-