Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-02-21 02:12:52 -0500
committerTobias Schwarz2014-02-21 02:12:52 -0500
commitee6785f2900d2d932c8020f9bf4281d709df7e9b (patch)
treedc734cda2f0bf1b542eba38e64a0321dde449ad6
parent716265bd99db69465c4b520e38907df818292816 (diff)
downloadorg.eclipse.tcf-ee6785f2900d2d932c8020f9bf4281d709df7e9b.tar.gz
org.eclipse.tcf-ee6785f2900d2d932c8020f9bf4281d709df7e9b.tar.xz
org.eclipse.tcf-ee6785f2900d2d932c8020f9bf4281d709df7e9b.zip
Target Explorer: fix missing adapter
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java12
2 files changed, 14 insertions, 1 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java
index 7e9e27264..0f9db2070 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/nodes/ProcessContextNode.java
@@ -18,6 +18,7 @@ import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.IProcesses;
import org.eclipse.tcf.services.ISysMonitor;
import org.eclipse.tcf.services.ISysMonitor.SysMonitorContext;
+import org.eclipse.tcf.te.core.interfaces.IConnectable;
import org.eclipse.tcf.te.core.interfaces.IFilterable;
import org.eclipse.tcf.te.runtime.model.ContainerModelNode;
import org.eclipse.tcf.te.runtime.model.contexts.AsyncRefreshableCtxAdapter;
@@ -228,7 +229,7 @@ public class ProcessContextNode extends ContainerModelNode implements IProcessCo
IModel model = getParent(IModel.class);
if (model instanceof IPeerNodeProvider) return model;
}
- if (IPeerNode.class.isAssignableFrom(adapter)) {
+ if (IPeerNode.class.isAssignableFrom(adapter) || IConnectable.class.isAssignableFrom(adapter)) {
IModel model = getParent(IModel.class);
if (model instanceof IPeerNodeProvider) return ((IPeerNodeProvider)model).getPeerNode();
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java
index 54eb6b26a..8ef38550f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java
@@ -11,10 +11,12 @@ package org.eclipse.tcf.te.tcf.processes.core.model.runtime;
import java.util.Timer;
import java.util.TimerTask;
+import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.core.interfaces.IConnectable;
import org.eclipse.tcf.te.core.interfaces.IFilterable;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.model.ContainerModelNode;
@@ -165,6 +167,16 @@ public final class RuntimeModel extends ContainerModelNode implements IRuntimeMo
if (IAsyncRefreshableCtx.class.equals(adapter)) {
return refreshableCtxAdapter;
}
+ if (IPeerNode.class.isAssignableFrom(adapter) || IConnectable.class.isAssignableFrom(adapter)) {
+ final AtomicReference<IPeerNode> peerNode = new AtomicReference<IPeerNode>();
+ Protocol.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ peerNode.set(getPeerNode());
+ }
+ });
+ return peerNode.get();
+ }
return super.getAdapter(adapter);
}

Back to the top