Open preview on editor open
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / PHPEclipseBasePreferencePage.java
index 8df6345..7042c26 100644 (file)
@@ -35,6 +35,7 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
 
   StringFieldEditor localHostSFE;
   DirectoryFieldEditor documentRootDFE;
+  BooleanFieldEditor showExternalPreviewBFE;
   BooleanFieldEditor externalBrowserBFE;
   StringFieldEditor externalBrowserSFE;
   StringFieldEditor apacheStartSFE;
@@ -55,6 +56,7 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
   protected void performDefaults() {
     localHostSFE.loadDefault();
     documentRootDFE.loadDefault();
+    showExternalPreviewBFE.loadDefault();
     externalBrowserBFE.loadDefault();
     externalBrowserSFE.loadDefault();
     apacheStartSFE.loadDefault();
@@ -70,6 +72,7 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
   public boolean performOk() {
     localHostSFE.store();
     documentRootDFE.store();
+    showExternalPreviewBFE.store();
     externalBrowserBFE.store();
     externalBrowserSFE.store();
     apacheStartSFE.store();
@@ -95,7 +98,7 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
     Group webSettingsGroup = new Group(webSettingsComposite, SWT.NONE);
     webSettingsGroup.setText(PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup"));
     webSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-       webSettingsGroup.setLayout(new GridLayout());
+    webSettingsGroup.setLayout(new GridLayout());
     localHostSFE =
       new StringFieldEditor(
         IPreferenceConstants.LOCALHOST_PREF,
@@ -112,7 +115,17 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
     documentRootDFE.setPreferencePage(this);
     documentRootDFE.setPreferenceStore(getPreferenceStore());
     documentRootDFE.load();
-new Label(webSettingsGroup, SWT.NONE);
+    
+    new Label(webSettingsGroup, SWT.NONE);
+    showExternalPreviewBFE =
+      new BooleanFieldEditor(
+        IPreferenceConstants.SHOW_EXTERNAL_PREVIEW_PREF,
+        PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.showexternalpreview"),
+        webSettingsGroup);
+    showExternalPreviewBFE.setPreferencePage(this);
+    showExternalPreviewBFE.setPreferenceStore(getPreferenceStore());
+    showExternalPreviewBFE.load();
+    new Label(webSettingsGroup, SWT.NONE);
     externalBrowserBFE =
       new BooleanFieldEditor(
         IPreferenceConstants.USE_EXTERNAL_BROWSER_PREF,
@@ -121,7 +134,7 @@ new Label(webSettingsGroup, SWT.NONE);
     externalBrowserBFE.setPreferencePage(this);
     externalBrowserBFE.setPreferenceStore(getPreferenceStore());
     externalBrowserBFE.load();
-new Label(webSettingsGroup, SWT.NONE);
+    new Label(webSettingsGroup, SWT.NONE);
     externalBrowserSFE =
       new StringFieldEditor(
         IPreferenceConstants.EXTERNAL_BROWSER_PREF,
@@ -204,19 +217,24 @@ new Label(webSettingsGroup, SWT.NONE);
     chooseParser.setPreferencePage(this);
     chooseParser.setPreferenceStore(getPreferenceStore());
     chooseParser.load();
-       //create a copmposte just for the StringEditor - makes layout simpler
-       Composite externalParserCompo = new Composite(parserSettingsGroup, SWT.NONE);
-       externalParserSFE =
-                new StringFieldEditor(
-                  IPreferenceConstants.EXTERNAL_PARSER_PREF,
-                  PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.extcommand"),
-                       externalParserCompo/*parserSettingsGroup*/);
-       externalParserSFE.setPreferencePage(this);
-       externalParserSFE.setPreferenceStore(getPreferenceStore());
-       externalParserSFE.load();
-
-    parseOnSave = new BooleanFieldEditor(PHPeclipsePlugin.PHP_PARSE_ON_SAVE, 
-               PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.pos"), parserSettingsGroup);
+    //create a copmposte just for the StringEditor - makes layout simpler
+    Composite externalParserCompo = new Composite(parserSettingsGroup, SWT.NONE);
+    externalParserSFE =
+      new StringFieldEditor(
+        IPreferenceConstants.EXTERNAL_PARSER_PREF,
+        PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.extcommand"),
+        externalParserCompo
+    /*parserSettingsGroup*/
+    );
+    externalParserSFE.setPreferencePage(this);
+    externalParserSFE.setPreferenceStore(getPreferenceStore());
+    externalParserSFE.load();
+
+    parseOnSave =
+      new BooleanFieldEditor(
+        PHPeclipsePlugin.PHP_PARSE_ON_SAVE,
+        PHPPreferencesMessages.getString("PHPBasePreferencePage.parsers.pos"),
+        parserSettingsGroup);
     parseOnSave.setPreferencePage(this);
     parseOnSave.setPreferenceStore(getPreferenceStore());
     parseOnSave.load();