1.0.4 release
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / PHPSyntaxPreferencePage.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.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;
20
21 /**
22  * 
23  * @author khartlage
24  */
25 public class PHPSyntaxPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IPreferenceConstants {
26
27   public PHPSyntaxPreferencePage() {
28     super(FieldEditorPreferencePage.GRID);
29     //Initialize the preference store we wish to use
30     setPreferenceStore(PHPeclipsePlugin.getDefault().getPreferenceStore());
31   }
32
33   protected void createFieldEditors() {
34     final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
35
36     BooleanFieldEditor showLineNumbers =
37       new BooleanFieldEditor(PHPeclipsePlugin.LINE_NUMBER_RULER, "Show line numbers", getFieldEditorParent());
38     this.addField(showLineNumbers);
39
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());
51     this.addField(types);
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);
56   }
57
58   /**
59    * @see IWorkbenchPreferencePage#init
60    */
61   public void init(IWorkbench workbench) {
62   }
63
64 }