Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-01-08 03:04:07 -0500
committerTobias Schwarz2014-01-08 03:04:07 -0500
commitf713485829fb168f43a97dd19225a6111fffea34 (patch)
tree0d4f713da696f993340f924dfe9301c8a6a04370
parentee4fd08e37dde4387f36c958dacf76f20f9ee739 (diff)
downloadorg.eclipse.tcf-f713485829fb168f43a97dd19225a6111fffea34.tar.gz
org.eclipse.tcf-f713485829fb168f43a97dd19225a6111fffea34.tar.xz
org.eclipse.tcf-f713485829fb168f43a97dd19225a6111fffea34.zip
Target Explorer: add transport name to property access service
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IPropertiesAccessService.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/constants/IPropertiesAccessServiceConstants.java141
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/services/PropertiesAccessService.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java4
6 files changed, 88 insertions, 69 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IPropertiesAccessService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IPropertiesAccessService.java
index 35fb8adb8..f7610540e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IPropertiesAccessService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IPropertiesAccessService.java
@@ -20,7 +20,7 @@ import java.util.Map;
public interface IPropertiesAccessService extends IService {
/**
- * Returns a unmodifiable map containing the target addresses and ports for the given context,
+ * Returns a unmodifiable map containing the target address and port for the given context,
* if it can be determined.
* <p>
* A context may return multiple target addresses and ports if the context can be reached using
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/constants/IPropertiesAccessServiceConstants.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/constants/IPropertiesAccessServiceConstants.java
index 31c35a4a2..0d597fa9d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/constants/IPropertiesAccessServiceConstants.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/constants/IPropertiesAccessServiceConstants.java
@@ -1,68 +1,73 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.services.interfaces.constants;
-
-/**
- * Defines the properties access service constants.
- */
-public interface IPropertiesAccessServiceConstants {
-
- /**
- * Target name.
- * <p>
- * The target name is not meant to be identical with the targets network name. It can
- * be the targets network name, but it can be any other string identifying the target
- * to the user as well. The name is for display only, it is not meant to be used for
- * communicating with the target.
- */
- public static String PROP_NAME = "name"; //$NON-NLS-1$
-
- /**
- * Target agent address.
- * <p>
- * <i>The value is typically the address an agent running at the target.</i>
- */
- public static String PROP_ADDRESS = "address"; //$NON-NLS-1$
-
- /**
- * Target agent port.
- * <p>
- * <i>The value is typically the port an agent running at the target.</i>
- */
- public static String PROP_PORT = "port"; //$NON-NLS-1$
-
- /**
- * Target address to be used to construct a SSH connection.
- * <p>
- * If not specified, clients should fall back to {@link PROP_ADDRESS}.
- */
- public static String PROP_SSH_ADDRESS = "ssh.address"; //$NON-NLS-1$
-
- /**
- * Target port to be used to construct a SSH connection.
- * <p>
- * If not specified, clients should assume the default "22".
- */
- public static String PROP_SSH_PORT = "ssh.port"; //$NON-NLS-1$
-
- /**
- * Target address to be used to construct a telnet connection.
- * <p>
- * If not specified, clients should fall back to {@link PROP_ADDRESS}.
- */
- public static String PROP_TELNET_ADDRESS = "telnet.address"; //$NON-NLS-1$
-
- /**
- * Target port to be used to construct a telnet connection.
- * <p>
- * If not specified, clients should assume the default "23".
- */
- public static String PROP_TELNET_PORT = "telnet.port"; //$NON-NLS-1$
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.services.interfaces.constants;
+
+/**
+ * Defines the properties access service constants.
+ */
+public interface IPropertiesAccessServiceConstants {
+
+ /**
+ * Target name.
+ * <p>
+ * The target name is not meant to be identical with the targets network name. It can
+ * be the targets network name, but it can be any other string identifying the target
+ * to the user as well. The name is for display only, it is not meant to be used for
+ * communicating with the target.
+ */
+ public static String PROP_NAME = "name"; //$NON-NLS-1$
+
+ /**
+ * Target transport name.
+ */
+ public static String PROP_TRANSPORT_NAME = "transportName"; //$NON-NLS-1$
+
+ /**
+ * Target agent address.
+ * <p>
+ * <i>The value is typically the address an agent running at the target.</i>
+ */
+ public static String PROP_ADDRESS = "address"; //$NON-NLS-1$
+
+ /**
+ * Target agent port.
+ * <p>
+ * <i>The value is typically the port an agent running at the target.</i>
+ */
+ public static String PROP_PORT = "port"; //$NON-NLS-1$
+
+ /**
+ * Target address to be used to construct a SSH connection.
+ * <p>
+ * If not specified, clients should fall back to {@link PROP_ADDRESS}.
+ */
+ public static String PROP_SSH_ADDRESS = "ssh.address"; //$NON-NLS-1$
+
+ /**
+ * Target port to be used to construct a SSH connection.
+ * <p>
+ * If not specified, clients should assume the default "22".
+ */
+ public static String PROP_SSH_PORT = "ssh.port"; //$NON-NLS-1$
+
+ /**
+ * Target address to be used to construct a telnet connection.
+ * <p>
+ * If not specified, clients should fall back to {@link PROP_ADDRESS}.
+ */
+ public static String PROP_TELNET_ADDRESS = "telnet.address"; //$NON-NLS-1$
+
+ /**
+ * Target port to be used to construct a telnet connection.
+ * <p>
+ * If not specified, clients should assume the default "23".
+ */
+ public static String PROP_TELNET_PORT = "telnet.port"; //$NON-NLS-1$
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/services/PropertiesAccessService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/services/PropertiesAccessService.java
index 9af952156..a0e664215 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/services/PropertiesAccessService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/services/PropertiesAccessService.java
@@ -60,6 +60,11 @@ public class PropertiesAccessService extends org.eclipse.tcf.te.tcf.core.model.s
if (value != null && !"".equals(value.trim())) { //$NON-NLS-1$
result.put(IPropertiesAccessServiceConstants.PROP_PORT, value);
}
+
+ value = attributes.get(IPeer.ATTR_TRANSPORT_NAME);
+ if (value != null && !"".equals(value.trim())) { //$NON-NLS-1$
+ result.put(IPropertiesAccessServiceConstants.PROP_TRANSPORT_NAME, value);
+ }
}
});
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java
index f54b7e80b..6fd46f685 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java
@@ -97,10 +97,12 @@ public class NewTargetWizard extends AbstractWizard implements INewWizard {
String peerName = attrs.get(IPropertiesAccessServiceConstants.PROP_NAME);
String peerHost = attrs.get(IPropertiesAccessServiceConstants.PROP_ADDRESS);
String peerPort = attrs.get(IPropertiesAccessServiceConstants.PROP_PORT);
+ String transport = attrs.get(IPropertiesAccessServiceConstants.PROP_TRANSPORT_NAME);
data.setProperty(IPeer.ATTR_NAME, peerName);
data.setProperty(IPeer.ATTR_IP_HOST, peerHost);
data.setProperty(IPeer.ATTR_IP_PORT, peerPort);
+ data.setProperty(IPeer.ATTR_TRANSPORT_NAME, transport);
return data;
}
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 ca703c01e..5882c4185 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
@@ -372,6 +372,9 @@ public class NewTargetWizardPage extends AbstractValidatingWizardPage implements
peerNameControl.setEditFieldControlText(data.getStringProperty(IPeer.ATTR_NAME));
}
+ if (data.containsKey(IPeer.ATTR_TRANSPORT_NAME) && transportTypeControl != null) {
+ transportTypeControl.setSelectedTransportType(data.getStringProperty(IPeer.ATTR_TRANSPORT_NAME));
+ }
IWizardConfigurationPanel panel = transportTypePanelControl != null ? transportTypePanelControl.getActiveConfigurationPanel() : null;
if (panel instanceof IDataExchangeNode) {
((IDataExchangeNode)panel).setupData(data);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java
index 9980dbc0d..4dd8aab27 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java
@@ -17,6 +17,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.ui.activator.UIPlugin;
import org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode;
+import org.eclipse.tcf.te.ui.wizards.pages.AbstractValidatingWizardPage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWizard;
@@ -93,6 +94,9 @@ public abstract class AbstractWizard extends Wizard implements IWorkbenchWizard
for (IWizardPage page : getPages()) {
if (page instanceof IDataExchangeNode) {
((IDataExchangeNode)page).setupData(data);
+ if (page instanceof AbstractValidatingWizardPage) {
+ ((AbstractValidatingWizardPage)page).validate();
+ }
}
}
}

Back to the top