Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-03-02 01:51:09 -0500
committerUwe Stieber2012-03-02 03:57:52 -0500
commit4fee56b88f6062a5824c1f893d59fb82ff90fee7 (patch)
tree128d784b709b55152a3bf72179cb695c7dda9b3f /target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views
parent2c639f69a6745de8ffbe88ac98dbe64b00e7028b (diff)
downloadorg.eclipse.tcf-4fee56b88f6062a5824c1f893d59fb82ff90fee7.tar.gz
org.eclipse.tcf-4fee56b88f6062a5824c1f893d59fb82ff90fee7.tar.xz
org.eclipse.tcf-4fee56b88f6062a5824c1f893d59fb82ff90fee7.zip
Target Explorer: Fix Illegal Thread Access SWT Exception in ScriptPad
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java
index 396441d1d..fdba0fd28 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java
@@ -28,6 +28,7 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
import org.eclipse.tcf.te.tcf.locator.listener.ModelAdapter;
import org.eclipse.tcf.te.tcf.locator.model.Model;
import org.eclipse.tcf.te.tcf.ui.views.scriptpad.ScriptPad;
+import org.eclipse.tcf.te.ui.swt.DisplayUtil;
import org.eclipse.ui.IActionDelegate2;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
@@ -59,13 +60,18 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
public void locatorModelChanged(ILocatorModel model, IPeerModel peer, boolean added) {
// Re-evaluate the enablement
if (actionProxy != null) {
- IPeerModel[] peers = Model.getModel().getPeers();
+ final IPeerModel[] peers = Model.getModel().getPeers();
actionProxy.setEnabled(peers != null && peers.length > 0);
// If the peer is not set to the view yet, but the action get's
// enabled, than force the first peer in the list to be the selected one.
if (actionProxy.isEnabled() && view instanceof ScriptPad && ((ScriptPad)view).getPeerModel() == null) {
- ((ScriptPad)view).setPeerModel(peers[0]);
+ DisplayUtil.safeAsyncExec(new Runnable() {
+ @Override
+ public void run() {
+ ((ScriptPad)view).setPeerModel(peers[0]);
+ }
+ });
}
}
}

Back to the top