intial source from ttp://www.sf.net/projects/wdte
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.js.ui / src / net / sourceforge / phpeclipse / js / ui / preferences / JavaScriptPreferencePage.java
1 /*
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
9  *
10  * Revision 1.4  2003/12/10 20:19:16  agfitzp
11  * 3.0 port
12  *
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
17  *
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.
20  *
21  *========================================================================
22  */
23 package net.sourceforge.phpeclipse.js.ui.preferences;
24
25 import net.sourceforge.phpeclipse.js.ui.JSUIPlugin;
26
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;
32
33 /**
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.
40  * <p>
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.
45  */
46
47 public class JavaScriptPreferencePage
48         extends FieldEditorPreferencePage
49         implements IWorkbenchPreferencePage , PreferenceNames {
50
51         public JavaScriptPreferencePage() {
52                 super(GRID);
53                 setPreferenceStore(JSUIPlugin.getDefault().getPreferenceStore());
54                 setDescription("Preferences for JavaScript editor.");
55         }
56         
57 /**
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
61  * restore itself.
62  */
63
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()));
70         }
71         
72         public void init(IWorkbench workbench) {
73         }
74 }