aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Descher2013-03-15 08:51:27 (EDT)
committerGerrit Code Review @ Eclipse.org2013-03-18 09:59:47 (EDT)
commit958299e68bb425ba6d7be474b40b4d6f22409e27 (patch)
treea208d11b96188e655fde4fabfa7b49268bf5b2e7
parent77580cb7fe7ba84bacfaefccf6be804c501710d0 (diff)
downloadeclipse.platform.ui-958299e68bb425ba6d7be474b40b4d6f22409e27.zip
eclipse.platform.ui-958299e68bb425ba6d7be474b40b4d6f22409e27.tar.gz
eclipse.platform.ui-958299e68bb425ba6d7be474b40b4d6f22409e27.tar.bz2
[403081] Missing context in DynamicMenuContributionrefs/changes/95/11195/4
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerHideProcessor.java12
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerShowProcessor.java6
2 files changed, 14 insertions, 4 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerHideProcessor.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerHideProcessor.java
index fb8be5c..176a179 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerHideProcessor.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerHideProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 IBM Corporation and others.
+ * Copyright (c) 2010, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Marco Descher <marco@descher.at> - Bug403081
*******************************************************************************/
package org.eclipse.e4.ui.workbench.renderers.swt;
@@ -21,6 +22,7 @@ import org.eclipse.e4.ui.model.application.ui.menu.MDynamicMenuContribution;
import org.eclipse.e4.ui.model.application.ui.menu.MMenu;
import org.eclipse.e4.ui.model.application.ui.menu.MMenuElement;
import org.eclipse.e4.ui.model.application.ui.menu.MPopupMenu;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.jface.action.IMenuListener2;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
@@ -37,6 +39,9 @@ public class MenuManagerHideProcessor implements IMenuListener2 {
@Inject
private MenuManagerRenderer renderer;
+ @Inject
+ private EModelService modelService;
+
/*
* (non-Javadoc)
*
@@ -89,8 +94,11 @@ public class MenuManagerHideProcessor implements IMenuListener2 {
.getTransientData()
.get(MenuManagerShowProcessor.DYNAMIC_ELEMENT_STORAGE_KEY);
dynamicMenuContext.set(List.class, mel);
+ IEclipseContext parentContext = modelService
+ .getContainingContext(currentMenuElement);
ContextInjectionFactory.invoke(contribution,
- AboutToHide.class, dynamicMenuContext);
+ AboutToHide.class, parentContext,
+ dynamicMenuContext, null);
}
}
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerShowProcessor.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerShowProcessor.java
index e87a064..c00842e 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerShowProcessor.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerShowProcessor.java
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Marco Descher <marco@descher.at> - Bug 389063, Bug 398865, Bug 398866
+ * Marco Descher <marco@descher.at> - Bug 389063, Bug 398865, Bug 398866, Bug403081
*******************************************************************************/
package org.eclipse.e4.ui.workbench.renderers.swt;
@@ -157,8 +157,10 @@ public class MenuManagerShowProcessor implements IMenuListener2 {
.create();
ArrayList<MMenuElement> mel = new ArrayList<MMenuElement>();
dynamicMenuContext.set(List.class, mel);
+ IEclipseContext parentContext = modelService
+ .getContainingContext(currentMenuElement);
ContextInjectionFactory.invoke(contribution, AboutToShow.class,
- dynamicMenuContext);
+ parentContext, dynamicMenuContext, null);
// remove existing entries for this dynamic contribution item if
// there are any