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.FieldEditorPreferencePage;
17 import org.eclipse.jface.preference.IPreferenceStore;
18 import org.eclipse.ui.IWorkbench;
19 import org.eclipse.ui.IWorkbenchPreferencePage;
25 public class PHPSyntaxPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IPreferenceConstants {
27 public PHPSyntaxPreferencePage() {
28 super(FieldEditorPreferencePage.GRID);
29 //Initialize the preference store we wish to use
30 setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore());
33 protected void createFieldEditors() {
34 final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
36 BooleanFieldEditor showLineNumbers =
37 new BooleanFieldEditor(PHPeclipsePlugin.LINE_NUMBER_RULER, "Show line numbers", getFieldEditorParent());
38 this.addField(showLineNumbers);
40 ColorFieldEditor multilineComment =
41 new ColorFieldEditor(PHP_MULTILINE_COMMENT, "Multi-line comment:", this.getFieldEditorParent());
42 this.addField(multilineComment);
43 ColorFieldEditor singlelineComment =
44 new ColorFieldEditor(PHP_SINGLELINE_COMMENT, "Single-line comment:", this.getFieldEditorParent());
45 this.addField(singlelineComment);
46 ColorFieldEditor keyWords = new ColorFieldEditor(PHP_KEYWORD, "Keywords:", this.getFieldEditorParent());
47 this.addField(keyWords);
48 ColorFieldEditor variables = new ColorFieldEditor(PHP_VARIABLE, "Variables:", this.getFieldEditorParent());
49 this.addField(variables);
50 ColorFieldEditor types = new ColorFieldEditor(PHP_FUNCTIONNAME, "Built-in functions:", this.getFieldEditorParent());
52 ColorFieldEditor strings = new ColorFieldEditor(PHP_STRING, "Strings:", this.getFieldEditorParent());
53 this.addField(strings);
54 ColorFieldEditor others = new ColorFieldEditor(PHP_DEFAULT, "Others:", this.getFieldEditorParent());
55 this.addField(others);
59 * @see IWorkbenchPreferencePage#init
61 public void init(IWorkbench workbench) {