diff options
| author | Paul Webster | 2013-02-04 16:46:12 +0000 |
|---|---|---|
| committer | Paul Webster | 2013-02-04 16:46:12 +0000 |
| commit | 76dc3c2a1bb13d10c83dd74ed777fd84e67cd60b (patch) | |
| tree | fec3b4a20fcd8929d0efc6da1514de23bfbd3f77 | |
| parent | 75c25798e91a6df8238866346d9d9943aa15fb51 (diff) | |
| download | eclipse.platform.ui-76dc3c2a1bb13d10c83dd74ed777fd84e67cd60b.tar.gz eclipse.platform.ui-76dc3c2a1bb13d10c83dd74ed777fd84e67cd60b.tar.xz eclipse.platform.ui-76dc3c2a1bb13d10c83dd74ed777fd84e67cd60b.zip | |
Bug 399831 - Many broken shortcuts in multi-page editorsv20130204-164612R4_2_2M20130206-1200M20130204-1200
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); |
