improved/refactored php syntax parser
[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.ColorFieldEditor;
15 import org.eclipse.jface.preference.FieldEditorPreferencePage;
16 import org.eclipse.jface.preference.IPreferenceStore;
17 import org.eclipse.jface.preference.RadioGroupFieldEditor;
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     ColorFieldEditor multilineComment =
37       new ColorFieldEditor(PHP_MULTILINE_COMMENT, "Multi-line comment:", this.getFieldEditorParent());
38     this.addField(multilineComment);
39     ColorFieldEditor singlelineComment =
40       new ColorFieldEditor(PHP_SINGLELINE_COMMENT, "Single-line comment:", this.getFieldEditorParent());
41     this.addField(singlelineComment);
42     ColorFieldEditor keyWords = new ColorFieldEditor(PHP_KEYWORD, "Keywords:", this.getFieldEditorParent());
43     this.addField(keyWords);
44     ColorFieldEditor variables = new ColorFieldEditor(PHP_VARIABLE, "Variables:", this.getFieldEditorParent());
45     this.addField(variables);
46     ColorFieldEditor types = new ColorFieldEditor(PHP_FUNCTIONNAME, "Types:", this.getFieldEditorParent());
47     this.addField(types);
48     ColorFieldEditor strings = new ColorFieldEditor(PHP_STRING, "Strings:", this.getFieldEditorParent());
49     this.addField(strings);
50     ColorFieldEditor others = new ColorFieldEditor(PHP_DEFAULT, "Others:", this.getFieldEditorParent());
51     this.addField(others);
52   }
53
54   /**
55    * @see IWorkbenchPreferencePage#init
56    */
57   public void init(IWorkbench workbench) {
58   }
59
60 }