Feature: pop-up a message while simulator is not installed
authorZiv Chang <ziv.chang@intel.com>
Thu, 30 Aug 2012 07:12:55 +0000 (15:12 +0800)
committerZiv Chang <ziv.chang@intel.com>
Thu, 30 Aug 2012 07:12:55 +0000 (15:12 +0800)
pop-up a message while simulator is not installed or the path is not
valid on preferences setting

12 files changed:
org.tizen.web.simulator/bin/org/tizen/web/simulator/Messages.class
org.tizen.web.simulator/bin/org/tizen/web/simulator/PreferenceInitializer.class
org.tizen.web.simulator/bin/org/tizen/web/simulator/Simulator.class
org.tizen.web.simulator/bin/org/tizen/web/simulator/launch/SimulatorApplicationDelegate.class
org.tizen.web.simulator/bin/org/tizen/web/simulator/messages.properties
org.tizen.web.simulator/bin/org/tizen/web/simulator/preferences/FieldEditorComposite.class
org.tizen.web.simulator/bin/org/tizen/web/simulator/preferences/WorkbenchPreferencePage$3.class [deleted file]
org.tizen.web.simulator/bin/org/tizen/web/simulator/preferences/WorkbenchPreferencePage.class [deleted file]
org.tizen.web.simulator/src/org/tizen/web/simulator/Messages.java
org.tizen.web.simulator/src/org/tizen/web/simulator/Simulator.java
org.tizen.web.simulator/src/org/tizen/web/simulator/messages.properties
org.tizen.web.simulator/src/org/tizen/web/simulator/preferences/WorkbenchPreferencePage.java

index 2beec30..064293c 100644 (file)
Binary files a/org.tizen.web.simulator/bin/org/tizen/web/simulator/Messages.class and b/org.tizen.web.simulator/bin/org/tizen/web/simulator/Messages.class differ
index 88a226d..9cc7d1d 100644 (file)
Binary files a/org.tizen.web.simulator/bin/org/tizen/web/simulator/PreferenceInitializer.class and b/org.tizen.web.simulator/bin/org/tizen/web/simulator/PreferenceInitializer.class differ
index bfbaf66..81e3344 100644 (file)
Binary files a/org.tizen.web.simulator/bin/org/tizen/web/simulator/Simulator.class and b/org.tizen.web.simulator/bin/org/tizen/web/simulator/Simulator.class differ
index 09b3d7e..c090eb0 100644 (file)
Binary files a/org.tizen.web.simulator/bin/org/tizen/web/simulator/launch/SimulatorApplicationDelegate.class and b/org.tizen.web.simulator/bin/org/tizen/web/simulator/launch/SimulatorApplicationDelegate.class differ
index 6f74d7b..08bbb1d 100644 (file)
@@ -5,6 +5,7 @@ msgErrFileMissing2=%s doesn't exist in the plugin.
 msgErrURLConversion=The LocationURI can not be converted to the URL.
 msgErrInvalidSimulator=The specified external simulator is invalid.
 msgErrLaunchFailed=Google Chrome could not be found (%s). \n\nPlease install Google Chrome and specify the Google Chrome program location in Window->Preferences under "Tizen SDK/Web/Simulator".
+msgErrSimulatorFailed=Tizen Web Simulator could not be found (%s). \n\nPlease install Tizen Web Simulator and specify the program location in Window->Preferences under "Tizen SDK/Web/Simulator".
 msgErrProfileWritableDirectory=Profile data location should be an existing writable directory.
 msgErrProfileLengthExceeded=Profile data location should be shorter than %d characters.
 msgPreferencePageDescription=General settings for the Tizen Web Simulator:
index 3401e4b..e7f8b58 100644 (file)
Binary files a/org.tizen.web.simulator/bin/org/tizen/web/simulator/preferences/FieldEditorComposite.class and b/org.tizen.web.simulator/bin/org/tizen/web/simulator/preferences/FieldEditorComposite.class differ
diff --git a/org.tizen.web.simulator/bin/org/tizen/web/simulator/preferences/WorkbenchPreferencePage$3.class b/org.tizen.web.simulator/bin/org/tizen/web/simulator/preferences/WorkbenchPreferencePage$3.class
deleted file mode 100644 (file)
index 18d335d..0000000
Binary files a/org.tizen.web.simulator/bin/org/tizen/web/simulator/preferences/WorkbenchPreferencePage$3.class and /dev/null differ
diff --git a/org.tizen.web.simulator/bin/org/tizen/web/simulator/preferences/WorkbenchPreferencePage.class b/org.tizen.web.simulator/bin/org/tizen/web/simulator/preferences/WorkbenchPreferencePage.class
deleted file mode 100644 (file)
index 4cb1212..0000000
Binary files a/org.tizen.web.simulator/bin/org/tizen/web/simulator/preferences/WorkbenchPreferencePage.class and /dev/null differ
index 71434a8..7d94613 100644 (file)
@@ -31,6 +31,7 @@ public class Messages extends NLS {
        public static String msgErrFileMissing2;
        public static String msgErrInvalidSimulator;
        public static String msgErrLaunchFailed;
+       public static String msgErrSimulatorFailed;
        public static String MsgErrProfileInvalid;
        public static String msgErrProfileWritableDirectory;
        public static String msgErrProfileLengthExceeded;
index fefec3a..88cedeb 100644 (file)
@@ -135,6 +135,12 @@ public class Simulator {
         commandArgs.add(simulatorURL.toString());
         commandArgs.add(userdataDir.toString());
 
+        File f = new File(store.getString(Settings.SIMULATOR_PATH));
+        if (!f.exists()) {
+            DialogUtil.openErrorDialog(getShell(), "Error", String.format(Messages.msgErrSimulatorFailed, store.getString(Settings.SIMULATOR_PATH)));
+            return null;
+        }
+
         try {
             return Runtime.getRuntime().exec(commandArgs.toArray(new String[commandArgs.size()]));
         } catch (Exception e) {
index 6f74d7b..08bbb1d 100644 (file)
@@ -5,6 +5,7 @@ msgErrFileMissing2=%s doesn't exist in the plugin.
 msgErrURLConversion=The LocationURI can not be converted to the URL.
 msgErrInvalidSimulator=The specified external simulator is invalid.
 msgErrLaunchFailed=Google Chrome could not be found (%s). \n\nPlease install Google Chrome and specify the Google Chrome program location in Window->Preferences under "Tizen SDK/Web/Simulator".
+msgErrSimulatorFailed=Tizen Web Simulator could not be found (%s). \n\nPlease install Tizen Web Simulator and specify the program location in Window->Preferences under "Tizen SDK/Web/Simulator".
 msgErrProfileWritableDirectory=Profile data location should be an existing writable directory.
 msgErrProfileLengthExceeded=Profile data location should be shorter than %d characters.
 msgPreferencePageDescription=General settings for the Tizen Web Simulator:
index eb9ce9f..c8b90a7 100644 (file)
@@ -88,10 +88,6 @@ public class WorkbenchPreferencePage extends FieldEditorPreferencePage implement
                grpSimulator.setLayoutData( new GridData(GridData.FILL_HORIZONTAL));
                grpSimulator.setLayout(new GridLayout());
                grpSimulator.setText(Messages.Simulator_Settings);
-               RadioGroupFieldEditor feUseInternal = new RadioGroupFieldEditor(Settings.USE_INTERNAL_SIMULATOR,Messages.Simulator_to_use, 1,
-                               new String[][]{ { Messages.Internal, Settings.TRUE },
-                               { Messages.User_specified, Settings.FALSE } }, new FieldEditorComposite(grpSimulator));
-               addField(feUseInternal);
                final Composite cpSimulatorDir = new FieldEditorComposite(grpSimulator);
                final FieldEditor feSimulatorDir = new FileFieldEditor(Settings.SIMULATOR_PATH, Messages.EightSpacesIndent, cpSimulatorDir);
                addField(feSimulatorDir);
@@ -99,11 +95,6 @@ public class WorkbenchPreferencePage extends FieldEditorPreferencePage implement
 
                initialize();
 
-               feUseInternal.setPropertyChangeListener( new IPropertyChangeListener () {
-                       @Override
-                       public void propertyChange(PropertyChangeEvent event) {
-                               feSimulatorDir.setEnabled(Settings.FALSE.equals(event.getNewValue()), cpSimulatorDir);
-               }});
                feSimulatorDir.setEnabled(Settings.FALSE.equals(getPreferenceStore().getString(Settings.USE_INTERNAL_SIMULATOR)), cpSimulatorDir);
 
                checkState();