Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-09-17 08:00:25 -0400
committerTobias Schwarz2014-09-17 08:00:25 -0400
commitb421b9d34164f2ea4fb072f8c10aded7735146d7 (patch)
tree62a20ef3b5072b67629c5aae7f914716a9e9c52e
parent3c571a983b7526df80c2a2937da2b5ba7456e4e7 (diff)
downloadorg.eclipse.tcf-b421b9d34164f2ea4fb072f8c10aded7735146d7.tar.gz
org.eclipse.tcf-b421b9d34164f2ea4fb072f8c10aded7735146d7.tar.xz
org.eclipse.tcf-b421b9d34164f2ea4fb072f8c10aded7735146d7.zip
Target Explorer: fix use data from selected peer node for new connection
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewWizard.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/wizards/NewWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewWizard.java
index e5f31b8b5..043ac42ad 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewWizard.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewWizard.java
@@ -93,6 +93,7 @@ public class NewWizard extends AbstractNewConfigWizard {
IStructuredSelection selection = getSelection();
if (selection != null) {
final IPeer peer;
+ boolean isPeerNode = false;
if (selection.getFirstElement() instanceof IPeer) {
peer = (IPeer)selection.getFirstElement();
}
@@ -100,6 +101,7 @@ public class NewWizard extends AbstractNewConfigWizard {
peer = ((ILocatorNode)selection.getFirstElement()).getPeer();
}
else if (selection.getFirstElement() instanceof IPeerNode) {
+ isPeerNode = true;
peer = ((IPeerNode)selection.getFirstElement()).getPeer();
}
else {
@@ -109,12 +111,13 @@ public class NewWizard extends AbstractNewConfigWizard {
if (peer != null) {
String selPeerType = peer.getAttributes().get(IPeerNodeProperties.PROP_TYPE);
final boolean sameType = getPeerType() == null ? selPeerType == null : getPeerType().equals(selPeerType);
+ final boolean finIsPeerNode = isPeerNode;
final IPropertiesContainer data = new PropertiesContainer();
Protocol.invokeAndWait(new Runnable() {
@Override
public void run() {
for (Entry<String, String> attribute : peer.getAttributes().entrySet()) {
- if (sameType || isAllowedForeignAttribute(attribute.getKey())) {
+ if (sameType || (!finIsPeerNode && isAllowedForeignAttribute(attribute.getKey()))) {
data.setProperty(attribute.getKey(), attribute.getValue());
}
}

Back to the top