Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-07-28 08:05:51 -0400
committerUwe Stieber2014-07-28 08:05:51 -0400
commit1243cc83d1366cc8b230b0c456ecd029031db1fa (patch)
tree24ae32db05a98e3e6fcd22537b4bc65414ab2e9e
parent6f9b8bac254e4b2220295d10d60e105cf367931f (diff)
downloadorg.eclipse.tcf-1243cc83d1366cc8b230b0c456ecd029031db1fa.tar.gz
org.eclipse.tcf-1243cc83d1366cc8b230b0c456ecd029031db1fa.tar.xz
org.eclipse.tcf-1243cc83d1366cc8b230b0c456ecd029031db1fa.zip
CDT Remote Debug: Fix connection drop down to use connection names instead of the internal ID
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/META-INF/MANIFEST.MF29
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/controls/TCFPeerSelector.java48
2 files changed, 41 insertions, 36 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/META-INF/MANIFEST.MF
index a0cc77360..b8337a0b1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/META-INF/MANIFEST.MF
@@ -4,30 +4,31 @@ Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.tcf.te.tcf.launch.cdt;singleton:=true
Bundle-Version: 1.3.0.qualifier
Bundle-Activator: org.eclipse.tcf.te.tcf.launch.cdt.activator.Activator
-Require-Bundle: org.eclipse.cdt.launch;bundle-version="7.1.0",
+Require-Bundle: org.eclipse.cdt.core;bundle-version="5.6.0",
org.eclipse.cdt.debug.mi.core;bundle-version="7.3.0",
org.eclipse.cdt.debug.core;bundle-version="7.4.0",
- org.eclipse.cdt.core;bundle-version="5.6.0",
- org.eclipse.debug.ui;bundle-version="3.8.1",
- org.eclipse.ui;bundle-version="3.8.0",
- org.eclipse.debug.core;bundle-version="3.7.100",
- org.eclipse.core.runtime;bundle-version="3.8.0",
org.eclipse.cdt.debug.mi.ui;bundle-version="6.1.1",
org.eclipse.cdt.debug.ui;bundle-version="7.3.0",
+ org.eclipse.cdt.dsf;bundle-version="2.4.0",
org.eclipse.cdt.dsf.gdb;bundle-version="4.3.0",
org.eclipse.cdt.dsf.gdb.ui;bundle-version="2.4.0",
- org.eclipse.cdt.dsf;bundle-version="2.4.0",
+ org.eclipse.cdt.launch;bundle-version="7.1.0",
+ org.eclipse.core.runtime;bundle-version="3.8.0",
org.eclipse.core.variables;bundle-version="3.2.600",
+ org.eclipse.debug.core;bundle-version="3.7.100",
+ org.eclipse.debug.ui;bundle-version="3.8.1",
+ org.eclipse.ui;bundle-version="3.8.0",
+ org.eclipse.tcf.core;bundle-version="1.3.0",
org.eclipse.tcf.te.core;bundle-version="1.3.0",
- org.eclipse.tcf.te.tcf.locator;bundle-version="1.3.0",
- org.eclipse.tcf.te.tcf.filesystem.ui;bundle-version="1.3.0",
- org.eclipse.tcf.te.tcf.filesystem.core;bundle-version="1.3.0",
+ org.eclipse.tcf.te.runtime;bundle-version="1.3.0",
org.eclipse.tcf.te.runtime.concurrent;bundle-version="1.3.0",
- org.eclipse.tcf.core;bundle-version="1.3.0",
+ org.eclipse.tcf.te.runtime.model;bundle-version="1.3.0",
org.eclipse.tcf.te.runtime.services;bundle-version="1.3.0",
- org.eclipse.tcf.te.runtime;bundle-version="1.3.0",
- org.eclipse.tcf.te.tcf.processes.core;bundle-version="1.3.0",
- org.eclipse.tcf.te.tcf.core;bundle-version="1.3.0"
+ org.eclipse.tcf.te.tcf.core;bundle-version="1.3.0",
+ org.eclipse.tcf.te.tcf.locator;bundle-version="1.3.0",
+ org.eclipse.tcf.te.tcf.filesystem.core;bundle-version="1.3.0",
+ org.eclipse.tcf.te.tcf.filesystem.ui;bundle-version="1.3.0",
+ org.eclipse.tcf.te.tcf.processes.core;bundle-version="1.3.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %Vendor-Name
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/controls/TCFPeerSelector.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/controls/TCFPeerSelector.java
index 8931b9b68..6d8123c71 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/controls/TCFPeerSelector.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/controls/TCFPeerSelector.java
@@ -9,6 +9,8 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.launch.cdt.controls;
+import java.util.concurrent.atomic.AtomicReference;
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionListener;
@@ -17,9 +19,9 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.tcf.launch.cdt.activator.Activator;
import org.eclipse.tcf.te.tcf.launch.cdt.nls.Messages;
-import org.eclipse.tcf.te.tcf.launch.cdt.utils.TEHelper;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
import org.eclipse.tcf.te.tcf.locator.model.ModelManager;
@@ -85,8 +87,13 @@ public class TCFPeerSelector {
* Get the selected peer.
*/
public IPeerNode getPeerNode() {
- final String peerId = getPeerId();
- return TEHelper.getPeerNode(peerId);
+ if (peers != null && !combo.isDisposed()) {
+ int selectionIndex = combo.getSelectionIndex();
+ if (selectionIndex >= 0 && selectionIndex < peers.length) {
+ return peers[selectionIndex];
+ }
+ }
+ return null;
}
/**
@@ -96,31 +103,16 @@ public class TCFPeerSelector {
if (peers != null && !combo.isDisposed()) {
int selectionIndex = combo.getSelectionIndex();
if (selectionIndex >= 0 && selectionIndex < peers.length) {
- return combo.getItem(selectionIndex);
+ return peers[selectionIndex].getPeerId();
}
}
return null;
}
- public void updateSelectionFrom(IPeerNode peerNode) {
- int newSelectedIndex = -1;
- String[] peerIds = combo.getItems();
- for (int i = 0; i < peerIds.length; i++) {
- if (peerIds[i].equals(peerNode.getPeerId())) {
- newSelectedIndex = i;
- break;
- }
- }
- if (newSelectedIndex >= 0) {
- combo.select(newSelectedIndex);
- }
- }
-
public void updateSelectionFrom(String peerId) {
int newSelectedIndex = -1;
- String[] peerIds = combo.getItems();
- for (int i = 0; i < peerIds.length; i++) {
- if (peerIds[i].equals(peerId)) {
+ for (int i = 0; i < peers.length; i++) {
+ if (peers[i].getPeerId().equals(peerId)) {
newSelectedIndex = i;
break;
}
@@ -135,7 +127,19 @@ public class TCFPeerSelector {
peers = ModelManager.getPeerModel().getPeerNodes();
int newSelectedIndex = 0;
for (int i = 0; i < peers.length; i++) {
- combo.add(peers[i].getPeerId());
+ final AtomicReference<String> name = new AtomicReference<String>();
+ final int index = i;
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ name.set(peers[index].getName());
+ }
+ };
+
+ Protocol.invokeAndWait(runnable);
+
+ combo.add(name.get());
}
combo.select(newSelectedIndex);
}

Back to the top