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
9 * Christopher Lenz - initial API and implementation
11 * $Id: CssUIPreferences.java,v 1.1 2004-09-02 18:11:49 jsurfer Exp $
14 package net.sourceforge.phpeclipse.css.ui.internal;
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;
25 public final class CssUIPreferences {
27 // Constants ---------------------------------------------------------------
29 // Inherited constants
31 public static final String EDITOR_CURRENT_LINE =
32 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE;
34 public static final String EDITOR_CURRENT_LINE_COLOR =
35 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR;
37 public static final String EDITOR_TAB_WIDTH =
38 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH;
40 public static final String EDITOR_LINE_NUMBER_RULER =
41 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER;
43 public static final String EDITOR_LINE_NUMBER_RULER_COLOR =
44 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR;
46 public static final String EDITOR_PRINT_MARGIN =
47 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN;
49 public static final String EDITOR_PRINT_MARGIN_COLOR =
50 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR;
52 public static final String EDITOR_PRINT_MARGIN_COLUMN =
53 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN;
55 public static final String EDITOR_OVERVIEW_RULER =
56 AbstractDecoratedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER;
58 public static final String EDITOR_BACKGROUND_DEFAULT_COLOR =
59 AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT;
61 public static final String EDITOR_BACKGROUND_COLOR =
62 AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND;
64 public static final String EDITOR_FOREGROUND_COLOR =
65 AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND;
67 public static final String EDITOR_FOREGROUND_DEFAULT_COLOR =
68 AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT;
72 public static final String EDITOR_MATCHING_BRACKETS =
73 "matchingBrackets"; //$NON-NLS-1$
75 public static final String EDITOR_MATCHING_BRACKETS_COLOR =
76 "matchingBracketsColor"; //$NON-NLS-1$
78 public static final String EDITOR_COMMENT_COLOR =
79 "commentColor"; //$NON-NLS-1$
81 public static final String EDITOR_COMMENT_BOLD =
82 "commentBold"; //$NON-NLS-1$
84 public static final String EDITOR_PROPERTY_COLOR =
85 "propertyColor"; //$NON-NLS-1$
87 public static final String EDITOR_PROPERTY_BOLD =
88 "propertyBold"; //$NON-NLS-1$
90 public static final String EDITOR_AT_KEYWORD_COLOR =
91 "atKeywordColor"; //$NON-NLS-1$
93 public static final String EDITOR_AT_KEYWORD_BOLD =
94 "atKeywordBold"; //$NON-NLS-1$
96 public static final String EDITOR_PSEUDO_CLASS_COLOR =
97 "pseudoClassColor"; //$NON-NLS-1$
99 public static final String EDITOR_PSEUDO_CLASS_BOLD =
100 "pseudoClassBold"; //$NON-NLS-1$
102 public static final String EDITOR_STRING_COLOR =
103 "stringColor"; //$NON-NLS-1$
105 public static final String EDITOR_STRING_BOLD =
106 "stringBold"; //$NON-NLS-1$
108 public static final String EDITOR_DEFAULT_COLOR =
109 "defaultColor"; //$NON-NLS-1$
111 public static final String EDITOR_DEFAULT_BOLD =
112 "defaultBold"; //$NON-NLS-1$
114 public static final String EDITOR_SPACES_FOR_TABS =
115 "spacesForTabs"; //$NON-NLS-1$
117 public static final String EDITOR_CLOSE_STRINGS =
118 "closeStrings"; //$NON-NLS-1$
120 public static final String EDITOR_CLOSE_BRACKETS_AND_PARENS =
121 "closeBracketsAndParens"; //$NON-NLS-1$
123 public static final String EDITOR_CLOSE_BRACES =
124 "closeBraces"; //$NON-NLS-1$
126 public static final String EDITOR_SHOW_SELECTED_ELEMENT_ONLY =
127 "showSelectedElementOnly"; //$NON-NLS-1$
129 public static final String OUTLINE_LINK_WITH_EDITOR =
130 "linkOutlineWithEditor"; //$NON-NLS-1$
132 public static final String OUTLINE_SORT_LEXICALLY =
133 "sortOutlineLexically"; //$NON-NLS-1$
135 public static final String CONTENTASSIST_AUTOACTIVATION =
136 "contentAssistAutoActivation"; //$NON-NLS-1$
138 public static final String CONTENTASSIST_AUTOACTIVATION_DELAY =
139 "contentAssistAutoActivationDelay"; //$NON-NLS-1$
141 public static final String CONTENTASSIST_AUTOACTIVATION_TRIGGERS =
142 "contentAssistAutoActivationTriggers"; //$NON-NLS-1$
144 public static final String CONTENTASSIST_AUTOINSERT =
145 "contentAssistAutoInsert"; //$NON-NLS-1$
147 public static final String CONTENTASSIST_ORDER_PROPOSALS =
148 "contentAssistOrderProposals"; //$NON-NLS-1$
150 public static final String CONTENTASSIST_PROPOSALS_BACKGROUND =
151 "contentAssistProposalsBackground"; //$NON-NLS-1$
153 public static final String CONTENTASSIST_PROPOSALS_FOREGROUND =
154 "contentAssistProposalsForeground"; //$NON-NLS-1$
156 // Constructors ------------------------------------------------------------
159 * Hidden constructor.
161 private CssUIPreferences() {
165 // Public Methods ----------------------------------------------------------
168 * Initializes the preference store with the default values.
170 * @param store The preference store to initialize
172 public static final void initializeDefaultValues(IPreferenceStore store) {
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));
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,
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,
200 store.setDefault(EDITOR_DEFAULT_BOLD, false);
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));
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);
222 store.setDefault(OUTLINE_SORT_LEXICALLY, false);
223 store.setDefault(OUTLINE_LINK_WITH_EDITOR, false);