2 * Created on May 20th, 2003
3 *========================================================================
4 * Modifications history
5 *========================================================================
6 * $Log: not supported by cvs2svn $
7 * Revision 1.1 2004/02/05 03:13:29 agfitzp
8 * Initial submission, outline view is broken due to refactoring
10 * Revision 1.4 2003/12/10 20:19:16 agfitzp
13 * Revision 1.3 2003/06/21 03:48:51 agfitzp
14 * fixed global variables as functions bug
15 * fixed length calculation of instance variables
16 * Automatic outlining is now a preference
18 * Revision 1.2 2003/05/30 20:53:08 agfitzp
19 * 0.0.2 : Outlining is now done as the user types. Some other bug fixes.
21 *========================================================================
23 package net.sourceforge.phpeclipse.js.ui.preferences;
25 import net.sourceforge.phpeclipse.js.ui.JSUIPlugin;
27 import org.eclipse.jface.preference.BooleanFieldEditor;
28 import org.eclipse.jface.preference.ColorFieldEditor;
29 import org.eclipse.jface.preference.FieldEditorPreferencePage;
30 import org.eclipse.ui.IWorkbench;
31 import org.eclipse.ui.IWorkbenchPreferencePage;
34 * This class represents a preference page that
35 * is contributed to the Preferences dialog. By
36 * subclassing <samp>FieldEditorPreferencePage</samp>, we
37 * can use the field support built into JFace that allows
38 * us to create a page that is small and knows how to
39 * save, restore and apply itself.
41 * This page is used to modify preferences only. They
42 * are stored in the preference store that belongs to
43 * the main plug-in class. That way, preferences can
44 * be accessed directly via the preference store.
47 public class JavaScriptPreferencePage
48 extends FieldEditorPreferencePage
49 implements IWorkbenchPreferencePage , PreferenceNames {
51 public JavaScriptPreferencePage() {
53 setPreferenceStore(JSUIPlugin.getDefault().getPreferenceStore());
54 setDescription("Preferences for JavaScript editor.");
58 * Creates the field editors. Field editors are abstractions of
59 * the common GUI blocks needed to manipulate various types
60 * of preferences. Each field editor knows how to save and
64 public void createFieldEditors() {
65 addField(new BooleanFieldEditor(P_AUTO_OUTLINE, "&Automatic Outlining", getFieldEditorParent()));
66 addField(new ColorFieldEditor(P_COMMENT_COLOR, "&Comment Color:", getFieldEditorParent()));
67 addField(new ColorFieldEditor(P_STRING_COLOR, "&String Color:", getFieldEditorParent()));
68 addField(new ColorFieldEditor(P_KEYWORD_COLOR, "&Keyword Color:", getFieldEditorParent()));
69 addField(new ColorFieldEditor(P_DEFAULT_COLOR, "D&efault Color:", getFieldEditorParent()));
72 public void init(IWorkbench workbench) {