Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-06-26 04:29:12 -0400
committerUwe Stieber2014-06-26 04:29:12 -0400
commit75fe2a076289bd294cd19eb996952d3ddbb527ac (patch)
treeb8536ca06dbc1d9c07be35f5d9c3e35d5e1e2008
parent86f21c0938e2fa89d5a9557649cfeae93710fa06 (diff)
downloadorg.eclipse.tcf-75fe2a076289bd294cd19eb996952d3ddbb527ac.tar.gz
org.eclipse.tcf-75fe2a076289bd294cd19eb996952d3ddbb527ac.tar.xz
org.eclipse.tcf-75fe2a076289bd294cd19eb996952d3ddbb527ac.zip
Target Explorer: Fire source provider change notifications synchronous if called from within the UI thread anyway
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/SourceProvider.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/SourceProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/SourceProvider.java
index fb15b7b73..a44785149 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/SourceProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/SourceProvider.java
@@ -14,6 +14,7 @@ import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.tcf.te.runtime.events.ChangeEvent;
import org.eclipse.tcf.te.runtime.events.EventManager;
import org.eclipse.tcf.te.runtime.interfaces.events.IEventListener;
@@ -109,7 +110,9 @@ public class SourceProvider extends AbstractSourceProvider implements IEventList
if (changeEvent.getSource() instanceof IDefaultContextService || changeEvent.getSource() == defaultContext) {
defaultContext = ServiceManager.getInstance().getService(IDefaultContextService.class).getDefaultContext(null);
// Fire the source changed notification within the UI thread
- if (PlatformUI.isWorkbenchRunning() && PlatformUI.getWorkbench().getDisplay() != null && !PlatformUI.getWorkbench().getDisplay().isDisposed()) {
+ if (Display.getCurrent() != null) {
+ fireSourceChanged(ISources.WORKBENCH, defaultContextSelectionName, defaultContext != null ? defaultContext : IEvaluationContext.UNDEFINED_VARIABLE);
+ } else if (PlatformUI.isWorkbenchRunning() && PlatformUI.getWorkbench().getDisplay() != null && !PlatformUI.getWorkbench().getDisplay().isDisposed()) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@SuppressWarnings("synthetic-access")
@Override

Back to the top