diff options
author | Oleg Besedin | 2012-02-17 20:55:46 +0000 |
---|---|---|
committer | Oleg Besedin | 2012-02-21 20:41:25 +0000 |
commit | 760921ca36e9d294fd683fbe163d1e1e0203e8bb (patch) | |
tree | f93fc77c06711e2afce7657016e026202d5682d5 | |
parent | 119fb61ab795dac12087f3c035a856079e282fe4 (diff) | |
download | eclipse.platform.ui-760921ca36e9d294fd683fbe163d1e1e0203e8bb.tar.gz eclipse.platform.ui-760921ca36e9d294fd683fbe163d1e1e0203e8bb.tar.xz eclipse.platform.ui-760921ca36e9d294fd683fbe163d1e1e0203e8bb.zip |
Bug 347140 - [Compatibility] opening the XML editor in I20110524-2200
causes it to hang
-rw-r--r-- | bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextService.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextService.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextService.java index a700fdefa3c..8fb2badcbc4 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextService.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/contexts/ContextService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -121,18 +121,21 @@ public final class ContextService implements IContextService { } ExpressionContext ctx = new ExpressionContext(eclipseContext.getActiveLeaf()); try { - final boolean shouldActivate = expression.evaluate(ctx) != EvaluationResult.FALSE; - synchService.asyncExec(new Runnable() { - public void run() { - if (updating) { - if (shouldActivate) { + if (updating) { + if (expression.evaluate(ctx) != EvaluationResult.FALSE) { + runExternalCode(new Runnable() { + public void run() { contextService.activateContext(contextId); - } else { + } + }); + } else { + runExternalCode(new Runnable() { + public void run() { contextService.deactivateContext(contextId); } - } + }); } - }); + } } catch (CoreException e) { // contextService.deactivateContext(contextId); WorkbenchPlugin.log("Failed to update " + contextId, e); //$NON-NLS-1$ |