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.ColorFieldEditor;
16 import org.eclipse.jface.preference.DirectoryFieldEditor;
17 import org.eclipse.jface.preference.FieldEditorPreferencePage;
18 import org.eclipse.jface.preference.IPreferenceStore;
19 import org.eclipse.jface.preference.StringFieldEditor;
20 import org.eclipse.ui.IWorkbench;
21 import org.eclipse.ui.IWorkbenchPreferencePage;
27 public class PHPSyntaxPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IPreferenceConstants {
29 public PHPSyntaxPreferencePage() {
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 ColorFieldEditor multilineComment =
39 new ColorFieldEditor(PHP_MULTILINE_COMMENT, "Multi-line comment:", this.getFieldEditorParent());
40 this.addField(multilineComment);
41 ColorFieldEditor singlelineComment =
42 new ColorFieldEditor(PHP_SINGLELINE_COMMENT, "Single-line comment:", this.getFieldEditorParent());
43 this.addField(singlelineComment);
44 ColorFieldEditor keyWords = new ColorFieldEditor(PHP_KEYWORD, "Keywords:", this.getFieldEditorParent());
45 this.addField(keyWords);
46 ColorFieldEditor variables = new ColorFieldEditor(PHP_VARIABLE, "Variables:", this.getFieldEditorParent());
47 this.addField(variables);
48 ColorFieldEditor types = new ColorFieldEditor(PHP_FUNCTIONNAME, "Types:", this.getFieldEditorParent());
50 ColorFieldEditor strings = new ColorFieldEditor(PHP_STRING, "Strings:", this.getFieldEditorParent());
51 this.addField(strings);
52 ColorFieldEditor others = new ColorFieldEditor(PHP_DEFAULT, "Others:", this.getFieldEditorParent());
53 this.addField(others);
57 * @see IWorkbenchPreferencePage#init
59 public void init(IWorkbench workbench) {