--- 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 @@
<li>Added <em> com.nokia.carbide.cpp.sdk.core.ISDKManager#getMinimumSupportedSBSv2Version( )</em>.</li>
</ul>
+<p>Since Carbide 3.0.0</p>
+<ul>
+ <li>IConnectionsManager was updated to indicate it is not intended to be implemented by clients.
+ <li>Added several new methods to support automated connection/device discovery agents.</li>
+</ul>
+
+
<h3>Deprecated APIs</h3>
<p>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.</p>
<p>Since Carbide 1.2.0</p>
--- 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<IConnection> connections = RemoteConnectionsActivator.getConnectionsManager().getConnections();
+ Collection<IConnection> 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()));
}
--- 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 @@
<extension-point id="service" name="Service" schema="schema/service.exsd"/>
<extension-point id="extensionFilter" name="Extension Filter" schema="schema/extensionFilter.exsd"/>
<extension-point id="connectedServiceFactory" name="Connected Service Factory" schema="schema/connectedServiceFactory.exsd"/>
+ <extension-point id="deviceDiscoveryAgent" name="Device Discovery Agent" schema="schema/deviceDiscoveryAgent.exsd"/>
<extension
point="org.eclipse.ui.views">
--- /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 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="com.nokia.carbide.remoteConnections" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="com.nokia.carbide.remoteConnections" id="deviceDiscoveryAgent" name="Device Discovery Agent"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="deviceDiscoveryAgent"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="deviceDiscoveryAgent">
+ <complexType>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":com.nokia.carbide.remoteconnections.internal.IDeviceDiscoveryAgent"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
--- 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<IConnectionType>
+ */
Collection<IConnectionType> getConnectionTypes();
+ /**
+ * Returns a collection of IService that are supported over a connection type
+ * @param connectionType IConnectionType
+ * @return Collection<IService>
+ */
Collection<IService> 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<String>
+ */
Collection<String> getCompatibleConnectionTypeIds(IService service);
}
\ No newline at end of file
--- 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<IConnection>
+ */
Collection<IConnection> getConnections();
+ /**
+ * Return all the connected services for a connection
+ * @param connection IConnection
+ * @return Collection<IConnectedService>
+ */
Collection<IConnectedService> 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
--- /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<String, String> getProperties();
+}
--- /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);
+
+}
--- /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.
+
+}
--- 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<IConnection, List<IConnectedService>> connectionToConnectedServices;
private ListenerList<IConnectionsManagerListener> listeners;
private List<IConnectedServiceFactory> connectedServiceFactories;
+ private ListenerList<IConnectionListener> 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<IConnectionListener>();
+ 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
--- 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<IService> 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<String, Version> pair = (Pair<String, Version>) selection.getFirstElement();
if (pair != null)
--- 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<IService> services =
- RemoteConnectionsActivator.getConnectionTypeProvider().getCompatibleServices(getConnectionType());
+ Registry.instance().getCompatibleServices(getConnectionType());
if (services == null || services.isEmpty())
return ""; //$NON-NLS-1$
for (Iterator<IService> iterator = services.iterator(); iterator.hasNext();) {
@@ -179,10 +180,10 @@
if (serviceToRestrict != null) {
List<IConnectionType> restrictedConnectionTypes = new ArrayList<IConnectionType>();
Collection<String> 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<IConnectionType> allConnectionTypes =
- RemoteConnectionsActivator.getConnectionTypeProvider().getConnectionTypes();
+ Registry.instance().getConnectionTypes();
Collection<IConnectionType> connectionTypes = new ArrayList<IConnectionType>();
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());
--- 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<IConnectedService> connectedServices = RemoteConnectionsActivator.getConnectionsManager().getConnectedServices(connectionToEdit);
+ Collection<IConnectedService> connectedServices = Registry.instance().getConnectedServices(connectionToEdit);
if (connectedServices == null)
return;
if (savedEnabledStates == null)
@@ -134,7 +135,7 @@
}
private void enableConnectedServices(boolean enabled) {
- Collection<IConnectedService> connectedServices = RemoteConnectionsActivator.getConnectionsManager().getConnectedServices(connectionToEdit);
+ Collection<IConnectedService> connectedServices = Registry.instance().getConnectedServices(connectionToEdit);
if (connectedServices == null || savedEnabledStates == null)
return;
for (IConnectedService connectedService : connectedServices) {
--- 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<IConnection> compatibleConnections = new ArrayList<IConnection>();
- 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<IConnectionType>();
Collection<String> compatibleTypeIds =
- RemoteConnectionsActivator.getConnectionTypeProvider().getCompatibleConnectionTypeIds(service);
+ Registry.instance().getCompatibleConnectionTypeIds(service);
for (String typeId : compatibleTypeIds) {
compatibleConnectionTypes.add(
- RemoteConnectionsActivator.getConnectionTypeProvider().getConnectionType(typeId));
+ Registry.instance().getConnectionType(typeId));
}
}
--- 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<TreeNode> connectionNodes = new ArrayList<TreeNode>();
Collection<IConnection> 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<TreeNode> serviceNodes = new ArrayList<TreeNode>();
Collection<IConnectedService> 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<IConnectedService> 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<IConnection> connections =
- RemoteConnectionsActivator.getConnectionsManager().getConnections();
+ Registry.instance().getConnections();
for (IConnection connection : connections) {
Collection<IConnectedService> 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<IConnectedService> 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();
--- 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<IConnection>(RemoteConnectionsActivator.getConnectionsManager().getConnections());
+ connections = new ArrayList<IConnection>(Registry.instance().getConnections());
createBrowseGroup(composite, Messages.getString("ExportPage.BrowseGroupLabel")); //$NON-NLS-1$
browseButton.addSelectionListener(new SelectionAdapter() {
--- 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<IConnection> connections = importPage.getSelectedConnections();
for (IConnection connection : connections) {
- RemoteConnectionsActivator.getConnectionsManager().addConnection(connection);
+ Registry.instance().addConnection(connection);
}
- RemoteConnectionsActivator.getConnectionsManager().storeConnections();
+ Registry.instance().storeConnections();
return true;
}
--- 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++) {