KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > preferences > AntEditorPreferenceConstants


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ant.internal.ui.preferences;
12
13 import org.eclipse.jface.preference.IPreferenceStore;
14 import org.eclipse.jface.preference.PreferenceConverter;
15 import org.eclipse.swt.graphics.RGB;
16
17 /**
18  * Preference constants used for the Ant Editor
19  */

20 public class AntEditorPreferenceConstants {
21
22     private AntEditorPreferenceConstants() {
23     }
24     
25     /**
26      * A named preference that controls if the Ant Editor code assist gets auto activated.
27      * <p>
28      * Value is of type <code>Boolean</code>.
29      * </p>
30      */

31     public final static String JavaDoc CODEASSIST_AUTOACTIVATION= "content_assist_autoactivation"; //$NON-NLS-1$
32

33     /**
34      * A name preference that holds the auto activation delay time in milli seconds.
35      * <p>
36      * Value is of type <code>Int</code>.
37      * </p>
38      */

39     public final static String JavaDoc CODEASSIST_AUTOACTIVATION_DELAY= "content_assist_autoactivation_delay"; //$NON-NLS-1$
40

41     /**
42      * A named preference that controls if the Ant editor code assist inserts a
43      * proposal automatically if only one proposal is available.
44      * <p>
45      * Value is of type <code>Boolean</code>.
46      * </p>
47      * @since 2.1
48      */

49     public final static String JavaDoc CODEASSIST_AUTOINSERT= "content_assist_autoinsert"; //$NON-NLS-1$
50

51     /**
52      * A named preference that holds the characters that auto activate code assist in an Ant buildfile.
53      * <p>
54      * Value is of type <code>Sring</code>. All characters that trigger auto code assist in an Ant buildfile.
55      * </p>
56      */

57     public final static String JavaDoc CODEASSIST_AUTOACTIVATION_TRIGGERS= "content_assist_autoactivation_triggers_java"; //$NON-NLS-1$
58

59     /**
60      * A named preference that controls if the Ant editor presents code assist proposals for
61      * user defined tasks
62      * <p>
63      * Value is of type <code>Boolean</code>.
64      * </p>
65      * @since 3.0
66      */

67     public final static String JavaDoc CODEASSIST_USER_DEFINED_TASKS= "content_assist_userDefinedTasks"; //$NON-NLS-1$
68

69     /**
70      * The symbolic names for colors for displaying code assist proposals
71      * @see org.eclipse.jface.resource.ColorRegistry
72      */

73     public final static String JavaDoc CODEASSIST_PROPOSALS_BACKGROUND= "org.eclipse.ant.ui.codeAssistProposalsBackgroundColor"; //$NON-NLS-1$
74
public final static String JavaDoc CODEASSIST_PROPOSALS_FOREGROUND= "org.eclipse.ant.ui.codeAssistProposalsForegroundColor"; //$NON-NLS-1$
75

76     /**
77      * A named preference that specifies the tab size for the Ant formatter.
78      * <p>
79      * Value is of type <code>int</code>.
80      * </p>
81      */

82     public static final String JavaDoc FORMATTER_TAB_SIZE= "formatter_tab_size"; //$NON-NLS-1$
83

84     /**
85      * A named preference that specifies if the Ant formatter uses spaces for tabs.
86      * <p>
87      * Value is of type <code>boolean</code>. If <code>false</code> spaces instead of tabs are used
88      * when formatting. If <code>true</code> the formatter inserts a tab character for indenting.
89      * </p>
90      */

91     public static final String JavaDoc FORMATTER_TAB_CHAR= "formatter_tab_char"; //$NON-NLS-1$
92

93     /**
94      * A named preference that specifies if the Ant formatter aligns the final
95      * &quote&gt&quote in multi-line element tags
96      * <p>
97      * Value is of type <code>Boolean</code>. If <code>true</code> the final
98      * &quote&gt&quote in multi-line element tags are aligned by the formatter.
99      * </p>
100      */

101     public static final String JavaDoc FORMATTER_ALIGN= "formatter_align"; //$NON-NLS-1$
102

103     /**
104      * A named preference that specifies the maximum line length for the Ant formatter.
105      * <p>
106      * Value is of type <code>int</code>.
107      * </p>
108      */

109     public static final String JavaDoc FORMATTER_MAX_LINE_LENGTH= "formatter_max_line_length"; //$NON-NLS-1$
110

111     /**
112      * A named preference that specifies if the Ant formatter should wrap elements that are longer than
113      * the maximum line length.
114      * <p>
115      * Value is of type <code>Boolean</code>. If <code>true</code> long elements are wrapped
116      * when formatting in the editor.
117      * </p>
118      */

119     public static final String JavaDoc FORMATTER_WRAP_LONG= "formatter_wrap_long"; //$NON-NLS-1$
120

121     /**
122      * Boolean preference identifier constant which specifies whether the Ant editor should
123      * format templates on insert.
124      */

125     public static final String JavaDoc TEMPLATES_USE_CODEFORMATTER= "templates_use_codeformatter"; //$NON-NLS-1$
126

127     /**
128      * Preference key suffix for bold text style preference keys.
129      *
130      */

131     public static final String JavaDoc EDITOR_BOLD_SUFFIX= "_bold"; //$NON-NLS-1$
132

133     /**
134      * Preference key suffix for italic text style preference keys.
135      */

136     public static final String JavaDoc EDITOR_ITALIC_SUFFIX= "_italic"; //$NON-NLS-1$
137

138     /**
139      * Preference key prefix for all problem preference keys.
140      */

141     public static final String JavaDoc PROBLEM= "problem"; //$NON-NLS-1$
142

143     /**
144      * String preference identifier constant which specifies the severity level for problems
145      * related to classpath in the Ant editor
146      */

147     public static final String JavaDoc PROBLEM_CLASSPATH= PROBLEM + "_classpath"; //$NON-NLS-1$
148

149     /**
150      * String preference identifier constant which specifies the severity level for problems
151      * related to properties in the Ant editor
152      */

153     public static final String JavaDoc PROBLEM_PROPERTIES= PROBLEM + "_properties"; //$NON-NLS-1$
154

155     /**
156      * String preference identifier constant which specifies the severity level for problems
157      * related to imports in the Ant editor
158      */

159     public static final String JavaDoc PROBLEM_IMPORTS= PROBLEM + "_imports"; //$NON-NLS-1$
160

161     /**
162      * String preference identifier constant which specifies the severity level for problems
163      * related to tasks in the Ant editor
164      */

165     public static final String JavaDoc PROBLEM_TASKS= PROBLEM + "_tasks"; //$NON-NLS-1$
166

167     /**
168      * String preference identifier constant which specifies the severity level for problems
169      * related to security exceptions in the Ant editor
170      */

171     public static final String JavaDoc PROBLEM_SECURITY= PROBLEM + "_security"; //$NON-NLS-1$
172

173     /**
174      * The constants allowable for the severity levels for problem preferences
175      */

176     public static final String JavaDoc BUILDFILE_ERROR = "error"; //$NON-NLS-1$
177
public static final String JavaDoc BUILDFILE_WARNING = "warning"; //$NON-NLS-1$
178
public static final String JavaDoc BUILDFILE_IGNORE = "ignore"; //$NON-NLS-1$
179

180     /**
181      * A named preference that controls whether problem reporting is enabled in the Ant editor.
182      * <p>
183      * Value is of type <code>Boolean</code>.
184      * </p>
185      *
186      * @since 3.1
187      */

188     public static String JavaDoc BUILDFILE_IGNORE_ALL = "ignoreAll"; //$NON-NLS-1$
189

190     /**
191      * A named preference that lists the names of buildfiles to not do problem reporting for
192      * <p>
193      * Value is of type <code>String</code>.
194      * </p>
195      *
196      * @since 3.1
197      */

198     public static String JavaDoc BUILDFILE_NAMES_TO_IGNORE = "ignoreNames"; //$NON-NLS-1$
199

200     /**
201      * A named preference that controls whether folding is enabled in the Ant editor.
202      * <p>
203      * Value is of type <code>Boolean</code>.
204      * </p>
205      *
206      * @since 3.1
207      */

208     public static final String JavaDoc EDITOR_FOLDING_ENABLED= "editor_folding_enabled"; //$NON-NLS-1$
209

210     /**
211      * A named preference that stores the value for comment folding.
212      * <p>
213      * Value is of type <code>Boolean</code>.
214      * </p>
215      *
216      * @since 3.1
217      */

218     public static final String JavaDoc EDITOR_FOLDING_COMMENTS= "editor_folding_comments"; //$NON-NLS-1$
219

220     /**
221      * A named preference that stores the value for target folding.
222      * <p>
223      * Value is of type <code>Boolean</code>.
224      * </p>
225      *
226      * @since 3.1
227      */

228     public static final String JavaDoc EDITOR_FOLDING_TARGETS= "editor_folding_targets"; //$NON-NLS-1$
229

230     /**
231      * A named preference that stores the value for DTD folding.
232      * <p>
233      * Value is of type <code>Boolean</code>.
234      * </p>
235      *
236      * @since 3.1
237      */

238     public static final String JavaDoc EDITOR_FOLDING_DTD= "editor_folding_dtd"; //$NON-NLS-1$
239

240     /**
241      * A named preference that stores the value for defining elements folding.
242      * <p>
243      * Value is of type <code>Boolean</code>.
244      * </p>
245      *
246      * @since 3.1
247      */

248     public static final String JavaDoc EDITOR_FOLDING_DEFINING= "editor_folding_defining"; //$NON-NLS-1$
249

250     /**
251      * A named preference that controls if segmented view (show selected element only) is turned on or off.
252      * <p>
253      * Value is of type <code>Boolean</code>.
254      * </p>
255      * @since 3.1
256      */

257     public static final String JavaDoc EDITOR_SHOW_SEGMENTS= "editor_show_segments"; //$NON-NLS-1$
258

259     /**
260      * A named preference that controls if occurrences are marked in the editor
261      * <p>
262      * Value is of type <code>Boolean</code>.
263      * </p>
264      * @since 3.1
265      */

266     public static final String JavaDoc EDITOR_MARK_OCCURRENCES= "editor_mark_occurrences"; //$NON-NLS-1$
267

268     /**
269      * A named preference that controls if background reconciling is triggered by the user
270      * typing in the editor
271      * <p>
272      * Value is of type <code>Boolean</code>.
273      * </p>
274      * @since 3.1
275      */

276     public static final String JavaDoc EDITOR_RECONCILE= "editor_reconcile"; //$NON-NLS-1$
277

278     /**
279      * A named preference that controls whether occurrences are sticky in the editor.
280      * <p>
281      * Value is of type <code>Boolean</code>.
282      * </p>
283      *
284      * @since 3.1
285      */

286     public static final String JavaDoc EDITOR_STICKY_OCCURRENCES= "stickyOccurrences"; //$NON-NLS-1$
287

288
289     public static void initializeDefaultValues(IPreferenceStore store) {
290         
291         store.setDefault(CODEASSIST_AUTOINSERT, true);
292         store.setDefault(CODEASSIST_USER_DEFINED_TASKS, true);
293         store.setDefault(CODEASSIST_AUTOACTIVATION, true);
294         store.setDefault(CODEASSIST_AUTOACTIVATION_DELAY, 500);
295         PreferenceConverter.setDefault(store, CODEASSIST_PROPOSALS_BACKGROUND, new RGB(254, 241, 233));
296         PreferenceConverter.setDefault(store, CODEASSIST_PROPOSALS_FOREGROUND, new RGB(0, 0, 0));
297         store.setDefault(CODEASSIST_AUTOACTIVATION_TRIGGERS, "<${"); //$NON-NLS-1$
298

299         store.setDefault(FORMATTER_TAB_CHAR, true);
300         store.setDefault(FORMATTER_TAB_SIZE, 4);
301         store.setDefault(FORMATTER_ALIGN, false);
302         store.setDefault(FORMATTER_MAX_LINE_LENGTH, 80);
303         store.setDefault(FORMATTER_WRAP_LONG, false);
304         
305         store.setDefault(TEMPLATES_USE_CODEFORMATTER, true);
306         
307         store.setDefault(PROBLEM_SECURITY, BUILDFILE_WARNING);
308         store.setDefault(PROBLEM_CLASSPATH, BUILDFILE_WARNING);
309         store.setDefault(PROBLEM_PROPERTIES, BUILDFILE_IGNORE);
310         store.setDefault(PROBLEM_IMPORTS, BUILDFILE_WARNING);
311         store.setDefault(PROBLEM_TASKS, BUILDFILE_IGNORE);
312         
313         store.setDefault(EDITOR_FOLDING_ENABLED, true);
314         
315         store.setDefault(EDITOR_SHOW_SEGMENTS, false);
316         
317         store.setDefault(EDITOR_MARK_OCCURRENCES, false);
318         store.setDefault(EDITOR_STICKY_OCCURRENCES, true);
319         
320         store.setDefault(BUILDFILE_IGNORE_ALL, false);
321         
322         store.setDefault(EDITOR_RECONCILE, true);
323     }
324 }
325
Popular Tags