aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Elder2013-10-03 13:43:55 (EDT)
committerGerrit Code Review @ Eclipse.org2013-10-07 12:53:10 (EDT)
commit3151a509be6eae7055d9c0aaba2c9ecb0b3db6e6 (patch)
tree6addf8267f7375a6495f87fea183e80b3ea3acd3
parent026eb5f7a7ff3034cfb3c426ad02ba4d4b9a83b5 (diff)
downloadeclipse.platform.ui-3151a509be6eae7055d9c0aaba2c9ecb0b3db6e6.zip
eclipse.platform.ui-3151a509be6eae7055d9c0aaba2c9ecb0b3db6e6.tar.gz
eclipse.platform.ui-3151a509be6eae7055d9c0aaba2c9ecb0b3db6e6.tar.bz2
Bug 417237: [Commands] The ExecutionEvent inrefs/changes/11/17011/2
IExecutionListener.preExecute no longer includes trigger information Let HandlerServiceImpl know which key command triggers are stored in the static context. Change-Id: I294bfac7789500674b4a017a8a4990240528039c
-rw-r--r--bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceImpl.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceImpl.java b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceImpl.java
index cc38ff1..eb8ca5d 100644
--- a/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceImpl.java
+++ b/bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceImpl.java
@@ -37,6 +37,14 @@ import org.eclipse.e4.core.services.log.Logger;
*
*/
public class HandlerServiceImpl implements EHandlerService {
+ /**
+ * The static context key under which a command 'trigger' from legacy code is stored during
+ * calls to {@link #executeHandler(ParameterizedCommand, IEclipseContext)}
+ *
+ * @see IEclipseContext
+ * @see HandlerServiceImpl#executeHandler(ParameterizedCommand, IEclipseContext)
+ */
+ private static final String SWT_TRIGGER = "org.eclipse.swt.widgets.Event"; //$NON-NLS-1$
static final String TMP_STATIC_CONTEXT = "tmp-staticContext"; //$NON-NLS-1$
public final static String H_ID = "handler::"; //$NON-NLS-1$
public final static String PARM_MAP = "parmMap::"; //$NON-NLS-1$
@@ -211,7 +219,8 @@ public class HandlerServiceImpl implements EHandlerService {
push(executionContext, staticContext);
try {
// Command cmd = command.getCommand();
- return command.executeWithChecks(null, new ExpressionContext(peek().context));
+ return command.executeWithChecks(staticContext.get(SWT_TRIGGER), new ExpressionContext(
+ peek().context));
} catch (ExecutionException e) {
staticContext.set(HANDLER_EXCEPTION, e);
} catch (NotDefinedException e) {