Refactored status notification from DynamicP2Installer.java to NewPluginChecker.java.
authorstechong
Thu, 16 Sep 2010 16:09:17 -0500
changeset 2034 8ca82bbe1973
parent 2033 018bd04fe39c
child 2035 42a3ddebe583
Refactored status notification from DynamicP2Installer.java to NewPluginChecker.java.
core/com.nokia.carbide.cpp.sdk.ui/META-INF/MANIFEST.MF
core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java
core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/SDKUIPlugin.java
core/com.nokia.carbide.discovery.ui/META-INF/MANIFEST.MF
core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/p2/DynamicP2Installer.java
--- a/core/com.nokia.carbide.cpp.sdk.ui/META-INF/MANIFEST.MF	Thu Sep 16 13:49:36 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/META-INF/MANIFEST.MF	Thu Sep 16 16:09:17 2010 -0500
@@ -14,7 +14,8 @@
  com.nokia.carbide.templatewizard,
  com.nokia.cpp.utils.core,
  com.nokia.cpp.utils.ui,
- com.nokia.carbide.discovery.ui;bundle-version="1.0.0"
+ com.nokia.carbide.discovery.ui;bundle-version="1.0.0",
+ com.nokia.carbide.remoteConnections;bundle-version="3.0.0"
 Bundle-ActivationPolicy: lazy
 Export-Package: com.nokia.carbide.cpp.internal.api.sdk.ui,
  com.nokia.carbide.cpp.sdk.ui.shared
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java	Thu Sep 16 13:49:36 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java	Thu Sep 16 16:09:17 2010 -0500
@@ -35,6 +35,7 @@
 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
 import com.nokia.carbide.cpp.sdk.ui.SDKUIPlugin;
 import com.nokia.carbide.internal.discovery.ui.p2.DynamicP2Installer;
+import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator;
 import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
 
 public class NewPluginChecker {
@@ -72,7 +73,8 @@
 							try {
 								IStatus status = DynamicP2Installer.install(sdk.getUniqueId(), featureDir, subMonitor);
 								if (status.isOK()) {
-									// TODO advise user??
+									RemoteConnectionsActivator.getStatusDisplay().displayStatus(
+											SDKUIPlugin.makeStatus(IStatus.INFO, "Installed features from\n" + sdk.getUniqueId(), null));
 									installed = true;
 								}
 								else if (status.getSeverity() == IStatus.CANCEL) {
--- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/SDKUIPlugin.java	Thu Sep 16 13:49:36 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/SDKUIPlugin.java	Thu Sep 16 16:09:17 2010 -0500
@@ -16,6 +16,8 @@
 */
 package com.nokia.carbide.cpp.sdk.ui;
 
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.widgets.Shell;
@@ -150,4 +152,13 @@
 		}
 		
 	}
+
+    public static IStatus makeErrorStatus(String message, Throwable t) {
+    	return makeStatus(IStatus.ERROR, message, t);
+    }
+
+    public static IStatus makeStatus(int severity, String message, Throwable t) {
+    	return new Status(severity, PLUGIN_ID, message, t);
+    }
+
 }
--- a/core/com.nokia.carbide.discovery.ui/META-INF/MANIFEST.MF	Thu Sep 16 13:49:36 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/META-INF/MANIFEST.MF	Thu Sep 16 16:09:17 2010 -0500
@@ -22,7 +22,6 @@
  org.eclipse.jface.text,
  org.eclipse.ui.editors,
  org.eclipse.ui.forms;bundle-version="3.5.0",
- com.nokia.carbide.remoteConnections;bundle-version="3.0.0",
  com.nokia.cpp.utils.ui;bundle-version="1.0.0",
  com.nokia.cpp.utils.core;bundle-version="1.0.0",
  org.eclipse.equinox.p2.touchpoint.natives;bundle-version="1.0.200"
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/p2/DynamicP2Installer.java	Thu Sep 16 13:49:36 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/p2/DynamicP2Installer.java	Thu Sep 16 16:09:17 2010 -0500
@@ -39,7 +39,6 @@
 import org.eclipse.equinox.p2.ui.ProvisioningUI;
 
 import com.nokia.carbide.discovery.ui.Activator;
-import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator;
 
 /**
  * Installer to install features from a p2 repository at a supplied URL or directory.
@@ -85,8 +84,6 @@
 		try {
 			DynamicP2Installer installer = new DynamicP2Installer(repositoryDirectory);
 			installer.doInstall(monitor);
-			RemoteConnectionsActivator.getStatusDisplay().displayStatus(
-					Activator.makeStatus(IStatus.INFO, "Installed features from " + sdkId, null));
 			return Status.OK_STATUS;
 		} catch (CoreException e) {
 			return e.getStatus();