Class PopupMenuExtender
- All Implemented Interfaces:
- EventListener,- IRegistryChangeListener,- IMenuListener,- IMenuListener2
- 
Constructor SummaryConstructorsConstructorDescriptionPopupMenuExtender(String id, MenuManager menu, ISelectionProvider prov, IWorkbenchPart part, IEclipseContext context) Construct a new menu extender.PopupMenuExtender(String id, MenuManager menu, ISelectionProvider prov, IWorkbenchPart part, IEclipseContext context, boolean includeEditorInput) Construct a new menu extender.
- 
Method SummaryModifier and TypeMethodDescriptionfinal voidAdds another menu identifier to this extender.voiddispose()Dispose of the menu extender.Return the menu identifiers for this extender.final booleanmatches(MenuManager menuManager, ISelectionProvider selectionProvider, IWorkbenchPart part) Determines whether this extender would be the same as another extender created with the given values.final voidNotifies the listener that the menu is about to be hidden.voidNotifies the listener that the menu is about to be shown.voidNotifies this listener that some registry changes are happening, or have already happened.
- 
Constructor Details- 
PopupMenuExtenderpublic PopupMenuExtender(String id, MenuManager menu, ISelectionProvider prov, IWorkbenchPart part, IEclipseContext context) Construct a new menu extender.- Parameters:
- id- the menu id
- menu- the menu to extend
- prov- the selection provider
- part- the part to extend
- context- the context to create the child popup menu context under
 
- 
PopupMenuExtenderpublic PopupMenuExtender(String id, MenuManager menu, ISelectionProvider prov, IWorkbenchPart part, IEclipseContext context, boolean includeEditorInput) Construct a new menu extender.- Parameters:
- id- the menu id
- menu- the menu to extend
- prov- the selection provider
- part- the part to extend
- context- the context to create the child popup menu context under
- includeEditorInput- Whether the editor input should be included when adding object contributions to this context menu.
 
 
- 
- 
Method Details- 
getMenuIdsReturn the menu identifiers for this extender.- Returns:
- The set of all identifiers that represent this extender.
 
- 
addMenuIdAdds another menu identifier to this extender. An extender can represent many menu identifiers. These identifiers should represent the same menu manager, selection provider and part. Duplicate identifiers are automatically ignored. For example, it is necessary to filter out duplicate identifiers for CompilationUnitEditorinstances, as these define both"#CompilationUnitEditorContext"and"org.eclipse.jdt.ui.CompilationUnitEditor.EditorContext"as menu identifier for the same pop-up menu. We don't want to contribute duplicate items in this case.- Parameters:
- menuId- The menu identifier to add to this extender; should not be- null.
 
- 
matchespublic final boolean matches(MenuManager menuManager, ISelectionProvider selectionProvider, IWorkbenchPart part) Determines whether this extender would be the same as another extender created with the given values. Two extenders are equivalent if they have the same menu manager, selection provider and part (i.e., if the menu they represent is about to show, they would populate it with duplicate values).- Parameters:
- menuManager- The menu manager with which to compare; may be- null.
- selectionProvider- The selection provider with which to compare; may be- null.
- part- The part with which to compare; may be- null.
- Returns:
- trueif the menu manager, selection provider and part are all the same.
 
- 
disposepublic void dispose()Dispose of the menu extender. Should only be called when the part is disposed.
- 
registryChangedDescription copied from interface:IRegistryChangeListenerNotifies this listener that some registry changes are happening, or have already happened.The supplied event gives details. This event object (and the deltas in it) is valid only for the duration of the invocation of this method. Note: This method is called by the platform; it is not intended to be called directly by clients. - Specified by:
- registryChangedin interface- IRegistryChangeListener
- Parameters:
- event- the registry change event
- See Also:
 
- 
getManager
 
-