aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-01-08 03:56:49 -0500
committerTobias Schwarz2014-01-08 03:56:49 -0500
commitc8549b0c682464f0062479fb188b6c115b36360d (patch)
treef846ab42b9324a8495e6ca47509258dbcbc05dd7
parent041b3a82856faf74ba6fc58324f06dca87ca92f7 (diff)
downloadorg.eclipse.tcf-te_2_0.tar.gz
org.eclipse.tcf-te_2_0.tar.xz
org.eclipse.tcf-te_2_0.zip
Target Explorer: fix auto namingte_2_0
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java
index 36d0a16a0..c8887534a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java
@@ -369,7 +369,13 @@ public class NewTargetWizardPage extends AbstractValidatingWizardPage implements
public void setupData(IPropertiesContainer data) {
if (data.containsKey(IPeer.ATTR_NAME) && peerNameControl != null) {
- peerNameControl.setEditFieldControlText(data.getStringProperty(IPeer.ATTR_NAME));
+ String name = data.getStringProperty(IPeer.ATTR_NAME);
+ int i = 1;
+ while (usedNames.contains(name.toUpperCase())) {
+ name = data.getStringProperty(IPeer.ATTR_NAME) + " (" + i + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ i++;
+ }
+ peerNameControl.setEditFieldControlText(name);
}
String transportType = data.getStringProperty(IPeer.ATTR_TRANSPORT_NAME);