debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/AttachMainTab.java
branchRCL_2_4
changeset 857 d66843399035
parent 273 c2533fd23253
--- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/AttachMainTab.java	Mon Feb 01 12:38:42 2010 -0600
+++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/AttachMainTab.java	Mon Feb 01 13:27:18 2010 -0600
@@ -18,12 +18,12 @@
 
 import com.freescale.cdt.debug.cw.core.RemoteConnectionsTRKHelper;
 import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator;
-import com.nokia.carbide.remoteconnections.interfaces.IClientServiceSiteUI;
-import com.nokia.carbide.remoteconnections.interfaces.IConnection;
-import com.nokia.carbide.remoteconnections.interfaces.IClientServiceSiteUI.IListener;
+import com.nokia.carbide.remoteconnections.interfaces.IClientServiceSiteUI2;
+import com.nokia.carbide.remoteconnections.interfaces.IClientServiceSiteUI2.IListener;
 import com.nokia.cdt.internal.debug.launch.LaunchPlugin;
 
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
 import org.eclipse.swt.SWT;
@@ -36,8 +36,8 @@
 	protected Text remoteText;
 	protected Label argsLabel;
 	protected Text argsText;
-	protected IConnection connection;
-	protected IClientServiceSiteUI clientSiteUI;
+	protected String connection;
+	protected IClientServiceSiteUI2 clientSiteUI;
 	
 	public AttachMainTab() {
 		super(DONT_CHECK_PROGRAM);
@@ -59,7 +59,7 @@
 		fProjText.setToolTipText(Messages.getString("RunModeMainTab.8")); //$NON-NLS-1$
 
 		createVerticalSpacer(comp, 1);
-		clientSiteUI = RemoteConnectionsActivator.getConnectionsManager().getClientSiteUI(LaunchPlugin.getTRKService());
+		clientSiteUI = RemoteConnectionsActivator.getConnectionsManager().getClientSiteUI2(LaunchPlugin.getTRKService());
 		clientSiteUI.createComposite(comp);
 		clientSiteUI.addListener(new IListener() {
 			public void connectionSelected() {
@@ -85,7 +85,7 @@
 	        if (!RemoteConnectionsTRKHelper.configUsesConnectionAttribute(config)) {
 	        	config = RemoteConnectionsTRKHelper.attemptUpdateLaunchConfiguration(config.getWorkingCopy());
 	        }
-			connection = RemoteConnectionsTRKHelper.getConnectionFromConfig(config);
+			connection = RemoteConnectionsTRKHelper.getConnectionIdFromConfig(config);
 		} catch (CoreException e) {
 		}
 		if (connection != null)
@@ -98,7 +98,7 @@
 	public void performApply(ILaunchConfigurationWorkingCopy config) {
 		super.performApply(config);
 		if (connection != null) {
-			config.setAttribute(RemoteConnectionsTRKHelper.CONNECTION_ATTRIBUTE, connection.getIdentifier());
+			config.setAttribute(RemoteConnectionsTRKHelper.CONNECTION_ATTRIBUTE, connection);
 		}
 	}
 
@@ -110,10 +110,11 @@
 	public boolean isValid(ILaunchConfiguration config) {
 		boolean result = super.isValid(config);
 		if (result) {
-			connection = clientSiteUI.getSelectedConnection();
-			if (connection == null) {
-				setErrorMessage(Messages.getString("AttachMainTab.NoConnectionError")); //$NON-NLS-1$
-				result = false;
+			IStatus status = clientSiteUI.getSelectionStatus();
+			if (!status.isOK()) {
+				// unfortunately, no way to display a warning here...
+				setErrorMessage(status.getMessage());
+				result = status.getSeverity() != IStatus.ERROR;
 			}
 		}
 		return result;