# HG changeset patch # User dadubrow # Date 1263397589 21600 # Node ID d4aeef4e0f16c4b76a0be8534f5d6674c39429fa # Parent c3cf3704d340e3ec3240b8155c431e9e8c9b2fd4 modify IConnectionsManager and IClientServiceSiteUI2 apis + document in relnotes diff -r c3cf3704d340 -r d4aeef4e0f16 carbidesdk/com.nokia.carbide.cpp.sdk.doc.user/html/reference/api_Change_Notes.htm --- a/carbidesdk/com.nokia.carbide.cpp.sdk.doc.user/html/reference/api_Change_Notes.htm Wed Jan 13 09:44:43 2010 -0600 +++ b/carbidesdk/com.nokia.carbide.cpp.sdk.doc.user/html/reference/api_Change_Notes.htm Wed Jan 13 09:46:29 2010 -0600 @@ -104,7 +104,12 @@

Since Carbide 3.0.0

diff -r c3cf3704d340 -r d4aeef4e0f16 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IClientServiceSiteUI2.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IClientServiceSiteUI2.java Wed Jan 13 09:44:43 2010 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IClientServiceSiteUI2.java Wed Jan 13 09:46:29 2010 -0600 @@ -65,13 +65,6 @@ String getSelectedConnection(); /** - * Get the display name of the selected connection id - * @param connection the connection id - * @return String, never null - */ - String getConnectionDisplayName(String connection); - - /** * Adds a listener to the client site UI * @param listener IListener */ diff -r c3cf3704d340 -r d4aeef4e0f16 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionsManager.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionsManager.java Wed Jan 13 09:44:43 2010 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionsManager.java Wed Jan 13 09:46:29 2010 -0600 @@ -194,6 +194,16 @@ IConnection ensureConnection(String connectionId, IService service) throws CoreException; /** + * Returns a connection from an id (including the default connection id) or null if none found. + * @param connectionId String + * @param service IService + * @return IConnection + * @throws CoreException + * @since 3.0 + */ + IConnection findConnection(String connectionId); + + /** * Sets a dynamic connection as disconnected. Is no-op on user generated connections. * If a dynamic connection is disconnected, it is transitioned to a disconnected state while it * is in use by some client service, and is eventually removed from the system once it is diff -r c3cf3704d340 -r d4aeef4e0f16 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java Wed Jan 13 09:44:43 2010 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java Wed Jan 13 09:46:29 2010 -0600 @@ -329,7 +329,7 @@ private void ensureUniqueId(IConnection connection) { String id = connection.getIdentifier(); - if (id == null || id.length() == 0 || findConnectionById(id) != null) + if (id == null || id.length() == 0 || findConnection(id) != null) connection.setIdentifier(getUniqueConnectionId()); } @@ -337,9 +337,12 @@ return UUID.randomUUID().toString(); } - public IConnection findConnectionById(String id) { + public IConnection findConnection(String connectionId) { + if (DEFAULT_CONNECTION_ID.equals(connectionId)) + return getDefaultConnection(); + for (IConnection connection : connectionToConnectedServices.keySet()) { - if (connection.getIdentifier().equals(id)) { + if (connection.getIdentifier().equals(connectionId)) { return connection; } } @@ -520,12 +523,7 @@ public IConnection ensureConnection(String id, IService service) throws CoreException { Check.checkArg(service); - IConnection connection; - if (DEFAULT_CONNECTION_ID.equals(id)) { - connection = getDefaultConnection(); - } else { - connection = findConnectionById(id); - } + IConnection connection = findConnection(id); if (!isCompatibleConnection(connection, service)) { // TODO ask user to connect a device or cancel throw new CoreException( diff -r c3cf3704d340 -r d4aeef4e0f16 debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/wizard/TRKConnectionWizardPage.java --- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/wizard/TRKConnectionWizardPage.java Wed Jan 13 09:44:43 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/wizard/TRKConnectionWizardPage.java Wed Jan 13 09:46:29 2010 -0600 @@ -19,6 +19,7 @@ import com.freescale.cdt.debug.cw.core.RemoteConnectionsTRKHelper; import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; import com.nokia.carbide.remoteconnections.interfaces.IClientServiceSiteUI2; +import com.nokia.carbide.remoteconnections.interfaces.IConnection; import com.nokia.carbide.remoteconnections.interfaces.IClientServiceSiteUI2.IListener; import com.nokia.cdt.internal.debug.launch.LaunchPlugin; import com.nokia.cpp.internal.api.utils.core.Check; @@ -38,7 +39,7 @@ private final ISummaryTextItemContainer summaryTextItemContainer; private IClientServiceSiteUI2 clientSiteUI; - private String connection; + private String connectionId; public TRKConnectionWizardPage(ISummaryTextItemContainer summaryTextItemContainer) { @@ -72,17 +73,18 @@ } void updateConfiguration(ILaunchConfigurationWorkingCopy config) { - if (connection != null) { - config.setAttribute(RemoteConnectionsTRKHelper.CONNECTION_ATTRIBUTE, connection); + if (connectionId != null) { + config.setAttribute(RemoteConnectionsTRKHelper.CONNECTION_ATTRIBUTE, connectionId); } } public void setVisible(boolean visible) { super.setVisible(visible); + IConnection connection = RemoteConnectionsActivator.getConnectionsManager().findConnection(connectionId); if (!visible && connection != null) { summaryTextItemContainer.putSummaryTextItem("Connection", //$NON-NLS-1$ MessageFormat.format("{0} {1}", Messages.getString("TRKConnectionWizardPage.ConnectionSummaryLabel"), //$NON-NLS-1$ //$NON-NLS-2$ - clientSiteUI.getConnectionDisplayName(connection))); + connection.getDisplayName())); } } @@ -101,7 +103,7 @@ } } else { - connection = clientSiteUI.getSelectedConnection(); + connectionId = clientSiteUI.getSelectedConnection(); } }