Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/WorkbenchMenuService.java')
-rwxr-xr-xbundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/WorkbenchMenuService.java25
1 files changed, 19 insertions, 6 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/WorkbenchMenuService.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/WorkbenchMenuService.java
index cdea13acf29..561659bd0f3 100755
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/WorkbenchMenuService.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/WorkbenchMenuService.java
@@ -286,7 +286,7 @@ public class WorkbenchMenuService implements IMenuService {
MenuManagerRenderer renderer = (MenuManagerRenderer) obj;
mMenu.setRenderer(renderer);
renderer.reconcileManagerToModel(menu, mMenu);
- renderer.processContributions(mMenu, false, false);
+ renderer.processContributions(mMenu, false, "popup".equals(uri.getScheme())); //$NON-NLS-1$
// double cast because we're bad people
renderer.processContents((MElementContainer<MUIElement>) ((Object) mMenu));
}
@@ -332,7 +332,9 @@ public class WorkbenchMenuService implements IMenuService {
if (mToolBar == null) {
mToolBar = MenuFactoryImpl.eINSTANCE.createToolBar();
mToolBar.setElementId(location.getPath());
- mToolBar.getTags().add("toolbar:" + location.getPath()); //$NON-NLS-1$
+ mToolBar.getTags().add(ContributionsAnalyzer.MC_TOOLBAR);
+ String tag = "toolbar:" + location.getPath(); //$NON-NLS-1$
+ mToolBar.getTags().add(tag);
final MPart part = getPartToExtend();
if (part != null) {
addToolbar(part, mToolBar, part.getContext());
@@ -347,7 +349,7 @@ public class WorkbenchMenuService implements IMenuService {
renderer.linkModelToManager(mToolBar, toolbarManager);
- return null;
+ return mToolBar;
}
private void addToolbar(MApplicationElement model, MToolBar tb, IEclipseContext ctx) {
@@ -388,7 +390,12 @@ public class WorkbenchMenuService implements IMenuService {
MenuManagerRenderer renderer = (MenuManagerRenderer) obj;
MMenu mMenu = renderer.getMenuModel(menuManager);
if (mMenu != null) {
- String tag = "menu:" + location.getPath(); //$NON-NLS-1$
+ final String tag;
+ if ("popup".equals(location.getScheme())) { //$NON-NLS-1$
+ tag = "popup:" + location.getPath(); //$NON-NLS-1$
+ } else {
+ tag = "menu:" + location.getPath(); //$NON-NLS-1$
+ }
if (!mMenu.getTags().contains(tag)) {
mMenu.getTags().add(tag);
}
@@ -401,8 +408,14 @@ public class WorkbenchMenuService implements IMenuService {
if (mMenu.getElementId() == null) {
mMenu.setElementId(location.getPath());
}
- mMenu.getTags().add(ContributionsAnalyzer.MC_MENU);
- String tag = "menu:" + location.getPath(); //$NON-NLS-1$
+ final String tag;
+ if ("popup".equals(location.getScheme())) { //$NON-NLS-1$
+ mMenu.getTags().add(ContributionsAnalyzer.MC_POPUP);
+ tag = "popup:" + location.getPath(); //$NON-NLS-1$
+ } else {
+ mMenu.getTags().add(ContributionsAnalyzer.MC_MENU);
+ tag = "menu:" + location.getPath(); //$NON-NLS-1$
+ }
mMenu.getTags().add(tag);
mMenu.setLabel(menuManager.getMenuText());
final MPart part = getPartToExtend();

Back to the top