KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > web > core > xmlsyntax > JspXMLSettingsInitializer


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.web.core.xmlsyntax;
21
22 import java.awt.Color JavaDoc;
23 import java.awt.Font JavaDoc;
24 import java.util.*;
25
26 import org.netbeans.editor.Settings;
27 import org.netbeans.editor.SettingsUtil;
28 import org.netbeans.editor.SettingsNames;
29 import org.netbeans.editor.SettingsDefaults;
30 import org.netbeans.editor.Coloring;
31 import org.netbeans.editor.BaseKit;
32 import org.netbeans.editor.TokenContext;
33 import org.netbeans.editor.TokenContextPath;
34 import org.netbeans.editor.TokenCategory;
35 import org.netbeans.modules.web.core.syntax.JSPKit;
36
37 /** Initializer class for settings of JSP editor with XML content. */
38
39 @Deprecated JavaDoc()
40 public class JspXMLSettingsInitializer extends Settings.AbstractInitializer {
41
42     /** Name assigned to initializer */
43     public static final String JavaDoc NAME = "jsp-xml-settings-initializer"; // NOI18N
44

45     public JspXMLSettingsInitializer() {
46         super(NAME);
47     }
48
49     public void updateSettingsMap (Class JavaDoc kitClass, Map settingsMap) {
50         // Jsp Colorings
51
// if (kitClass == BaseKit.class) {
52
// new JspXMLTokenColoringInitializer().updateSettingsMap(kitClass, settingsMap);
53
// }
54
//
55
// // Jsp Settings
56
// if (kitClass == JSPKit.class) {
57
//
58
// SettingsUtil.updateListSetting(settingsMap, SettingsNames.TOKEN_CONTEXT_LIST,
59
// new TokenContext[] { JspXMLTokenContext.context });
60
// }
61
}
62
63 // static class JspXMLTokenColoringInitializer
64
// extends SettingsUtil.TokenColoringInitializer {
65
//
66
// private Coloring errorColoring = new Coloring(null, Color.red, null);
67
//
68
// private Font italicFont = SettingsDefaults.defaultFont.deriveFont (Font.ITALIC);
69
//
70
// public JspXMLTokenColoringInitializer() {
71
// super(JspXMLTokenContext.context);
72
// }
73
//
74
// public Object getTokenColoring(TokenContextPath tokenContextPath,
75
// TokenCategory tokenIDOrCategory, boolean printingSet) {
76
//
77
// if (tokenContextPath == JspXMLTokenContext.contextPath) {
78
// if (!printingSet) {
79
// switch (tokenIDOrCategory.getNumericID()) {
80
// case JspXMLTokenContext.ERROR_ID:
81
// return errorColoring;
82
// }
83
//
84
// } else { // printing set
85
// return SettingsUtil.defaultPrintColoringEvaluator;
86
// }
87
//
88
// } else if (tokenContextPath == JspXMLTokenContext.xmlContextPath) {
89
// // XML token colorings
90
// if (!printingSet) {
91
// return new SettingsUtil.TokenColoringEvaluator(
92
// tokenContextPath.getParent().getFullTokenName(tokenIDOrCategory),
93
// null, printingSet);
94
//
95
// } else { // printing set
96
// return SettingsUtil.defaultPrintColoringEvaluator;
97
// }
98
// }
99
//
100
// return null;
101
//
102
// }
103
//
104
// }
105

106 }
107
108
Popular Tags