public class OutlineContextMenuContribution extends OutlineContribution
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 and Description |
---|
OutlineContextMenuContribution() |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
dispose()
Disposes of this contribution.
|
protected java.lang.String |
getContextMenuExtensionId()
Returns the unique id to use for registration the context menu with
the workbench, or
null if the menu is not eligible
for extension. |
protected java.lang.String |
getContextMenuId()
Returns the id of the context menu manager, or
null
if the menu has no id. |
void |
init(ICommonOutlinePage outlinePage)
Initializes this contribution.
|
getOutlinePage
public void init(ICommonOutlinePage outlinePage)
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 by getContextMenuId()
and will invoke contextMenuAboutToShow(IMenuManager)
when it is about to be shown.
If an extension id
is provided,
the menu will be registered with the workbench for extension.
init
in interface IOutlineContribution
init
in class OutlineContribution
outlinePage
- the contribution's outline page
(never null
)public void dispose()
OutlineContribution
init()
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.
dispose
in interface IOutlineContribution
dispose
in class OutlineContribution
protected java.lang.String getContextMenuId()
null
if the menu has no id.
Default implementation returns null
.
Subclasses may override this method.
protected java.lang.String getContextMenuExtensionId()
null
if the menu is not eligible
for extension.
Default implementation returns null
.
Subclasses may override this method.
protected void contextMenuAboutToShow(org.eclipse.jface.action.IMenuManager 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.
manager
- the menu manager (never null
)Copyright (c) 2014, 2018 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0