diff options
| author | Paul Webster | 2013-02-04 16:46:12 +0000 |
|---|---|---|
| committer | Paul Webster | 2013-02-04 16:49:03 +0000 |
| commit | 671819c88882506b6e67414c63c808c31ee5de49 (patch) | |
| tree | 70e996d6c567906fe08727f890f2ba52b3e888df | |
| parent | 5232e7b6a0fb296bad7b8f03d69e0ae7981adf8f (diff) | |
| download | eclipse.platform.ui-671819c88882506b6e67414c63c808c31ee5de49.tar.gz eclipse.platform.ui-671819c88882506b6e67414c63c808c31ee5de49.tar.xz eclipse.platform.ui-671819c88882506b6e67414c63c808c31ee5de49.zip | |
Bug 399831 - Many broken shortcuts in multi-page editorsv20130204-164903I20130205-0800I20130204-1400
The legacy handler submission must use the correct part site
for the activation core expression.
2 files changed, 13 insertions, 2 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/KeyBindingService.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/KeyBindingService.java index 12086724f00..e15a7d33500 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/KeyBindingService.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/KeyBindingService.java @@ -326,6 +326,15 @@ public final class KeyBindingService implements INestableKeyBindingService { unregisterAction(action); + IWorkbenchPartSite partSite = workbenchPartSite; + if (parent != null) { + KeyBindingService currentParent = parent; + while (currentParent != null) { + partSite = currentParent.workbenchPartSite; + currentParent = currentParent.parent; + } + } + String commandId = action.getActionDefinitionId(); if (commandId != null) { for (IAction registeredAction : actionToProxy.keySet()) { @@ -340,8 +349,7 @@ public final class KeyBindingService implements INestableKeyBindingService { IHandlerService hs = (IHandlerService) workbenchPartSite .getService(IHandlerService.class); actionToProxy.put(action, hs.activateHandler(commandId, new ActionHandler(action), - new LegacyHandlerSubmissionExpression(null, workbenchPartSite.getShell(), - workbenchPartSite))); + new LegacyHandlerSubmissionExpression(null, partSite.getShell(), partSite))); } } diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java index 98ee6bacc2e..2e2a79fd787 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java @@ -244,6 +244,9 @@ public class LegacyHandlerService implements IHandlerService { if (handlerActivations == null) { handlerActivations = new ArrayList(); } else { + if (handlerActivations.contains(eActivation)) { + return; + } handlerActivations = new ArrayList(handlerActivations); } handlerActivations.add(eActivation); |
