First JUnit test cases for the PHP Parser
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / PHPEclipsePreferencePage.java
index 05b2d4e..b0c494c 100644 (file)
@@ -11,19 +11,11 @@ Contributors:
 **********************************************************************/
 package net.sourceforge.phpeclipse;
 
-import java.io.IOException;
-import java.text.MessageFormat;
-
 import org.eclipse.jface.preference.BooleanFieldEditor;
 import org.eclipse.jface.preference.DirectoryFieldEditor;
 import org.eclipse.jface.preference.FieldEditorPreferencePage;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 
@@ -40,7 +32,6 @@ public class PHPEclipsePreferencePage extends FieldEditorPreferencePage implemen
        }
 
        protected void createFieldEditors() {
-               Shell shell = getShell();
                final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
 
                StringFieldEditor localhost = new StringFieldEditor(PHPeclipsePlugin.LOCALHOST_PREF, "&Localhost:", 60, getFieldEditorParent());
@@ -49,69 +40,26 @@ public class PHPEclipsePreferencePage extends FieldEditorPreferencePage implemen
                        new DirectoryFieldEditor(PHPeclipsePlugin.DOCUMENTROOT_PREF, "&DocumentRoot:", getFieldEditorParent());
 
                BooleanFieldEditor useExternalBrowser =
-                       new BooleanFieldEditor(PHPeclipsePlugin.USE_EXTERNAL_BROWSER_PREF, "&Use External Browser", 60, getFieldEditorParent());
+                       new BooleanFieldEditor(PHPeclipsePlugin.USE_EXTERNAL_BROWSER_PREF, "&Use External Browser", getFieldEditorParent());
 
                StringFieldEditor externalBrowser =
                        new StringFieldEditor(PHPeclipsePlugin.EXTERNAL_BROWSER_PREF, "&External Browser command:", 60, getFieldEditorParent());
 
                StringFieldEditor startMySQL =
                        new StringFieldEditor(PHPeclipsePlugin.MYSQL_PREF, "&MySQL command:", 60, getFieldEditorParent());
-               Button button = new Button(shell, SWT.PUSH);
-               button.setText("Start MySQL");
-               button.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               try {
-                                       Runtime runtime = Runtime.getRuntime();
-                                       runtime.exec(store.getString(PHPeclipsePlugin.MYSQL_PREF));
-                               } catch (IOException e1) {
-                               }
-                       }
-               });
+
 
                StringFieldEditor startApache =
                        new StringFieldEditor(PHPeclipsePlugin.APACHE_START_PREF, "Start &Apache command:", 60, getFieldEditorParent());
-               Button startButton = new Button(shell, SWT.PUSH);
-               startButton.setText("Start Apache");
-               startButton.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               String[] arguments = { store.getString(PHPeclipsePlugin.DOCUMENTROOT_PREF)};
-                               MessageFormat form = new MessageFormat(store.getString(PHPeclipsePlugin.APACHE_START_PREF));
-
-                               try {
-                                       Runtime runtime = Runtime.getRuntime();
-                                       runtime.exec(form.format(arguments));
-                               } catch (IOException e2) {
-                               }
-                       }
-               });
-
-               StringFieldEditor stopApache =
+
+
+               StringFieldEditor stopApache = 
                        new StringFieldEditor(PHPeclipsePlugin.APACHE_STOP_PREF, "&Stop Apache command:", 60, getFieldEditorParent());
-    Button stopButton = new Button(shell, SWT.PUSH);
-    stopButton.setText("Stop Apache");
-    stopButton.addSelectionListener(new SelectionAdapter() {
-      public void widgetSelected(SelectionEvent e) {
-        try {
-          Runtime runtime = Runtime.getRuntime();
-          runtime.exec(store.getString(PHPeclipsePlugin.MYSQL_PREF));
-        } catch (IOException e1) {
-        }
-      }
-    });
+
     
                StringFieldEditor restartApache =
                        new StringFieldEditor(PHPeclipsePlugin.APACHE_RESTART_PREF, "&Restart Apache command:", 60, getFieldEditorParent());
-    Button restartButton = new Button(shell, SWT.PUSH);
-    restartButton.setText("Restart Apache");
-    restartButton.addSelectionListener(new SelectionAdapter() {
-      public void widgetSelected(SelectionEvent e) {
-        try {
-          Runtime runtime = Runtime.getRuntime();
-          runtime.exec(store.getString(PHPeclipsePlugin.MYSQL_PREF));
-        } catch (IOException e1) {
-        }
-      }
-    });
+
     
                addField(localhost);
                addField(documentRoot);
@@ -119,7 +67,7 @@ public class PHPEclipsePreferencePage extends FieldEditorPreferencePage implemen
                addField(externalBrowser);
                addField(startMySQL);
                addField(startApache);
-//    add(startButton);
+
                addField(stopApache);
                addField(restartApache);
        }