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.RadioGroupFieldEditor;
19 import org.eclipse.jface.preference.StringFieldEditor;
20 import org.eclipse.ui.IWorkbench;
21 import org.eclipse.ui.IWorkbenchPreferencePage;
27 public class PHPEclipsePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
29 public PHPEclipsePreferencePage() {
30 super(FieldEditorPreferencePage.GRID);
31 //Initialize the preference store we wish to use
32 setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore());
35 protected void createFieldEditors() {
36 final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
38 StringFieldEditor localhost = new StringFieldEditor(PHPeclipsePlugin.LOCALHOST_PREF, "&Localhost:", 60, getFieldEditorParent());
40 DirectoryFieldEditor documentRoot =
41 new DirectoryFieldEditor(PHPeclipsePlugin.DOCUMENTROOT_PREF, "&DocumentRoot:", getFieldEditorParent());
43 BooleanFieldEditor useExternalBrowser =
44 new BooleanFieldEditor(PHPeclipsePlugin.USE_EXTERNAL_BROWSER_PREF, "&Use External Browser", getFieldEditorParent());
46 StringFieldEditor externalBrowser =
47 new StringFieldEditor(PHPeclipsePlugin.EXTERNAL_BROWSER_PREF, "&External Browser command:", 60, getFieldEditorParent());
49 StringFieldEditor startMySQL =
50 new StringFieldEditor(PHPeclipsePlugin.MYSQL_PREF, "&MySQL command:", 60, getFieldEditorParent());
52 StringFieldEditor startApache =
53 new StringFieldEditor(PHPeclipsePlugin.APACHE_START_PREF, "Start &Apache command:", 60, getFieldEditorParent());
55 StringFieldEditor stopApache =
56 new StringFieldEditor(PHPeclipsePlugin.APACHE_STOP_PREF, "&Stop Apache command:", 60, getFieldEditorParent());
58 StringFieldEditor restartApache =
59 new StringFieldEditor(PHPeclipsePlugin.APACHE_RESTART_PREF, "&Restart Apache command:", 60, getFieldEditorParent());
61 StringFieldEditor externalParser =
62 new StringFieldEditor(PHPeclipsePlugin.EXTERNAL_PARSER_PREF, "&External Parser command:", 60, getFieldEditorParent());
65 RadioGroupFieldEditor chooseParser = new RadioGroupFieldEditor(
66 IPreferenceConstants.PHP_PARSER_DEFAULT,
71 IPreferenceConstants.PHP_INTERNAL_PARSER
74 IPreferenceConstants.PHP_EXTERNAL_PARSER
77 this.getFieldEditorParent());
79 BooleanFieldEditor parseOnSave =
80 new BooleanFieldEditor(PHPeclipsePlugin.PHP_PARSE_ON_SAVE, "&Parse automatically on save", getFieldEditorParent());
85 addField(documentRoot);
86 addField(useExternalBrowser);
87 addField(externalBrowser);
89 addField(startApache);
92 addField(restartApache);
94 addField(externalParser);
96 addField(chooseParser);
97 addField(parseOnSave);
101 * @see IWorkbenchPreferencePage#init
103 public void init(IWorkbench workbench) {