1 /**********************************************************************
 
   2 Copyright (c) 2000, 2002 IBM Corp. and others.
 
   3 All rights reserved. This program and the accompanying materials
 
   4 are made available under the terms of the Common Public License v1.0
 
   5 which accompanies this distribution, and is available at
 
   6 http://www.eclipse.org/legal/cpl-v10.html
 
   9     IBM Corporation - Initial implementation
 
  10     Klaus Hartlage - www.eclipseproject.de
 
  11 **********************************************************************/
 
  12 package net.sourceforge.phpeclipse;
 
  14 import org.eclipse.jface.preference.BooleanFieldEditor;
 
  15 import org.eclipse.jface.preference.DirectoryFieldEditor;
 
  16 import org.eclipse.jface.preference.FieldEditorPreferencePage;
 
  17 import org.eclipse.jface.preference.IPreferenceStore;
 
  18 import org.eclipse.jface.preference.StringFieldEditor;
 
  19 import org.eclipse.ui.IWorkbench;
 
  20 import org.eclipse.ui.IWorkbenchPreferencePage;
 
  26 public class PHPEclipsePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
 
  28   public PHPEclipsePreferencePage() {
 
  29     super(FieldEditorPreferencePage.GRID);
 
  30     //Initialize the preference store we wish to use
 
  31     setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore());
 
  34   protected void createFieldEditors() {
 
  35     final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
 
  37     StringFieldEditor localhost = new StringFieldEditor(PHPeclipsePlugin.LOCALHOST_PREF, "&Localhost:", 60, getFieldEditorParent());
 
  39     DirectoryFieldEditor documentRoot =
 
  40       new DirectoryFieldEditor(PHPeclipsePlugin.DOCUMENTROOT_PREF, "&DocumentRoot:", getFieldEditorParent());
 
  42     BooleanFieldEditor useExternalBrowser =
 
  43       new BooleanFieldEditor(PHPeclipsePlugin.USE_EXTERNAL_BROWSER_PREF, "&Use External Browser", getFieldEditorParent());
 
  45     StringFieldEditor externalBrowser =
 
  46       new StringFieldEditor(PHPeclipsePlugin.EXTERNAL_BROWSER_PREF, "&External Browser command:", 60, getFieldEditorParent());
 
  48     StringFieldEditor startMySQL =
 
  49       new StringFieldEditor(PHPeclipsePlugin.MYSQL_PREF, "&MySQL command:", 60, getFieldEditorParent());
 
  51     StringFieldEditor startApache =
 
  52       new StringFieldEditor(PHPeclipsePlugin.APACHE_START_PREF, "Start &Apache command:", 60, getFieldEditorParent());
 
  54     StringFieldEditor stopApache =
 
  55       new StringFieldEditor(PHPeclipsePlugin.APACHE_STOP_PREF, "&Stop Apache command:", 60, getFieldEditorParent());
 
  57     StringFieldEditor restartApache =
 
  58       new StringFieldEditor(PHPeclipsePlugin.APACHE_RESTART_PREF, "&Restart Apache command:", 60, getFieldEditorParent());
 
  60     StringFieldEditor externalParser =
 
  61       new StringFieldEditor(PHPeclipsePlugin.EXTERNAL_PARSER_PREF, "&External Parser command:", 60, getFieldEditorParent());
 
  64     addField(documentRoot);
 
  65     addField(useExternalBrowser);
 
  66     addField(externalBrowser);
 
  68     addField(startApache);
 
  71     addField(restartApache);
 
  73     addField(externalParser);
 
  77    * @see IWorkbenchPreferencePage#init
 
  79   public void init(IWorkbench workbench) {