[Title]update sdblib and add checking sdb file
authorhyunsik.noh <hyunsik.noh@samsung.com>
Thu, 16 Aug 2012 08:50:12 +0000 (17:50 +0900)
committerhyunsik.noh <hyunsik.noh@samsung.com>
Thu, 16 Aug 2012 08:50:12 +0000 (17:50 +0900)
[Type]enhancement
[Module]common
[Priority]normal
[CQ#]
[Redmine#]6380

Change-Id: I081ea74cf788841cd7c6a88df7f0acae6fcac2ed

org.tizen.common/lib/sdblib.jar
org.tizen.common/src/org/tizen/common/CommonPlugin.java

index b77db51..692b644 100644 (file)
Binary files a/org.tizen.common/lib/sdblib.jar and b/org.tizen.common/lib/sdblib.jar differ
index 26df307..736d1d7 100644 (file)
@@ -74,13 +74,19 @@ public class CommonPlugin extends AbstractUIPlugin {
         super.start( context );
         plugin = this;
         initializeExecutor();
+
         String sdbPath = InstallPathConfig.getSDBPath();
-        try {
-            SmartDevelopmentBridge.init();
-            SmartDevelopmentBridge.createBridge(sdbPath, true);
-        } catch (Throwable t) {
-            Logger.error("Problem occurred while initializing sdb", t.getMessage(), t);
-            DialogUtil.openErrorDialog("Failed to start sdb");
+        if (!HostUtil.exists(sdbPath)) {
+            DialogUtil.openMessageDialog("There is no " + sdbPath + ".");
+        }
+        else {
+            try {
+                SmartDevelopmentBridge.init();
+                SmartDevelopmentBridge.createBridge(sdbPath, true);
+            } catch (Throwable t) {
+                Logger.error("Problem occurred while initializing sdb", t.getMessage(), t);
+                DialogUtil.openErrorDialog("Failed to start sdb");
+            }
         }
 
         if (OSChecker.isWindows()) {
@@ -89,24 +95,23 @@ public class CommonPlugin extends AbstractUIPlugin {
                 DialogUtil.openMessageDialog("There is no " + dllPath + ".\n" +
                         "It's not mandatory but you may have problem in using sdb through USB.");
         }
-
     }
 
-       /*
+    /*
      * (non-Javadoc)
      * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
      */
     @Override
     public void stop(BundleContext context) throws Exception {
-       finalizeExecutor();
+        finalizeExecutor();
         plugin = null;
         super.stop(context);
     }
     
 
-       public static void setDefault( CommonPlugin plugin )
+    public static void setDefault( CommonPlugin plugin )
     {
-       CommonPlugin.plugin = plugin;
+        CommonPlugin.plugin = plugin;
     }
 
     /**
@@ -135,7 +140,7 @@ public class CommonPlugin extends AbstractUIPlugin {
      */
     public void setExecutor( final Executor executor )
     {
-       this.executor = executor;
+        this.executor = executor;
     }
     
     /**
@@ -144,7 +149,7 @@ public class CommonPlugin extends AbstractUIPlugin {
      */
     public Executor getExecutor()
     {
-       return this.executor;
+        return this.executor;
     }
     
     /**
@@ -154,19 +159,19 @@ public class CommonPlugin extends AbstractUIPlugin {
      */
     public Prompter getPrompter()
     {
-       return this.prompter;
+        return this.prompter;
     }
 
     protected void initializeExecutor()
     {
-       this.prompter = new EclipsePrompter( new SWTPrompter() );
-       
-       this.executor = new EclipseExecutor( prompter );
-       }
+        this.prompter = new EclipsePrompter( new SWTPrompter() );
+        
+        this.executor = new EclipseExecutor( prompter );
+    }
 
     protected void finalizeExecutor()
     {
-       
-       }
+        
+    }
 
 }