diff options
| author | Remy Suen | 2011-08-22 19:19:30 +0000 |
|---|---|---|
| committer | Paul Webster | 2011-08-25 14:22:06 +0000 |
| commit | e924f7428bda55887d842bdc4c79c24889b8b7ad (patch) | |
| tree | 9630f5b71b844965918b0f78aeff51de243d3041 | |
| parent | 1e6f51ebfbfd0adbab82499125af10731ab01100 (diff) | |
| download | eclipse.platform.ui-e924f7428bda55887d842bdc4c79c24889b8b7ad.tar.gz eclipse.platform.ui-e924f7428bda55887d842bdc4c79c24889b8b7ad.tar.xz eclipse.platform.ui-e924f7428bda55887d842bdc4c79c24889b8b7ad.zip | |
Bug 355118 [Compatibility] 'Git Staging' view has hijacked Ctrl+1v20110906-1038v20110825-1422
Handler activations done through a part's handler service should only
be active when that part is active. Otherwise, its handlers will leak
up to the workbench window and be found during lookups even if it is
not applicable for the currently active part.
2 files changed, 8 insertions, 1 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSite.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSite.java index 0b751858a9b..965e682c6d5 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSite.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSite.java @@ -224,7 +224,8 @@ public abstract class PartSite implements IWorkbenchPartSite { * Initialize the local services. */ private void initializeDefaultServices() { - IHandlerService handlerService = new LegacyHandlerService(e4Context); + IHandlerService handlerService = new LegacyHandlerService(e4Context, + new ActivePartExpression(part)); e4Context.set(IHandlerService.class.getName(), handlerService); serviceLocator.registerService(IWorkbenchLocationService.class, 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 bd7fc74e0f3..b469de979ea 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 @@ -253,6 +253,12 @@ public class LegacyHandlerService implements IHandlerService { } } + public LegacyHandlerService(IEclipseContext context, Expression defaultExpression) { + eclipseContext = context; + evalContext = new ExpressionContext(eclipseContext); + this.defaultExpression = defaultExpression; + } + /* * (non-Javadoc) * |
