Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-08-12 03:08:06 -0400
committerUwe Stieber2014-08-12 03:08:06 -0400
commit4c5a11fffa9cbfc5476124997884385635ee23a5 (patch)
treef8dbd953d38603d234b5946441bd3c6002a4d475
parent8e2bc4affcde4d71b9edf191fe329532da9c58b7 (diff)
downloadorg.eclipse.tcf-4c5a11fffa9cbfc5476124997884385635ee23a5.tar.gz
org.eclipse.tcf-4c5a11fffa9cbfc5476124997884385635ee23a5.tar.xz
org.eclipse.tcf-4c5a11fffa9cbfc5476124997884385635ee23a5.zip
TCF Launch: Add hook to customize the peer name shown in the debug view
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java
index 4556787d3..dd1c04bc2 100644
--- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java
+++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/model/TCFLaunch.java
@@ -1296,6 +1296,20 @@ public class TCFLaunch extends Launch {
return peer_name;
}
+ /**
+ * Returns the name for the given peer. Overwrite to customize
+ * the peer name shown.
+ *
+ * @param peer The peer. Must not be <code>null</code>.
+ * @return The peer name. Must be never <code>null</code>.
+ */
+ protected String getPeerName(IPeer peer) {
+ assert Protocol.isDispatchThread();
+ assert peer != null;
+
+ return peer.getName();
+ }
+
public <V extends IService> V getService(Class<V> cls) {
assert Protocol.isDispatchThread();
return channel.getRemoteService(cls);
@@ -1437,13 +1451,13 @@ public class TCFLaunch extends Launch {
String id0 = redirection_path.removeFirst();
IPeer peer = Protocol.getLocator().getPeers().get(id0);
if (peer == null) throw new Exception("Cannot locate peer " + id0);
- peer_name = peer.getName();
+ peer_name = getPeerName(peer);
channel = peer.openChannel();
channel.addChannelListener(new IChannel.IChannelListener() {
public void onChannelOpened() {
try {
- peer_name = getPeer().getName();
+ peer_name = getPeerName(getPeer());
onConnected();
}
catch (Throwable x) {
@@ -1489,7 +1503,7 @@ public class TCFLaunch extends Launch {
public void onChannelOpened() {
try {
- TCFLaunch.this.peer_name = getPeer().getName();
+ TCFLaunch.this.peer_name = getPeerName(getPeer());
onConnected();
}
catch (Throwable x) {

Back to the top