summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorRemy Suen2011-08-22 15:19:30 (EDT)
committer Paul Webster2011-08-25 10:22:06 (EDT)
commite924f7428bda55887d842bdc4c79c24889b8b7ad (patch)
tree9630f5b71b844965918b0f78aeff51de243d3041
parent1e6f51ebfbfd0adbab82499125af10731ab01100 (diff)
downloadeclipse.platform.ui-e924f7428bda55887d842bdc4c79c24889b8b7ad.zip
eclipse.platform.ui-e924f7428bda55887d842bdc4c79c24889b8b7ad.tar.gz
eclipse.platform.ui-e924f7428bda55887d842bdc4c79c24889b8b7ad.tar.bz2
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.
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSite.java3
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java6
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 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 @@ 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 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 class LegacyHandlerService implements IHandlerService {
}
}
+ public LegacyHandlerService(IEclipseContext context, Expression defaultExpression) {
+ eclipseContext = context;
+ evalContext = new ExpressionContext(eclipseContext);
+ this.defaultExpression = defaultExpression;
+ }
+
/*
* (non-Javadoc)
*