summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Elder2013-02-28 13:54:05 (EST)
committer Gerrit Code Review @ Eclipse.org2013-04-22 11:19:46 (EDT)
commit2002e9a0bd9fa578004cc1b762118b8fc60dbcdb (patch)
tree53c25ea894471dadc6ade530ee7f0d2028945643
parentfadbbfd26ecf538f89ebffbcda376c09f8923a28 (diff)
downloadeclipse.platform.runtime-2002e9a0bd9fa578004cc1b762118b8fc60dbcdb.zip
eclipse.platform.runtime-2002e9a0bd9fa578004cc1b762118b8fc60dbcdb.tar.gz
eclipse.platform.runtime-2002e9a0bd9fa578004cc1b762118b8fc60dbcdb.tar.bz2
Bug 394336 - File->Close menu item is disabled even when current editor is activatedI20130423-0800refs/changes/49/10749/2
Change getActive(*) to simpler process Change-Id: I44d9d9434157a9cf5472d14bdce1dbe9c120227c
-rw-r--r--bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/internal/contexts/EclipseContext.java24
1 files changed, 1 insertions, 23 deletions
diff --git a/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/internal/contexts/EclipseContext.java b/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/internal/contexts/EclipseContext.java
index f64cc11..6f56963 100644
--- a/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/internal/contexts/EclipseContext.java
+++ b/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/internal/contexts/EclipseContext.java
@@ -713,34 +713,12 @@ public class EclipseContext implements IEclipseContext {
return null;
}
- /**
- * Prefix used to distinguish active variables
- */
- static private final String ACTIVE_VARIABLE = "org.eclipse.ui.active_"; //$NON-NLS-1$
-
public <T> T getActive(Class<T> clazz) {
return clazz.cast(getActive(clazz.getName()));
}
public Object getActive(final String name) {
- final String internalName = ACTIVE_VARIABLE + name;
- if (containsKey(internalName, true)) {
- trackAccess(internalName);
- return internalGet(this, internalName, true);
- }
-
- final EclipseContext originatingContext = this;
-
- runAndTrack(new RunAndTrack() {
- public boolean changed(IEclipseContext context) {
- IEclipseContext activeContext = getActiveLeaf();
- Object result = activeContext.get(name);
- originatingContext.set(internalName, result);
- return true;
- }
- });
- trackAccess(internalName);
- return internalGet(this, internalName, true);
+ return getActiveLeaf().get(name);
}
public WeakReference<Object> trackedWeakReference(Object object) {