commented out PHPProjectLibraryPage
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / PHPEclipseBasePreferencePage.java
index 439b0b5..f46d66e 100644 (file)
@@ -15,9 +15,11 @@ import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 
@@ -34,13 +36,16 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
 
   StringFieldEditor localHostSFE;
   DirectoryFieldEditor documentRootDFE;
+  BooleanFieldEditor showExternalPreviewBFE;
   BooleanFieldEditor externalBrowserBFE;
   StringFieldEditor externalBrowserSFE;
   StringFieldEditor apacheStartSFE;
   StringFieldEditor apacheStopSFE;
   StringFieldEditor apacheRestartSFE;
   StringFieldEditor mySQLCommandSFE;
+  StringFieldEditor phpRunSFE;
   RadioGroupFieldEditor chooseParser;
+  StringFieldEditor externalParserSFE;
   BooleanFieldEditor parseOnSave;
 
   public PHPEclipseBasePreferencePage() {
@@ -53,13 +58,16 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
   protected void performDefaults() {
     localHostSFE.loadDefault();
     documentRootDFE.loadDefault();
+    showExternalPreviewBFE.loadDefault();
     externalBrowserBFE.loadDefault();
     externalBrowserSFE.loadDefault();
     apacheStartSFE.loadDefault();
     apacheStopSFE.loadDefault();
     apacheRestartSFE.loadDefault();
     mySQLCommandSFE.loadDefault();
+    phpRunSFE.loadDefault();
     chooseParser.loadDefault();
+    externalParserSFE.loadDefault();
     parseOnSave.loadDefault();
     super.performDefaults();
   }
@@ -67,13 +75,16 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
   public boolean performOk() {
     localHostSFE.store();
     documentRootDFE.store();
+    showExternalPreviewBFE.store();
     externalBrowserBFE.store();
     externalBrowserSFE.store();
     apacheStartSFE.store();
     apacheStopSFE.store();
     apacheRestartSFE.store();
     mySQLCommandSFE.store();
+    phpRunSFE.store();
     chooseParser.store();
+    externalParserSFE.store();
     parseOnSave.store();
     return super.performOk();
   }
@@ -88,26 +99,25 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
     Composite webSettingsComposite = new Composite(composite, SWT.NONE);
     webSettingsComposite.setLayout(new GridLayout());
     webSettingsComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+    showExternalPreviewBFE =
+      new BooleanFieldEditor(
+        IPreferenceConstants.SHOW_EXTERNAL_PREVIEW_PREF,
+        PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.showexternalpreview"),
+        webSettingsComposite);
+    showExternalPreviewBFE.setPreferencePage(this);
+    showExternalPreviewBFE.setPreferenceStore(getPreferenceStore());
+    showExternalPreviewBFE.load();
+
     Group webSettingsGroup = new Group(webSettingsComposite, SWT.NONE);
     webSettingsGroup.setText(PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup"));
-    webSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-    webSettingsGroup.setLayout(new GridLayout());
-    localHostSFE =
-      new StringFieldEditor(
-        IPreferenceConstants.LOCALHOST_PREF,
-        PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.localhost"),
-        webSettingsGroup);
-    localHostSFE.setPreferencePage(this);
-    localHostSFE.setPreferenceStore(getPreferenceStore());
-    localHostSFE.load();
-    documentRootDFE =
-      new DirectoryFieldEditor(
-        IPreferenceConstants.DOCUMENTROOT_PREF,
-        PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.docroot"),
-        webSettingsGroup);
-    documentRootDFE.setPreferencePage(this);
-    documentRootDFE.setPreferenceStore(getPreferenceStore());
-    documentRootDFE.load();
+    GridLayout gridLayout = new GridLayout();
+    //  gridLayout.numColumns = 3;
+    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+    webSettingsGroup.setLayoutData(gridData);
+    webSettingsGroup.setLayout(gridLayout);
+
+    // new Label(webSettingsGroup, SWT.NONE);
     externalBrowserBFE =
       new BooleanFieldEditor(
         IPreferenceConstants.USE_EXTERNAL_BROWSER_PREF,
@@ -116,6 +126,9 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
     externalBrowserBFE.setPreferencePage(this);
     externalBrowserBFE.setPreferenceStore(getPreferenceStore());
     externalBrowserBFE.load();
+    new Label(webSettingsGroup, SWT.NONE);
+    new Label(webSettingsGroup, SWT.NONE);
+    //  new Label(webSettingsGroup, SWT.NONE);
     externalBrowserSFE =
       new StringFieldEditor(
         IPreferenceConstants.EXTERNAL_BROWSER_PREF,
@@ -124,7 +137,26 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
     externalBrowserSFE.setPreferencePage(this);
     externalBrowserSFE.setPreferenceStore(getPreferenceStore());
     externalBrowserSFE.load();
+    new Label(webSettingsGroup, SWT.NONE);
 
+    localHostSFE =
+      new StringFieldEditor(
+        IPreferenceConstants.LOCALHOST_PREF,
+        PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.localhost"),
+        webSettingsGroup);
+    localHostSFE.setPreferencePage(this);
+    localHostSFE.setPreferenceStore(getPreferenceStore());
+    localHostSFE.load();
+    new Label(webSettingsGroup, SWT.NONE);
+
+    documentRootDFE =
+      new DirectoryFieldEditor(
+        IPreferenceConstants.DOCUMENTROOT_PREF,
+        PHPPreferencesMessages.getString("PHPBasePreferencePage.websettingsGroup.docroot"),
+        webSettingsGroup);
+    documentRootDFE.setPreferencePage(this);
+    documentRootDFE.setPreferenceStore(getPreferenceStore());
+    documentRootDFE.load();
     //Create apache
     Composite apacheSettingsComposite = new Composite(composite, SWT.NULL);
     apacheSettingsComposite.setLayout(new GridLayout());
@@ -158,6 +190,15 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
     apacheRestartSFE.setPreferenceStore(getPreferenceStore());
     apacheRestartSFE.load();
 
+    phpRunSFE =
+      new StringFieldEditor(
+        IPreferenceConstants.PHP_RUN_PREF,
+        PHPPreferencesMessages.getString("PHPBasePreferencePage.console.php"),
+        apacheSettingsGroup);
+    phpRunSFE.setPreferencePage(this);
+    phpRunSFE.setPreferenceStore(getPreferenceStore());
+    phpRunSFE.load();
+
     //Create mySQL
     Composite mySQLSettingsComposite = new Composite(composite, SWT.NULL);
     mySQLSettingsComposite.setLayout(new GridLayout());
@@ -198,7 +239,24 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
     chooseParser.setPreferencePage(this);
     chooseParser.setPreferenceStore(getPreferenceStore());
     chooseParser.load();
-    parseOnSave = new BooleanFieldEditor(PHPeclipsePlugin.PHP_PARSE_ON_SAVE, "&Parse automatically on save", 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();