summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMikael Barbero2013-01-12 10:02:43 (EST)
committer Paul Webster2013-01-14 13:21:31 (EST)
commit22bd86e9a1f8464ff0226d40d4f39068d1747c40 (patch)
tree61417796f70b373a0cd795c5891421fe2a7ca4a9
parent5c5ce40ef71998cacaed0cda75fc2881f4ed13a5 (diff)
downloadeclipse.platform.ui-22bd86e9a1f8464ff0226d40d4f39068d1747c40.zip
eclipse.platform.ui-22bd86e9a1f8464ff0226d40d4f39068d1747c40.tar.gz
eclipse.platform.ui-22bd86e9a1f8464ff0226d40d4f39068d1747c40.tar.bz2
Bug 366528 - [Compatibility] Implement
IMenuService#populateContributionManager(*) Handle popup contribution requests
-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 cdea13a..561659b 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();