diff options
| author | Paul Elder | 2013-02-28 18:54:05 +0000 |
|---|---|---|
| committer | Gerrit Code Review @ Eclipse.org | 2013-04-22 15:19:46 +0000 |
| commit | 2002e9a0bd9fa578004cc1b762118b8fc60dbcdb (patch) | |
| tree | 53c25ea894471dadc6ade530ee7f0d2028945643 | |
| parent | fadbbfd26ecf538f89ebffbcda376c09f8923a28 (diff) | |
| download | eclipse.platform.runtime-2002e9a0bd9fa578004cc1b762118b8fc60dbcdb.tar.gz eclipse.platform.runtime-2002e9a0bd9fa578004cc1b762118b8fc60dbcdb.tar.xz eclipse.platform.runtime-2002e9a0bd9fa578004cc1b762118b8fc60dbcdb.zip | |
Bug 394336 - File->Close menu item is disabled even when current editor is activatedI20130423-0800
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.java | 24 |
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 f64cc111b..6f5696380 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) { |
