065a53d5b9fbb5a167f39f9f0b03465375403bc7
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / PHPEclipsePreferencePage.java
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
7
8 Contributors:
9     IBM Corporation - Initial implementation
10     Klaus Hartlage - www.eclipseproject.de
11 **********************************************************************/
12 package net.sourceforge.phpeclipse;
13
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;
21
22 /**
23  * 
24  * @author khartlage
25  */
26 public class PHPEclipsePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
27
28   public PHPEclipsePreferencePage() {
29     super(FieldEditorPreferencePage.GRID);
30     //Initialize the preference store we wish to use
31     setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore());
32   }
33
34   protected void createFieldEditors() {
35     final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
36
37     StringFieldEditor localhost = new StringFieldEditor(PHPeclipsePlugin.LOCALHOST_PREF, "&Localhost:", 60, getFieldEditorParent());
38
39     DirectoryFieldEditor documentRoot =
40       new DirectoryFieldEditor(PHPeclipsePlugin.DOCUMENTROOT_PREF, "&DocumentRoot:", getFieldEditorParent());
41
42     BooleanFieldEditor useExternalBrowser =
43       new BooleanFieldEditor(PHPeclipsePlugin.USE_EXTERNAL_BROWSER_PREF, "&Use External Browser", getFieldEditorParent());
44
45     StringFieldEditor externalBrowser =
46       new StringFieldEditor(PHPeclipsePlugin.EXTERNAL_BROWSER_PREF, "&External Browser command:", 60, getFieldEditorParent());
47
48     StringFieldEditor startMySQL =
49       new StringFieldEditor(PHPeclipsePlugin.MYSQL_PREF, "&MySQL command:", 60, getFieldEditorParent());
50
51     StringFieldEditor startApache =
52       new StringFieldEditor(PHPeclipsePlugin.APACHE_START_PREF, "Start &Apache command:", 60, getFieldEditorParent());
53
54     StringFieldEditor stopApache =
55       new StringFieldEditor(PHPeclipsePlugin.APACHE_STOP_PREF, "&Stop Apache command:", 60, getFieldEditorParent());
56
57     StringFieldEditor restartApache =
58       new StringFieldEditor(PHPeclipsePlugin.APACHE_RESTART_PREF, "&Restart Apache command:", 60, getFieldEditorParent());
59
60     StringFieldEditor externalParser =
61       new StringFieldEditor(PHPeclipsePlugin.EXTERNAL_PARSER_PREF, "&External Parser command:", 60, getFieldEditorParent());
62
63     addField(localhost);
64     addField(documentRoot);
65     addField(useExternalBrowser);
66     addField(externalBrowser);
67     addField(startMySQL);
68     addField(startApache);
69
70     addField(stopApache);
71     addField(restartApache);
72     
73     addField(externalParser);
74   }
75
76   /**
77    * @see IWorkbenchPreferencePage#init
78    */
79   public void init(IWorkbench workbench) {
80   }
81
82 }