# HG changeset patch # User dadubrow # Date 1271434702 18000 # Node ID a21830a6413e4a736f73deb38d0f9a7b65e3c5b0 # Parent 2304d196347009784470e2ebeb95509a9e4428eb# Parent a546534a48defb4720ea6e40861b0e14ca2a3649 merge diff -r a546534a48de -r a21830a6413e connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionFactory.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionFactory.java Fri Apr 16 09:51:37 2010 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionFactory.java Fri Apr 16 11:18:22 2010 -0500 @@ -37,14 +37,12 @@ * @param parent Composite * @param errorReporter IValidationErrorReporter * @param initialSettings Map may be null - * @deprecated use IConnectionFactory2.createEditingUI(Composite, IValidationErrorReporter, Map, com.nokia.carbide.remoteconnections.interfaces.IConnectionFactory2.ISettingsChangedListener) */ void createEditingUI(Composite parent, IValidationErrorReporter errorReporter, Map initialSettings); /** * Returns the settings from the editing UI as name value pairs * @return Map - * @deprecated use IConnectionFactory2.IEditingUI.getSettings() or IConnectionFactory2.getDefaultSettings() */ Map getSettingsFromUI(); diff -r a546534a48de -r a21830a6413e connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionFactory2.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionFactory2.java Fri Apr 16 09:51:37 2010 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionFactory2.java Fri Apr 16 11:18:22 2010 -0500 @@ -32,10 +32,6 @@ void settingsChanged(); } - public interface IEditingUI { - Map getSettings(); - } - /** * Creates a composite with UI for editing settings, optionally initialized with initialSettings.
* Can provide optional errorReporter and optional listener. Assumes parent has GridLayout @@ -43,10 +39,7 @@ * @param errorReporter IValidationErrorReporter * @param initialSettings Map may be null * @param settingsListener ISettingsChangedListener - * @return IEditingUI */ - IEditingUI createEditingUI(Composite parent, IValidationErrorReporter errorReporter, + void createEditingUI(Composite parent, IValidationErrorReporter errorReporter, Map initialSettings, ISettingsChangedListener settingsListener); - - Map getDefaultSettings(); } diff -r a546534a48de -r a21830a6413e 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 Fri Apr 16 09:51:37 2010 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java Fri Apr 16 11:18:22 2010 -0500 @@ -240,7 +240,7 @@ } fireConnectionStoreChanged(); } - catch (Exception e) { + catch (Throwable e) { RemoteConnectionsActivator.log(Messages.getString("Registry.ConnectionLoadError"), e); //$NON-NLS-1$ } diff -r a546534a48de -r a21830a6413e connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java Fri Apr 16 09:51:37 2010 -0500 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java Fri Apr 16 11:18:22 2010 -0500 @@ -100,7 +100,6 @@ import com.nokia.carbide.remoteconnections.interfaces.IConnectedService.IStatusChangedListener; import com.nokia.carbide.remoteconnections.interfaces.IConnectedService.IStatus.EStatus; import com.nokia.carbide.remoteconnections.interfaces.IConnectionFactory.IValidationErrorReporter; -import com.nokia.carbide.remoteconnections.interfaces.IConnectionFactory2.IEditingUI; import com.nokia.carbide.remoteconnections.interfaces.IConnectionFactory2.ISettingsChangedListener; import com.nokia.carbide.remoteconnections.interfaces.IRemoteAgentInstallerProvider.IRemoteAgentInstaller; import com.nokia.carbide.remoteconnections.interfaces.IRemoteAgentInstallerProvider.IRemoteAgentInstaller.IPackageContents; @@ -158,7 +157,6 @@ private Label statusLabel; private Text statusText; private IConnectionFactory connectionFactory; - private IEditingUI editingUI; private IConnection connection; private IService service; private volatile IConnectedService connectedService; @@ -564,7 +562,6 @@ } } - @SuppressWarnings("deprecation") public void updateDynamicUI() { IConnectionType currentConnectionType = getConnectionType(); if (currentConnectionType != null && !currentConnectionType.equals(connectionType)) { @@ -598,7 +595,7 @@ } }; if (connectionFactory instanceof IConnectionFactory2) { - editingUI = ((IConnectionFactory2)connectionFactory).createEditingUI( + ((IConnectionFactory2)connectionFactory).createEditingUI( settingsGroup, errorReporter, initialSettings, this); settingsChanged(); } @@ -654,16 +651,13 @@ public void settingsChanged() { if (!modifiedName) { - if (editingUI != null) { - String preferredName = editingUI.getSettings().get(IConnectionFactory2.PREFERRED_CONNECTION_NAME); - if (preferredName != null) { - nameText.setText(getPreferredNameText(preferredName)); - modifiedName = false; - return; - } + String preferredName = connectionFactory.getSettingsFromUI().get(IConnectionFactory2.PREFERRED_CONNECTION_NAME); + if (preferredName != null) { + nameText.setText(ensureUniquePreferredName(preferredName)); } - // when editingUI or preferredName is null - nameText.setText(getInitialNameText()); + else { + nameText.setText(getInitialNameText()); + } modifiedName = false; } } @@ -776,13 +770,7 @@ @SuppressWarnings("unchecked") protected void testService() { - Map settings; - if (connectionFactory instanceof IConnectionFactory2 && editingUI != null) { - settings = editingUI.getSettings(); - } - else { - settings = connectionFactory.getSettingsFromUI(); - } + Map settings = connectionFactory.getSettingsFromUI(); boolean newConnection = connection == null || !connectionType.equals(connection.getConnectionType()); if (newConnection) { if (connection != null) @@ -840,9 +828,6 @@ } public Map getSettings() { - if (editingUI != null) - return editingUI.getSettings(); - if (connectionFactory == null) { IConnection connectionToEdit = settingsWizard.getConnectionToEdit(); if (connectionToEdit == null || !connectionToEdit.getConnectionType().equals(getConnectionType())) { @@ -1093,7 +1078,7 @@ } } - private String getPreferredNameText(String preferredName) { + private String ensureUniquePreferredName(String preferredName) { if (isNameUnique(preferredName)) { return preferredName; }