aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Descher2013-03-15 09:22:43 (EDT)
committerGerrit Code Review @ Eclipse.org2013-03-18 10:38:08 (EDT)
commit806e44845e2b8dc1b4991c3c1871297bc418656e (patch)
treef732194686b0ecf557153b30135d2665c181cd93
parentf5cf1092dfb50c8f05372e02f92731b635002262 (diff)
downloadeclipse.platform.ui-806e44845e2b8dc1b4991c3c1871297bc418656e.zip
eclipse.platform.ui-806e44845e2b8dc1b4991c3c1871297bc418656e.tar.gz
eclipse.platform.ui-806e44845e2b8dc1b4991c3c1871297bc418656e.tar.bz2
[403083] MDynamicMenuContribution @AboutToHide is not optionalrefs/changes/96/11196/4
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerHideProcessor.java1
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerShowProcessor.java19
2 files changed, 17 insertions, 3 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 176a179..eac8428 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
@@ -8,6 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Marco Descher <marco@descher.at> - Bug403081
+ * Marco Descher <marco@descher.at> - Bug 403083
*******************************************************************************/
package org.eclipse.e4.ui.workbench.renderers.swt;
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 c00842e..6cd03c9 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,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Marco Descher <marco@descher.at> - Bug 389063, Bug 398865, Bug 398866, Bug403081
+ * Marco Descher <marco@descher.at> - Bug 389063, Bug 398865, Bug 398866,
+ * Bug403081, Bug 403083
*******************************************************************************/
package org.eclipse.e4.ui.workbench.renderers.swt;
@@ -19,7 +20,9 @@ import javax.inject.Inject;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.EclipseContextFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.core.services.contributions.IContributionFactory;
+import org.eclipse.e4.core.services.log.Logger;
import org.eclipse.e4.ui.di.AboutToShow;
import org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer;
import org.eclipse.e4.ui.internal.workbench.swt.Policy;
@@ -62,6 +65,10 @@ public class MenuManagerShowProcessor implements IMenuListener2 {
@Inject
private IContributionFactory contributionFactory;
+ @Inject
+ @Optional
+ private Logger logger;
+
private HashMap<Menu, Runnable> pendingCleanup = new HashMap<Menu, Runnable>();
/*
@@ -159,8 +166,14 @@ public class MenuManagerShowProcessor implements IMenuListener2 {
dynamicMenuContext.set(List.class, mel);
IEclipseContext parentContext = modelService
.getContainingContext(currentMenuElement);
- ContextInjectionFactory.invoke(contribution, AboutToShow.class,
- parentContext, dynamicMenuContext, null);
+ if (ContextInjectionFactory.invoke(contribution,
+ AboutToShow.class, parentContext, dynamicMenuContext,
+ this) == this) {
+ if (logger != null) {
+ logger.error("Missing @AboutToShow method in " + contribution); //$NON-NLS-1$
+ }
+ continue;
+ }
// remove existing entries for this dynamic contribution item if
// there are any