/** * Prepares the menu for object contributions, if the option is set in the extension. The option * is controlled by the &lgt;popupMenu /> element's 'allowPlatformContributions' attribute. * Clients may choose to ignore this setting by supplying a value of <b>true</b> for the * <code>force</code> attribute. * * @param menu * The context menu of the IViewPart * @param aSelectionProvider * The selection provider that will supplement actions with a valid, current * selection. * @param force * A value of 'true' forces the menu to be registered for object/view contributions. * Otherwise, the option from the extension point will be respected. See * <b>org.eclipse.ui.navigator.viewer/viewer</b> for more information. */ public void prepareMenuForPlatformContributions(MenuManager menu, ISelectionProvider aSelectionProvider, boolean force) { Assert.isTrue(!disposed); if (commonViewerSite instanceof ICommonViewerWorkbenchSite) { /* * Hooks into the Eclipse framework for Object contributions, and View contributions. */ if (force || viewerDescriptor.allowsPlatformContributionsToContextMenu()) { ((ICommonViewerWorkbenchSite) commonViewerSite).registerContextMenu(contentService.getViewerDescriptor().getPopupMenuId(), menu, aSelectionProvider); } } }