modify IConnectionFactory2
authordadubrow
Thu, 15 Apr 2010 15:35:10 -0500
changeset 1220 af71d0898edf
parent 1218 2c56cf4ec790
child 1221 f41fa762c65f
modify IConnectionFactory2
connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionFactory.java
connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionFactory2.java
connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java
core/com.nokia.carbide.cpp/META-INF/MANIFEST.MF
core/com.nokia.carbide.cpp/src/com/nokia/carbide/cpp/ProductPlugin.java
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionFactory.java	Thu Apr 15 13:10:13 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionFactory.java	Thu Apr 15 15:35:10 2010 -0500
@@ -37,13 +37,14 @@
 	 * @param parent Composite
 	 * @param errorReporter IValidationErrorReporter
 	 * @param initialSettings Map may be <code>null</code>
-	 * @deprecated
+	 * @deprecated use IConnectionFactory2.createEditingUI(Composite, IValidationErrorReporter, Map, com.nokia.carbide.remoteconnections.interfaces.IConnectionFactory2.ISettingsChangedListener)
 	 */
 	void createEditingUI(Composite parent, IValidationErrorReporter errorReporter, Map<String, String> initialSettings);
 
 	/**
 	 * Returns the settings from the editing UI as name value pairs
 	 * @return Map
+	 * @deprecated use IConnectionFactory2.IEditingUI.getSettings() or IConnectionFactory2.getDefaultSettings()
 	 */
 	Map<String, String> getSettingsFromUI();
 
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionFactory2.java	Thu Apr 15 13:10:13 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionFactory2.java	Thu Apr 15 15:35:10 2010 -0500
@@ -48,4 +48,5 @@
 	IEditingUI createEditingUI(Composite parent, IValidationErrorReporter errorReporter, 
 			Map<String, String> initialSettings, ISettingsChangedListener settingsListener);
 	
+	Map<String, String> getDefaultSettings();
 }
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java	Thu Apr 15 13:10:13 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/settings/ui/ConnectionSettingsPage.java	Thu Apr 15 15:35:10 2010 -0500
@@ -840,6 +840,9 @@
 	}
 	
 	public Map<String, String> getSettings() {
+		if (editingUI != null)
+			return editingUI.getSettings();
+		
 		if (connectionFactory == null) {
 			IConnection connectionToEdit = settingsWizard.getConnectionToEdit();
 			if (connectionToEdit == null || !connectionToEdit.getConnectionType().equals(getConnectionType())) {
--- a/core/com.nokia.carbide.cpp/META-INF/MANIFEST.MF	Thu Apr 15 13:10:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp/META-INF/MANIFEST.MF	Thu Apr 15 15:35:10 2010 -0500
@@ -13,7 +13,8 @@
  org.eclipse.core.resources,
  org.eclipse.core.filesystem,
  org.eclipse.ui.ide,
- org.eclipse.cdt.core
+ org.eclipse.cdt.core,
+ org.eclipse.equinox.p2.ui;bundle-version="2.0.0"
 Bundle-ActivationPolicy: lazy
 Export-Package: com.nokia.carbide.cpp,
  com.nokia.carbide.cpp.logging
--- a/core/com.nokia.carbide.cpp/src/com/nokia/carbide/cpp/ProductPlugin.java	Thu Apr 15 13:10:13 2010 -0500
+++ b/core/com.nokia.carbide.cpp/src/com/nokia/carbide/cpp/ProductPlugin.java	Thu Apr 15 15:35:10 2010 -0500
@@ -17,8 +17,10 @@
 package com.nokia.carbide.cpp;
 
 import org.eclipse.ui.plugin.*;
+import org.eclipse.equinox.p2.ui.Policy;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
 
 /**
  * The main plugin class to be used in the desktop.
@@ -28,6 +30,8 @@
 	//The shared instance.
 	private static ProductPlugin plugin;
 	
+	private ServiceRegistration policyRegistration;
+
 	/**
 	 * The constructor.
 	 */
@@ -40,12 +44,16 @@
 	 */
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
+		Policy policy = new Policy();
+		policy.setRestartPolicy(Policy.RESTART_POLICY_PROMPT);
+		policyRegistration = context.registerService(Policy.class.getName(), policy, null);
 	}
 
 	/**
 	 * This method is called when the plug-in is stopped
 	 */
 	public void stop(BundleContext context) throws Exception {
+		policyRegistration.unregister();
 		super.stop(context);
 		plugin = null;
 	}