[Title] Add message dialog when fail to get platformlog
authorhyunsik.noh <hyunsik.noh@samsung.com>
Mon, 10 Dec 2012 01:15:20 +0000 (10:15 +0900)
committerhyunsik.noh <hyunsik.noh@samsung.com>
Mon, 10 Dec 2012 01:15:20 +0000 (10:15 +0900)
[Type]
[Module]
[Priority]
[CQ#]
[Redmine#] 7548
[Problem]
[Cause]
[Solution]

Change-Id: I512d9b4b8c56e368c069d8a4be29a744fba783eb

org.tizen.common.connection/src/org/tizen/common/connection/ui/ConnectionExplorer.java
org.tizen.common.connection/src/org/tizen/common/connection/ui/ConnectionUIMessages.java
org.tizen.common.connection/src/org/tizen/common/connection/ui/ConnectionUIMessages.properties

index dfa98dc..d892cf1 100755 (executable)
@@ -35,6 +35,7 @@ import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.KeyAdapter;
 import org.eclipse.swt.events.KeyEvent;
@@ -450,12 +451,18 @@ public class ConnectionExplorer extends ViewPart
                         @Override
                         public void processNewLines(String[] lines)
                         {
-                            result.set(Integer.parseInt(lines[0]));
+                            if(lines[0].equals(PLATFORMLOG_ON) || lines[0].equals(PLATFORMLOG_OFF))
+                            {
+                                result.set(Integer.parseInt(lines[0]));
+                            }
+                            else
+                            {
+                                MessageDialog.openError(parent.getShell(), ConnectionUIMessages.Explorer_Message_PlatformLogError, lines[0] ); //$NON-NLS-1$
+                            }
                         }
                     });
                 } catch (IOException e) {
-                    // TODO Auto-generated catch block
-                    e.printStackTrace();
+                    Logger.error("Fail to get platform log", e.getMessage());
                 }
             }
         }
@@ -467,7 +474,7 @@ public class ConnectionExplorer extends ViewPart
         toolBar = new ToolBar(shell, SWT.NULL);
         toolBar.setLayoutData(layoutData);
 
-        new ToolItem(toolBar, SWT.SEPARATOR);   // Separator
+        new ToolItem(toolBar, SWT.SEPARATOR);// Separator
 
         emulManagerToolItem = new ToolItem(toolBar, SWT.PUSH);
         emulManagerToolItem.setImage(ConnectionPlugin.getImageDescriptorFromPlugin("icons/emulator_manager.gif").createImage());
@@ -488,7 +495,7 @@ public class ConnectionExplorer extends ViewPart
         });
         emulManagerToolItem.setEnabled(true);
 
-        new ToolItem(toolBar, SWT.SEPARATOR);   // Separator
+        new ToolItem(toolBar, SWT.SEPARATOR);// Separator
 
         pushToolItem = new ToolItem(toolBar, SWT.PUSH);
         pushToolItem.setImage(ConnectionPlugin.getImageDescriptorFromPlugin("icons/push.gif").createImage());
@@ -503,7 +510,7 @@ public class ConnectionExplorer extends ViewPart
         });
         pushToolItem.setEnabled(false);
 
-        new ToolItem(toolBar, SWT.SEPARATOR);   // Separator
+        new ToolItem(toolBar, SWT.SEPARATOR);// Separator
 
         pullToolItem = new ToolItem(toolBar, SWT.PUSH);
         pullToolItem.setImage(ConnectionPlugin.getImageDescriptorFromPlugin("icons/pull.gif").createImage());
index 60694a1..e2d1db2 100644 (file)
@@ -51,6 +51,7 @@ public class ConnectionUIMessages extends NLS
     public static String Explorer_Tooltip_Pull;
 
     public static String Explorer_Message_EmulatorError;
+    public static String Explorer_Message_PlatformLogError;
 
     static
     {
index 758de8f..b094ca2 100644 (file)
@@ -17,4 +17,5 @@ Explorer_Tooltip_Pull = Pull the content from the connected target device
 
 Explorer_Message_Invalid_Character = File contains invalid characters like 
 
-Explorer_Message_EmulatorError = Emulator is not installed or the install path is invalid.
+Explorer_Message_EmulatorErrr = Emulator is not installed or the install path is invalid.
+Explorer_Message_PlatformLogError = Fail to get platformlog