commit | e924f7428bda55887d842bdc4c79c24889b8b7ad | [log] [tgz] |
---|---|---|
author | Remy Suen <remysuen@ca.ibm.com> | Mon Aug 22 15:19:30 2011 -0400 |
committer | Paul Webster <pwebster@ca.ibm.com> | Thu Aug 25 10:22:06 2011 -0400 |
tree | 9630f5b71b844965918b0f78aeff51de243d3041 | |
parent | 1e6f51ebfbfd0adbab82499125af10731ab01100 [diff] |
Bug 355118 [Compatibility] 'Git Staging' view has hijacked Ctrl+1 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.
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 0b75185..965e682 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 @@ * 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 bd7fc74..b469de9 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 LegacyHandlerService(IEclipseContext context, Expression defaultExpression) { + eclipseContext = context; + evalContext = new ExpressionContext(eclipseContext); + this.defaultExpression = defaultExpression; + } + /* * (non-Javadoc) *