core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/NewPluginChecker.java
changeset 883 260ef22f2f0d
parent 871 009f5d356768
child 1434 79471fd1fd69
equal deleted inserted replaced
879:7b2f792564dc 883:260ef22f2f0d
    15 *
    15 *
    16 */
    16 */
    17 package com.nokia.carbide.cpp.internal.sdk.ui;
    17 package com.nokia.carbide.cpp.internal.sdk.ui;
    18 
    18 
    19 import com.nokia.carbide.cpp.internal.sdk.core.model.DynamicFeatureInstaller;
    19 import com.nokia.carbide.cpp.internal.sdk.core.model.DynamicFeatureInstaller;
    20 import com.nokia.carbide.cpp.internal.sdk.core.model.InstallationFailureException;
       
    21 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
    20 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
    22 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
    21 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
    23 import com.nokia.carbide.cpp.sdk.ui.SDKUIPlugin;
    22 import com.nokia.carbide.cpp.sdk.ui.SDKUIPlugin;
    24 import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
    23 import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
    25 
    24 
    29 import org.eclipse.swt.widgets.Shell;
    28 import org.eclipse.swt.widgets.Shell;
    30 import org.eclipse.ui.IWorkbench;
    29 import org.eclipse.ui.IWorkbench;
    31 import org.eclipse.ui.IWorkbenchWindow;
    30 import org.eclipse.ui.IWorkbenchWindow;
    32 
    31 
    33 import java.io.File;
    32 import java.io.File;
    34 import java.io.FileNotFoundException;
       
    35 import java.net.MalformedURLException;
       
    36 import java.util.List;
    33 import java.util.List;
    37 
    34 
    38 @SuppressWarnings("restriction")
    35 @SuppressWarnings("restriction")
    39 public class NewPluginChecker {
    36 public class NewPluginChecker {
    40 
    37 
    41 	private static final String SDK_FEATURE_SUBDIR = "epoc32/kit/feature";  //$NON-NLS-1$
    38 	private static final String SDK_FEATURE_SUBDIR = "epoc32/kit";  //$NON-NLS-1$
    42 	
    39 	
    43 	public static void checkForNewlyInstalledPlugins(final IWorkbench workbench){
    40 	public static void checkForNewlyInstalledPlugins(final IWorkbench workbench){
    44 		
    41 		
    45 		if (WorkbenchUtils.isJUnitRunning()){
    42 		if (WorkbenchUtils.isJUnitRunning()){
    46 			return;
    43 			return;
    57 					if (sdk.isPreviouslyScanned() == false) {
    54 					if (sdk.isPreviouslyScanned() == false) {
    58 						oneSDKWasScanned = true;
    55 						oneSDKWasScanned = true;
    59 						// XML was parsed, now try to run the feature installer
    56 						// XML was parsed, now try to run the feature installer
    60 						sdk.setPreviouslyScanned(true);
    57 						sdk.setPreviouslyScanned(true);
    61 						File featureDir = new File(sdk.getEPOCROOT() + SDK_FEATURE_SUBDIR);
    58 						File featureDir = new File(sdk.getEPOCROOT() + SDK_FEATURE_SUBDIR);
    62 						if (featureDir.exists()) {
    59 						try {
    63 							try {
    60 							DynamicFeatureInstaller installer = new DynamicFeatureInstaller(featureDir, null);
    64 								DynamicFeatureInstaller installer = new DynamicFeatureInstaller(featureDir, null);
    61 							if (installer.install()) {
    65 								if (installer.install()) {
    62 								installed = true;
    66 									installed = true;
       
    67 								}
       
    68 		// Boog 8383: We should fail silently, since this will not break anything and may SDKs will not have any documentation
       
    69 		// Otherwise, these errors will be logged every time this check is done (workspace is opened)
       
    70 		// Originally, this was used to install MBS build support, but now is only used for SDK documentation
       
    71 							} catch (MalformedURLException e) {
       
    72 		//						ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.PLUGIN_ID, IStatus.ERROR, "Unable to install plug-ins dynamically.", e));
       
    73 							} catch (FileNotFoundException e) {
       
    74 		//						ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.PLUGIN_ID, IStatus.ERROR, "Unable to install plug-ins dynamically.", e));
       
    75 							} catch (InstallationFailureException e) {
       
    76 		//						ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.PLUGIN_ID, IStatus.ERROR, "Unable to install plug-ins dynamically.", e));
       
    77 							}
    63 							}
       
    64 						} catch (Exception e) {
       
    65 							// Boog 8383: We should fail silently, since this will not break anything and may SDKs will not have any documentation
       
    66 							// Otherwise, these errors will be logged every time this check is done (workspace is opened)
       
    67 							// Originally, this was used to install MBS build support, but now is only used for SDK documentation
       
    68 	//						ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.PLUGIN_ID, IStatus.ERROR, "Unable to install plug-ins dynamically.", e));
    78 						}
    69 						}
    79 					}
    70 					}
    80 					
    71 					
    81 				}
    72 				}
    82 				
    73