# HG changeset patch # User Ed Swartz # Date 1261000133 21600 # Node ID 56780cf045d5630d3bd2f3c00ec430c9caf3cfbe # Parent d42018b25fba1b6df63f2bf7a95d429ea7eb4b00# Parent 139a9d8351fe2c492cc93af39b99fe6c691842a7 Merge commit diff -r d42018b25fba -r 56780cf045d5 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 Dec 16 15:32:46 2009 -0600 +++ b/carbidesdk/com.nokia.carbide.cpp.sdk.doc.user/html/reference/api_Change_Notes.htm Wed Dec 16 15:48:53 2009 -0600 @@ -101,6 +101,13 @@
  • Added com.nokia.carbide.cpp.sdk.core.ISDKManager#getMinimumSupportedSBSv2Version( ).
  • +

    Since Carbide 3.0.0

    + + +

    Deprecated APIs

    The following Carbide APIs have been deprecated and should not be used anymore. Please see the JavaDoc for these classes and methods for more information.

    Since Carbide 1.2.0

    diff -r d42018b25fba -r 56780cf045d5 connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/RegistryTest.java --- a/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/RegistryTest.java Wed Dec 16 15:32:46 2009 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections.tests/src/com/nokia/carbide/remoteconnections/tests/RegistryTest.java Wed Dec 16 15:48:53 2009 -0600 @@ -67,7 +67,7 @@ public void testStoreAndLoadConnections() { Registry.instance().disposeConnections(); - Collection connections = RemoteConnectionsActivator.getConnectionsManager().getConnections(); + Collection connections = Registry.instance().getConnections(); assertTrue(connections.isEmpty()); IConnectionType ct = @@ -78,18 +78,18 @@ assertNotNull(cf); IConnection connection = cf.createConnection(cf.getSettingsFromUI()); connection.setIdentifier("test 1"); - RemoteConnectionsActivator.getConnectionsManager().addConnection(connection); + Registry.instance().addConnection(connection); - connections = RemoteConnectionsActivator.getConnectionsManager().getConnections(); + connections = Registry.instance().getConnections(); assertEquals(1, connections.size()); - RemoteConnectionsActivator.getConnectionsManager().storeConnections(); + Registry.instance().storeConnections(); - RemoteConnectionsActivator.getConnectionsManager().removeConnection(connection); - connections = RemoteConnectionsActivator.getConnectionsManager().getConnections(); + Registry.instance().removeConnection(connection); + connections = Registry.instance().getConnections(); assertTrue(connections.isEmpty()); - RemoteConnectionsActivator.getConnectionsManager().loadConnections(); - connections = RemoteConnectionsActivator.getConnectionsManager().getConnections(); + Registry.instance().loadConnections(); + connections = Registry.instance().getConnections(); assertEquals(1, connections.size()); connection = connections.iterator().next(); @@ -121,19 +121,19 @@ public void displayChanged() {} }; - RemoteConnectionsActivator.getConnectionsManager().addConnectionStoreChangedListener(listener); - RemoteConnectionsActivator.getConnectionsManager().addConnection(connection); + Registry.instance().addConnectionStoreChangedListener(listener); + Registry.instance().addConnection(connection); assertTrue(listenerCalled[0]); listenerCalled[0] = false; - RemoteConnectionsActivator.getConnectionsManager().removeConnection(connection); + Registry.instance().removeConnection(connection); assertTrue(listenerCalled[0]); - RemoteConnectionsActivator.getConnectionsManager().removeConnectionStoreChangedListener(listener); + Registry.instance().removeConnectionStoreChangedListener(listener); listenerCalled[0] = false; - RemoteConnectionsActivator.getConnectionsManager().addConnection(connection); + Registry.instance().addConnection(connection); assertFalse(listenerCalled[0]); - RemoteConnectionsActivator.getConnectionsManager().removeConnection(connection); + Registry.instance().removeConnection(connection); assertFalse(listenerCalled[0]); } @@ -147,12 +147,12 @@ assertNotNull(cf); IConnection connection = cf.createConnection(cf.getSettingsFromUI()); connection.setDisplayName("foo"); - RemoteConnectionsActivator.getConnectionsManager().addConnection(connection); + Registry.instance().addConnection(connection); String id = connection.getIdentifier(); connection = cf.createConnection(cf.getSettingsFromUI()); connection.setIdentifier(id); connection.setDisplayName("foo"); - RemoteConnectionsActivator.getConnectionsManager().addConnection(connection); + Registry.instance().addConnection(connection); assertFalse(id.equals(connection.getIdentifier())); } @@ -166,11 +166,11 @@ assertNotNull(cf); IConnection connection = cf.createConnection(cf.getSettingsFromUI()); connection.setDisplayName("foo"); - RemoteConnectionsActivator.getConnectionsManager().addConnection(connection); + Registry.instance().addConnection(connection); assertEquals("foo", connection.getDisplayName()); connection = cf.createConnection(cf.getSettingsFromUI()); connection.setDisplayName("foo"); - RemoteConnectionsActivator.getConnectionsManager().addConnection(connection); + Registry.instance().addConnection(connection); assertFalse("foo".equals(connection.getIdentifier())); } diff -r d42018b25fba -r 56780cf045d5 connectivity/com.nokia.carbide.remoteConnections/plugin.xml --- a/connectivity/com.nokia.carbide.remoteConnections/plugin.xml Wed Dec 16 15:32:46 2009 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/plugin.xml Wed Dec 16 15:48:53 2009 -0600 @@ -5,6 +5,7 @@ + diff -r d42018b25fba -r 56780cf045d5 connectivity/com.nokia.carbide.remoteConnections/schema/deviceDiscoveryAgent.exsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectivity/com.nokia.carbide.remoteConnections/schema/deviceDiscoveryAgent.exsd Wed Dec 16 15:48:53 2009 -0600 @@ -0,0 +1,102 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff -r d42018b25fba -r 56780cf045d5 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionTypeProvider.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionTypeProvider.java Wed Dec 16 15:32:46 2009 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionTypeProvider.java Wed Dec 16 15:48:53 2009 -0600 @@ -27,13 +27,37 @@ */ public interface IConnectionTypeProvider { - IConnectionType getConnectionType(String identifier); + /** + * Returns IConnectionType corresponding to the id or null + * @param id String + * @return IConnectionType + */ + IConnectionType getConnectionType(String id); + /** + * Returns all the known connection types + * @return Collection + */ Collection getConnectionTypes(); + /** + * Returns a collection of IService that are supported over a connection type + * @param connectionType IConnectionType + * @return Collection + */ Collection getCompatibleServices(IConnectionType connectionType); + /** + * Returns IService corresponding to the id or null + * @param id String + * @return IService + */ IService findServiceByID(String id); + /** + * Returns a collection of connection type ids that support a service + * @param service IService + * @return Collection + */ Collection getCompatibleConnectionTypeIds(IService service); } \ No newline at end of file diff -r d42018b25fba -r 56780cf045d5 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 Dec 16 15:32:46 2009 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionsManager.java Wed Dec 16 15:48:53 2009 -0600 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -21,39 +21,173 @@ import java.util.Collection; +import org.eclipse.core.runtime.CoreException; + /** * An interface encapsulating the manager of connection objects + * @noimplement */ public interface IConnectionsManager { + /** + * Listener interface for connection manager events + * (These tend to be used internally by remote connections UI) + * @deprecated + */ public interface IConnectionsManagerListener { void connectionStoreChanged(); void displayChanged(); } + /** + * Internal method for loading connections from persisted state + * @deprecated + */ void loadConnections(); + /** + * Internal method for persisting connections + * @deprecated + */ void storeConnections(); + + /** + * Listener interface for connections which are added, removed and set as default + * @since 3.0 + */ + public interface IConnectionListener { + void connectionAdded(IConnection connection); + void connectionRemoved(IConnection connection); + void defaultConnectionSet(IConnection connection); + } + + /** + * Add a listener for internal connection manager events + * @param listener IConnectionsManagerListener + * @deprecated + */ void addConnectionStoreChangedListener(IConnectionsManagerListener listener); + /** + * Remove a listener for internal connection manager events + * @param listener IConnectionsManagerListener + * @deprecated + */ void removeConnectionStoreChangedListener(IConnectionsManagerListener listener); + /** + * Add a connection to the system + * @param connection IConnection + */ void addConnection(IConnection connection); + /** + * Remove a connection from the system + * @param connection IConnection + */ void removeConnection(IConnection connection); + /** + * Return all connections in the system + * @return Collection + */ Collection getConnections(); + /** + * Return all the connected services for a connection + * @param connection IConnection + * @return Collection + */ Collection getConnectedServices(IConnection connection); + /** + * Returns a unique id to be used for a new connection + * @return String + */ String getUniqueConnectionId(); + /** + * Returns whether some display name is in use for any existing connections + * @param name String + * @return boolean + */ boolean connectionNameInUse(String name); + /** + * Fires internal display changed event + * @deprecated + */ void updateDisplays(); + /** + * Returns the IClientServiceSiteUI for a service. Filters connection types to those that + * are supported by the service. Connection list UI as well as new and edit wizards are filtered. + * @param service IService + * @return IClientServiceSiteUI + */ IClientServiceSiteUI getClientSiteUI(IService service); + /** + * Internal method to create the connected service over a connection (for service testing) + * @param service IService + * @param connection IConnection + * @return IConnectedService + * @deprecated + */ IConnectedService createConnectedService(IService service, IConnection connection); + + /** + * Add new IConnectionListener + * @param listener IConnectionListener + * @since 3.0 + */ + void addConnectionListener(IConnectionListener listener); + + /** + * Remove IConnectionListener + * @param listener IConnectionListener + * @since 3.0 + */ + void removeConnectionListener(IConnectionListener listener); + + /** + * Sets the default connection. + * @param connection IConnection + * @since 3.0 + */ + void setDefaultConnection(IConnection connection); + + /** + * Can be called by specific service implementors (e.g., debugger) to ensure some connection + * exists and supports this service. If the connection does not exist or does not support + * the service, a CoreException may be thrown after the framework attempts to allow the user + * to correct the situation. If an IConnection is returned, it is assumed to be + * a valid connection in the system that supports the service. + * @param connectionId String + * @param service IService + * @return IConnection + * @throws CoreException + * @since 3.0 + */ + IConnection ensureConnection(String connectionId, IService service) throws CoreException; + + /** + * 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 + * no longer in use. + * @param connection IConnection + * @since 3.0 + */ + void disconnect(IConnection connection); + + /** + * Attempts to set a disconnected dynamic connection back to its in-use state. + * If the connection has not been removed from the system, and is still in-use, + * it will be restored. Returns true if successful in restoring the connection. + * @param connection IConnection + * @since 3.0 + */ + boolean reconnect(IConnection connection); } \ No newline at end of file diff -r d42018b25fba -r 56780cf045d5 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/IConnectedService2.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/IConnectedService2.java Wed Dec 16 15:48:53 2009 -0600 @@ -0,0 +1,35 @@ +/** +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.carbide.remoteconnections.internal; + +import java.util.Map; + +import com.nokia.carbide.remoteconnections.interfaces.IConnectedService; + +/** + * An extended interface to a connected service + * @since 3.0 + */ +public interface IConnectedService2 extends IConnectedService { + + /** + * Return the properties for this connected service + * @return Map + */ + Map getProperties(); +} diff -r d42018b25fba -r 56780cf045d5 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/IConnection2.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/IConnection2.java Wed Dec 16 15:48:53 2009 -0600 @@ -0,0 +1,103 @@ +/** +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.carbide.remoteconnections.internal; + +import org.eclipse.jface.resource.ImageDescriptor; + +import com.nokia.carbide.remoteconnections.interfaces.IConnection; + +/** + * An extended interface to a connection + * @since 3.0 + */ +public interface IConnection2 extends IConnection { + + /** + * Whether this connection is dynamic (managed by an automated process) + * Dynamic connections are not persisted or user editable. + * @return boolean + */ + boolean isDynamic(); + + /** + * Sets this connection's dynamic attribute. + * @see IConnection2#isDynamic() + * @param dynamic boolean + */ + void setDynamic(boolean dynamic); + + /** + * The status of a connection + */ + public interface IStatus { + enum EStatus { + READY, NOT_READY, IN_USE, IN_USE_DISCONNECTED + }; + + EStatus getEStatus(); + + String getDescription(); + } + + /** + * Gets this connection's status + * @return IStatus + */ + IStatus getStatus(); + + /** + * Sets this connection's status + * @see IConnection2#getStatus() + * @param status IStatus + */ + void setStatus(IStatus status); + + /** + * A listener for status changes + */ + public interface IStatusChangedListener { + void statusChanged(IStatus status); + } + + /** + * Adds a listener for status changes + * @param listener IStatusChangedListener + */ + void addStatusChangedListener(IStatusChangedListener listener); + + /** + * Removes a listener for status changes + * @param listener IStatusChangedListener + */ + void removeStatusChangedListener(IStatusChangedListener listener); + + /** + * An optional icon representing this connection. + * If none is set, the default icon is used. + * @return ImageDescriptor + */ + ImageDescriptor getImageDescriptor(); + + /** + * Set the image descriptor for this connection. + * @see IConnection2#getImageDescriptor() + * @param imageDescriptor + */ + void setImageDescriptor(ImageDescriptor imageDescriptor); + +} diff -r d42018b25fba -r 56780cf045d5 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/IDeviceDiscoveryAgent.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/IDeviceDiscoveryAgent.java Wed Dec 16 15:48:53 2009 -0600 @@ -0,0 +1,55 @@ +/** +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.carbide.remoteconnections.internal; + +import java.net.URL; + +import org.eclipse.core.runtime.CoreException; + +/** + * An interface to a device discovery agent + * @since 3.0 + */ +public interface IDeviceDiscoveryAgent { + + /** + * Starts agent. Once started, runs until stopped. + * @throws CoreException + */ + void start() throws CoreException; + + /** + * Stops agent. + * @throws CoreException + */ + void stop() throws CoreException; + + /** + * Returns a URL to specific information about this discovery mechanism, + * troubleshooting, etc. + * @return URL + */ + URL getInformation(); + + // In addition, there may need to be an additional API to do a deeper form of discovery for + // connection mechanisms that require pairing (like BT or Wifi). In these cases, normal discovery + // will probably be for already paired devices, however, the user will want to discover all + // potential devices from some UI in order to set up a paired device. + // A method for doing this will need to be added. + +} diff -r d42018b25fba -r 56780cf045d5 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 Dec 16 15:32:46 2009 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java Wed Dec 16 15:48:53 2009 -0600 @@ -56,6 +56,7 @@ private Map> connectionToConnectedServices; private ListenerList listeners; private List connectedServiceFactories; + private ListenerList connectionListeners; public static Registry instance() { if (instance == null) { @@ -455,4 +456,40 @@ } return null; } + + public void addConnectionListener(IConnectionListener listener) { + if (connectionListeners == null) + connectionListeners = new ListenerList(); + connectionListeners.add(listener); + } + + public void removeConnectionListener(IConnectionListener listener) { + if (connectionListeners != null) + connectionListeners.remove(listener); + } + + public void setDefaultConnection(IConnection connection, Object source) { + // TODO Auto-generated method stub + + } + + public IConnection ensureConnection(String id, IService service) throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public void setDefaultConnection(IConnection connection) { + // TODO Auto-generated method stub + + } + + public void disconnect(IConnection connection) { + // TODO Auto-generated method stub + + } + + public boolean reconnect(IConnection connection) { + // TODO Auto-generated method stub + return false; + } } \ No newline at end of file diff -r d42018b25fba -r 56780cf045d5 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 Wed Dec 16 15:32:46 2009 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java Wed Dec 16 15:48:53 2009 -0600 @@ -27,6 +27,7 @@ import com.nokia.carbide.remoteconnections.interfaces.IConnectionFactory.IValidationErrorReporter; import com.nokia.carbide.remoteconnections.interfaces.IRemoteAgentInstallerProvider.IRemoteAgentInstaller; import com.nokia.carbide.remoteconnections.interfaces.IRemoteAgentInstallerProvider.IRemoteAgentInstaller.IPackageContents; +import com.nokia.carbide.remoteconnections.internal.registry.Registry; import com.nokia.cpp.internal.api.utils.core.*; import com.nokia.cpp.internal.api.utils.ui.BrowseDialogUtils; @@ -458,7 +459,7 @@ // update services list Collection compatibleServices = - RemoteConnectionsActivator.getConnectionTypeProvider().getCompatibleServices(connectionType); + Registry.instance().getCompatibleServices(connectionType); servicesListViewer.setInput(compatibleServices); if (!compatibleServices.isEmpty()) { servicesListViewer.getList().select(0); @@ -600,7 +601,7 @@ if (newConnection || connectedService == null || !connectedService.getService().equals(service)) { disposeConnectedService(); connectedService = - RemoteConnectionsActivator.getConnectionsManager().createConnectedService(service, connection); + Registry.instance().createConnectedService(service, connection); IStructuredSelection selection = (IStructuredSelection) deviceOSComboViewer.getSelection(); Pair pair = (Pair) selection.getFirstElement(); if (pair != null) diff -r d42018b25fba -r 56780cf045d5 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionTypePage.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionTypePage.java Wed Dec 16 15:32:46 2009 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionTypePage.java Wed Dec 16 15:48:53 2009 -0600 @@ -21,6 +21,7 @@ import com.nokia.carbide.remoteconnections.Messages; import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; import com.nokia.carbide.remoteconnections.interfaces.*; +import com.nokia.carbide.remoteconnections.internal.registry.Registry; import com.nokia.cpp.internal.api.utils.core.Check; import org.eclipse.jface.viewers.*; @@ -141,7 +142,7 @@ private String getServicesString() { StringBuilder servicesString = new StringBuilder(); Collection services = - RemoteConnectionsActivator.getConnectionTypeProvider().getCompatibleServices(getConnectionType()); + Registry.instance().getCompatibleServices(getConnectionType()); if (services == null || services.isEmpty()) return ""; //$NON-NLS-1$ for (Iterator iterator = services.iterator(); iterator.hasNext();) { @@ -179,10 +180,10 @@ if (serviceToRestrict != null) { List restrictedConnectionTypes = new ArrayList(); Collection compatibleConnectionTypeIds = - RemoteConnectionsActivator.getConnectionTypeProvider().getCompatibleConnectionTypeIds(serviceToRestrict); + Registry.instance().getCompatibleConnectionTypeIds(serviceToRestrict); for (String connectionTypeId : compatibleConnectionTypeIds) { IConnectionType connectionType = - RemoteConnectionsActivator.getConnectionTypeProvider().getConnectionType(connectionTypeId); + Registry.instance().getConnectionType(connectionTypeId); if (connectionTypes.contains(connectionType)) restrictedConnectionTypes.add(connectionType); } @@ -197,10 +198,10 @@ IConnection connectionToEdit = settingsWizard.getConnectionToEdit(); IConnectionType connectionTypeToEdit = connectionToEdit != null ? connectionToEdit.getConnectionType() : null; Collection allConnectionTypes = - RemoteConnectionsActivator.getConnectionTypeProvider().getConnectionTypes(); + Registry.instance().getConnectionTypes(); Collection connectionTypes = new ArrayList(); for (IConnectionType connectionType : allConnectionTypes) { - if (!RemoteConnectionsActivator.getConnectionTypeProvider().getCompatibleServices(connectionType).isEmpty() || + if (!Registry.instance().getCompatibleServices(connectionType).isEmpty() || connectionType.equals(connectionTypeToEdit)) connectionTypes.add(connectionType); } @@ -219,7 +220,7 @@ } private boolean isNameUnique(String name) { - boolean inUse = RemoteConnectionsActivator.getConnectionsManager().connectionNameInUse(name); + boolean inUse = Registry.instance().connectionNameInUse(name); IConnection connectionToEdit = settingsWizard.getConnectionToEdit(); if (connectionToEdit != null && inUse) inUse = !name.equals(connectionToEdit.getDisplayName()); diff -r d42018b25fba -r 56780cf045d5 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/SettingsWizard.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/SettingsWizard.java Wed Dec 16 15:32:46 2009 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/SettingsWizard.java Wed Dec 16 15:48:53 2009 -0600 @@ -21,6 +21,7 @@ import com.nokia.carbide.remoteconnections.Messages; import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; import com.nokia.carbide.remoteconnections.interfaces.*; +import com.nokia.carbide.remoteconnections.internal.registry.Registry; import org.eclipse.jface.wizard.*; import org.eclipse.swt.widgets.Shell; @@ -96,23 +97,23 @@ String id = null; if (connectionToEdit != null) { id = connectionToEdit.getIdentifier(); - RemoteConnectionsActivator.getConnectionsManager().removeConnection(connectionToEdit); + Registry.instance().removeConnection(connectionToEdit); } connectionToEdit = newConnectionType.getConnectionFactory().createConnection(newSettings); if (id != null) connectionToEdit.setIdentifier(id); - RemoteConnectionsActivator.getConnectionsManager().addConnection(connectionToEdit); + Registry.instance().addConnection(connectionToEdit); } else if (newSettings != null) { connectionToEdit.updateSettings(newSettings); } if (!newName.equals(connectionToEdit.getDisplayName())) { connectionToEdit.setDisplayName(newName); - RemoteConnectionsActivator.getConnectionsManager().updateDisplays(); + Registry.instance().updateDisplays(); } enableConnectedServices(true); - RemoteConnectionsActivator.getConnectionsManager().storeConnections(); + Registry.instance().storeConnections(); return true; } @@ -123,7 +124,7 @@ } private void saveConnectedServicesEnabledState() { - Collection connectedServices = RemoteConnectionsActivator.getConnectionsManager().getConnectedServices(connectionToEdit); + Collection connectedServices = Registry.instance().getConnectedServices(connectionToEdit); if (connectedServices == null) return; if (savedEnabledStates == null) @@ -134,7 +135,7 @@ } private void enableConnectedServices(boolean enabled) { - Collection connectedServices = RemoteConnectionsActivator.getConnectionsManager().getConnectedServices(connectionToEdit); + Collection connectedServices = Registry.instance().getConnectedServices(connectionToEdit); if (connectedServices == null || savedEnabledStates == null) return; for (IConnectedService connectedService : connectedServices) { diff -r d42018b25fba -r 56780cf045d5 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/ui/ClientServiceSiteUI.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/ui/ClientServiceSiteUI.java Wed Dec 16 15:32:46 2009 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/ui/ClientServiceSiteUI.java Wed Dec 16 15:48:53 2009 -0600 @@ -21,6 +21,7 @@ import com.nokia.carbide.remoteconnections.Messages; import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; import com.nokia.carbide.remoteconnections.interfaces.*; +import com.nokia.carbide.remoteconnections.internal.registry.Registry; import com.nokia.carbide.remoteconnections.settings.ui.SettingsWizard; import com.nokia.cpp.internal.api.utils.core.Check; import com.nokia.cpp.internal.api.utils.core.ListenerList; @@ -176,7 +177,7 @@ getCompatibleConnectionTypes(); List compatibleConnections = new ArrayList(); - for (IConnection connection : RemoteConnectionsActivator.getConnectionsManager().getConnections()) { + for (IConnection connection : Registry.instance().getConnections()) { if (isCompatibleConnection(connection)) compatibleConnections.add(connection); } @@ -190,10 +191,10 @@ private void getCompatibleConnectionTypes() { compatibleConnectionTypes = new HashSet(); Collection compatibleTypeIds = - RemoteConnectionsActivator.getConnectionTypeProvider().getCompatibleConnectionTypeIds(service); + Registry.instance().getCompatibleConnectionTypeIds(service); for (String typeId : compatibleTypeIds) { compatibleConnectionTypes.add( - RemoteConnectionsActivator.getConnectionTypeProvider().getConnectionType(typeId)); + Registry.instance().getConnectionType(typeId)); } } diff -r d42018b25fba -r 56780cf045d5 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/ConnectionsView.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/ConnectionsView.java Wed Dec 16 15:32:46 2009 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/ConnectionsView.java Wed Dec 16 15:48:53 2009 -0600 @@ -25,6 +25,7 @@ import com.nokia.carbide.remoteconnections.interfaces.IConnectedService.IStatusChangedListener; import com.nokia.carbide.remoteconnections.interfaces.IConnectedService.IStatus.EStatus; import com.nokia.carbide.remoteconnections.interfaces.IConnectionsManager.IConnectionsManagerListener; +import com.nokia.carbide.remoteconnections.internal.registry.Registry; import com.nokia.carbide.remoteconnections.settings.ui.SettingsWizard; import com.nokia.cpp.internal.api.utils.core.TextUtils; @@ -100,14 +101,14 @@ removeServiceListeners(); List connectionNodes = new ArrayList(); Collection connections = - RemoteConnectionsActivator.getConnectionsManager().getConnections(); + Registry.instance().getConnections(); for (IConnection connection : connections) { // create a node for the connection TreeNode connectionNode = new TreeNode(connection); // create subnodes for the connected services List serviceNodes = new ArrayList(); Collection connectedServicesForConnection = - RemoteConnectionsActivator.getConnectionsManager().getConnectedServices(connection); + Registry.instance().getConnectedServices(connection); for (IConnectedService connectedService : connectedServicesForConnection) { final TreeNode treeNode = new TreeNode(connectedService); IStatusChangedListener statusChangedListener = new IStatusChangedListener() { @@ -169,7 +170,7 @@ connection.setDisplayName(value.toString()); viewer.refresh(true); packColumns(); - RemoteConnectionsActivator.getConnectionsManager().storeConnections(); + Registry.instance().storeConnections(); } } @@ -455,7 +456,7 @@ }); } }; - RemoteConnectionsActivator.getConnectionsManager().addConnectionStoreChangedListener(connectionStoreChangedListener); + Registry.instance().addConnectionStoreChangedListener(connectionStoreChangedListener); RemoteConnectionsActivator.setHelp(parent, ".connections_view"); //$NON-NLS-1$ } @@ -538,7 +539,7 @@ }; action.setId(NEW_ACTION); actions.add(action); - action.setEnabled(!RemoteConnectionsActivator.getConnectionTypeProvider().getConnectionTypes().isEmpty()); + action.setEnabled(!Registry.instance().getConnectionTypes().isEmpty()); action = new Action(Messages.getString("ConnectionsView.EditActionLabel"), CONNECTION_EDIT_IMGDESC) { //$NON-NLS-1$ @Override @@ -587,7 +588,7 @@ action = new Action(Messages.getString("ConnectionsView.RefreshActionLabel"), CONNECTION_REFRESH_IMGDESC) { //$NON-NLS-1$ @Override public void run() { - IConnectionsManager connectionsManager = RemoteConnectionsActivator.getConnectionsManager(); + IConnectionsManager connectionsManager = Registry.instance(); for (IConnection connection : connectionsManager.getConnections()) { Collection connectedServices = connectionsManager.getConnectedServices(connection); for (IConnectedService connectedService : connectedServices) { @@ -612,8 +613,8 @@ TreeNode node = (TreeNode) ((IStructuredSelection) selection).getFirstElement(); Object value = node.getValue(); if (value instanceof IConnection) { - RemoteConnectionsActivator.getConnectionsManager().removeConnection((IConnection) value); - RemoteConnectionsActivator.getConnectionsManager().storeConnections(); + Registry.instance().removeConnection((IConnection) value); + Registry.instance().storeConnections(); } } }; @@ -707,10 +708,10 @@ private void disableAllConnectedServices() { Collection connections = - RemoteConnectionsActivator.getConnectionsManager().getConnections(); + Registry.instance().getConnections(); for (IConnection connection : connections) { Collection connectedServicesForConnection = - RemoteConnectionsActivator.getConnectionsManager().getConnectedServices(connection); + Registry.instance().getConnectedServices(connection); for (IConnectedService connectedService : connectedServicesForConnection) { connectedService.setEnabled(false); } @@ -720,15 +721,15 @@ @Override public void dispose() { removeServiceListeners(); - RemoteConnectionsActivator.getConnectionsManager().removeConnectionStoreChangedListener(connectionStoreChangedListener); + Registry.instance().removeConnectionStoreChangedListener(connectionStoreChangedListener); disableAllConnectedServices(); isDisposed = true; super.dispose(); } private static IConnection findConnection(IConnectedService cs) { - for (IConnection connection : RemoteConnectionsActivator.getConnectionsManager().getConnections()) { - for (IConnectedService connectedService : RemoteConnectionsActivator.getConnectionsManager().getConnectedServices(connection)) { + for (IConnection connection : Registry.instance().getConnections()) { + for (IConnectedService connectedService : Registry.instance().getConnectedServices(connection)) { if (cs.equals(connectedService)) return connection; } @@ -738,7 +739,7 @@ private static IStatus getFirstInUseStatus(IConnection connection) { Collection connectedServices = - RemoteConnectionsActivator.getConnectionsManager().getConnectedServices(connection); + Registry.instance().getConnectedServices(connection); // if any service is in-use, then connection is in-use for (IConnectedService connectedService : connectedServices) { IStatus status = connectedService.getStatus(); diff -r d42018b25fba -r 56780cf045d5 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/wizard/ExportPage.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/wizard/ExportPage.java Wed Dec 16 15:32:46 2009 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/wizard/ExportPage.java Wed Dec 16 15:48:53 2009 -0600 @@ -21,6 +21,7 @@ import com.nokia.carbide.remoteconnections.Messages; import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; import com.nokia.carbide.remoteconnections.interfaces.IConnection; +import com.nokia.carbide.remoteconnections.internal.registry.Registry; import com.nokia.cpp.internal.api.utils.ui.BrowseDialogUtils; import org.eclipse.core.runtime.IPath; @@ -67,13 +68,13 @@ } } }); - viewer.setInput(RemoteConnectionsActivator.getConnectionsManager().getConnections()); + viewer.setInput(Registry.instance().getConnections()); TableColumn[] columns = viewer.getTable().getColumns(); for (TableColumn tableColumn : columns) { tableColumn.pack(); } viewer.setAllChecked(true); - connections = new ArrayList(RemoteConnectionsActivator.getConnectionsManager().getConnections()); + connections = new ArrayList(Registry.instance().getConnections()); createBrowseGroup(composite, Messages.getString("ExportPage.BrowseGroupLabel")); //$NON-NLS-1$ browseButton.addSelectionListener(new SelectionAdapter() { diff -r d42018b25fba -r 56780cf045d5 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/wizard/ImportWizard.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/wizard/ImportWizard.java Wed Dec 16 15:32:46 2009 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/wizard/ImportWizard.java Wed Dec 16 15:48:53 2009 -0600 @@ -21,6 +21,7 @@ import com.nokia.carbide.remoteconnections.Messages; import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; import com.nokia.carbide.remoteconnections.interfaces.IConnection; +import com.nokia.carbide.remoteconnections.internal.registry.Registry; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.Wizard; @@ -46,9 +47,9 @@ public boolean performFinish() { List connections = importPage.getSelectedConnections(); for (IConnection connection : connections) { - RemoteConnectionsActivator.getConnectionsManager().addConnection(connection); + Registry.instance().addConnection(connection); } - RemoteConnectionsActivator.getConnectionsManager().storeConnections(); + Registry.instance().storeConnections(); return true; } diff -r d42018b25fba -r 56780cf045d5 debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/SymbianSourceFileRemapping.java --- a/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/SymbianSourceFileRemapping.java Wed Dec 16 15:32:46 2009 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/SymbianSourceFileRemapping.java Wed Dec 16 15:48:53 2009 -0600 @@ -16,9 +16,11 @@ */ package com.nokia.cdt.debug.cw.symbian.ui.executables; +import org.eclipse.cdt.debug.core.CDebugCorePlugin; import org.eclipse.cdt.debug.core.executables.ISourceFileRemapping; import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator; import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector; +import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; @@ -35,6 +37,16 @@ public String remapSourceFile(IPath executable, String filePath) { + try { + // handle the case where the common lookup finds the file in the workspace + Object[] foundElements = CDebugCorePlugin.getDefault().getCommonSourceLookupDirector().findSourceElements(filePath); + if (foundElements.length == 1 && foundElements[0] instanceof IFile) { + IFile newLocation = (IFile) foundElements[0]; + return newLocation.getLocation().toOSString(); + } + } catch (CoreException e1) { + } + String epocRoot = ""; String[] segs = executable.segments(); for (int i = 0; i < segs.length; i++) {