intial source from ttp://www.sf.net/projects/wdte
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.css.ui / src / net / sourceforge / phpeclipse / css / ui / internal / CssUIPreferences.java
1 /*
2  * Copyright (c) 2003-2004 Christopher Lenz 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  *     Christopher Lenz - initial API and implementation
10  * 
11  * $Id: CssUIPreferences.java,v 1.1 2004-09-02 18:11:49 jsurfer Exp $
12  */
13
14 package net.sourceforge.phpeclipse.css.ui.internal;
15
16 import org.eclipse.jface.preference.IPreferenceStore;
17 import org.eclipse.jface.preference.PreferenceConverter;
18 import org.eclipse.swt.graphics.RGB;
19 import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
20 import org.eclipse.ui.texteditor.AbstractTextEditor;
21
22 /**
23  * 
24  */
25 public final class CssUIPreferences {
26
27         // Constants ---------------------------------------------------------------
28
29         // Inherited constants
30
31         public static final String EDITOR_CURRENT_LINE =
32                 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE;
33
34         public static final String EDITOR_CURRENT_LINE_COLOR =
35                 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR;
36
37         public static final String EDITOR_TAB_WIDTH =
38                 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH;
39
40         public static final String EDITOR_LINE_NUMBER_RULER =
41                 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER;
42
43         public static final String EDITOR_LINE_NUMBER_RULER_COLOR =
44                 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR;
45
46         public static final String EDITOR_PRINT_MARGIN =
47                 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN;
48
49         public static final String EDITOR_PRINT_MARGIN_COLOR =
50                 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR;
51
52         public static final String EDITOR_PRINT_MARGIN_COLUMN =
53                 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN;
54
55         public static final String EDITOR_OVERVIEW_RULER =
56                 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER;
57
58         public static final String EDITOR_BACKGROUND_DEFAULT_COLOR =
59                 AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT;
60
61         public static final String EDITOR_BACKGROUND_COLOR =
62                 AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND;
63
64         public static final String EDITOR_FOREGROUND_COLOR =
65                 AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND;
66
67         public static final String EDITOR_FOREGROUND_DEFAULT_COLOR =
68                 AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT;
69
70         // Custom constants
71
72         public static final String EDITOR_MATCHING_BRACKETS =
73                 "matchingBrackets"; //$NON-NLS-1$
74
75         public static final String EDITOR_MATCHING_BRACKETS_COLOR =
76                 "matchingBracketsColor"; //$NON-NLS-1$
77
78         public static final String EDITOR_COMMENT_COLOR =
79                 "commentColor"; //$NON-NLS-1$
80
81         public static final String EDITOR_COMMENT_BOLD =
82                 "commentBold"; //$NON-NLS-1$
83
84         public static final String EDITOR_PROPERTY_COLOR =
85                 "propertyColor"; //$NON-NLS-1$
86
87         public static final String EDITOR_PROPERTY_BOLD =
88                 "propertyBold"; //$NON-NLS-1$
89
90         public static final String EDITOR_AT_KEYWORD_COLOR =
91                 "atKeywordColor"; //$NON-NLS-1$
92
93         public static final String EDITOR_AT_KEYWORD_BOLD =
94                 "atKeywordBold"; //$NON-NLS-1$
95
96         public static final String EDITOR_PSEUDO_CLASS_COLOR =
97                 "pseudoClassColor"; //$NON-NLS-1$
98
99         public static final String EDITOR_PSEUDO_CLASS_BOLD =
100                 "pseudoClassBold"; //$NON-NLS-1$
101
102         public static final String EDITOR_STRING_COLOR =
103                 "stringColor"; //$NON-NLS-1$
104
105         public static final String EDITOR_STRING_BOLD =
106                 "stringBold"; //$NON-NLS-1$
107
108         public static final String EDITOR_DEFAULT_COLOR =
109                 "defaultColor"; //$NON-NLS-1$
110
111         public static final String EDITOR_DEFAULT_BOLD =
112                 "defaultBold"; //$NON-NLS-1$
113
114         public static final String EDITOR_SPACES_FOR_TABS =
115                 "spacesForTabs"; //$NON-NLS-1$
116
117         public static final String EDITOR_CLOSE_STRINGS =
118                 "closeStrings"; //$NON-NLS-1$
119
120         public static final String EDITOR_CLOSE_BRACKETS_AND_PARENS =
121                 "closeBracketsAndParens"; //$NON-NLS-1$
122
123         public static final String EDITOR_CLOSE_BRACES =
124                 "closeBraces"; //$NON-NLS-1$
125
126         public static final String EDITOR_SHOW_SELECTED_ELEMENT_ONLY =
127                 "showSelectedElementOnly"; //$NON-NLS-1$
128
129         public static final String OUTLINE_LINK_WITH_EDITOR =
130                 "linkOutlineWithEditor"; //$NON-NLS-1$
131
132         public static final String OUTLINE_SORT_LEXICALLY =
133                 "sortOutlineLexically"; //$NON-NLS-1$
134
135         public static final String CONTENTASSIST_AUTOACTIVATION =
136                 "contentAssistAutoActivation"; //$NON-NLS-1$
137
138         public static final String CONTENTASSIST_AUTOACTIVATION_DELAY =
139                 "contentAssistAutoActivationDelay"; //$NON-NLS-1$
140
141         public static final String CONTENTASSIST_AUTOACTIVATION_TRIGGERS =
142                 "contentAssistAutoActivationTriggers"; //$NON-NLS-1$
143
144         public static final String CONTENTASSIST_AUTOINSERT =
145                 "contentAssistAutoInsert"; //$NON-NLS-1$
146
147         public static final String CONTENTASSIST_ORDER_PROPOSALS =
148                 "contentAssistOrderProposals"; //$NON-NLS-1$
149
150         public static final String CONTENTASSIST_PROPOSALS_BACKGROUND =
151                 "contentAssistProposalsBackground"; //$NON-NLS-1$
152
153         public static final String CONTENTASSIST_PROPOSALS_FOREGROUND =
154                 "contentAssistProposalsForeground"; //$NON-NLS-1$
155
156         // Constructors ------------------------------------------------------------
157
158         /**
159          * Hidden constructor.
160          */
161         private CssUIPreferences() {
162                 // Hidden
163         }
164
165         // Public Methods ----------------------------------------------------------
166
167         /**
168          * Initializes the preference store with the default values.
169          * 
170          * @param store The preference store to initialize
171          */
172         public static final void initializeDefaultValues(IPreferenceStore store) {
173
174                 // Appearance
175                 store.setDefault(EDITOR_TAB_WIDTH, 4);
176                 store.setDefault(EDITOR_MATCHING_BRACKETS, true);
177                 PreferenceConverter.setDefault(store, EDITOR_MATCHING_BRACKETS_COLOR,
178                         new RGB(192, 192, 192));
179
180                 // Syntax
181                 store.setDefault(EDITOR_FOREGROUND_DEFAULT_COLOR, true);
182                 store.setDefault(EDITOR_BACKGROUND_DEFAULT_COLOR, true);
183                 PreferenceConverter.setDefault(store, EDITOR_COMMENT_COLOR,
184                         new RGB(63, 127, 95));
185                 store.setDefault(EDITOR_COMMENT_BOLD, false);
186                 PreferenceConverter.setDefault(store, EDITOR_PROPERTY_COLOR,
187                         new RGB(127, 0, 85));
188                 store.setDefault(EDITOR_PROPERTY_BOLD, true);
189                 PreferenceConverter.setDefault(store, EDITOR_AT_KEYWORD_COLOR,
190                         new RGB(127, 0, 85));
191                 store.setDefault(EDITOR_AT_KEYWORD_BOLD, true);
192                 PreferenceConverter.setDefault(store, EDITOR_PSEUDO_CLASS_COLOR,
193                         new RGB(0, 0, 0));
194                 store.setDefault(EDITOR_PSEUDO_CLASS_BOLD, false);
195                 PreferenceConverter.setDefault(store, EDITOR_STRING_COLOR,
196                         new RGB(42, 0, 255));
197                 store.setDefault(EDITOR_STRING_BOLD, false);
198                 PreferenceConverter.setDefault(store, EDITOR_DEFAULT_COLOR,
199                         new RGB(0, 0, 0));
200                 store.setDefault(EDITOR_DEFAULT_BOLD, false);
201
202                 // Content assist
203                 store.setDefault(CONTENTASSIST_AUTOINSERT, false);
204                 store.setDefault(CONTENTASSIST_ORDER_PROPOSALS, false);
205                 store.setDefault(CONTENTASSIST_AUTOACTIVATION, true);
206                 store.setDefault(CONTENTASSIST_AUTOACTIVATION_DELAY, 500);
207                 store.setDefault(CONTENTASSIST_AUTOACTIVATION_TRIGGERS,
208                         "-@:"); //$NON-NLS-1$
209                 PreferenceConverter.setDefault(store,
210                         CONTENTASSIST_PROPOSALS_BACKGROUND, new RGB(254, 241, 233));
211                 PreferenceConverter.setDefault(store,
212                         CONTENTASSIST_PROPOSALS_FOREGROUND, new RGB(0, 0, 0));
213
214                 // Typing
215                 store.setDefault(EDITOR_TAB_WIDTH, 4);
216                 store.setDefault(EDITOR_SPACES_FOR_TABS, false);
217                 store.setDefault(EDITOR_CLOSE_STRINGS, true);
218                 store.setDefault(EDITOR_CLOSE_BRACKETS_AND_PARENS, true);
219                 store.setDefault(EDITOR_CLOSE_BRACES, true);
220
221                 // Outline
222                 store.setDefault(OUTLINE_SORT_LEXICALLY, false);
223                 store.setDefault(OUTLINE_LINK_WITH_EDITOR, false);
224         }
225 }