KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > web > core > syntax > deprecated > JspTagTokenContext


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.syntax.deprecated;
21
22 import org.netbeans.editor.TokenCategory;
23 import org.netbeans.editor.TokenContext;
24 import org.netbeans.editor.TokenContextPath;
25 import org.netbeans.editor.BaseTokenID;
26 import org.openide.ErrorManager;
27
28 /**
29 * Syntax class for JSP tags. It is not meant to be used by itself, but as one of syntaxes with
30 * MultiSyntax. Recognizes JSP tags, comments and directives. Does not recognize scriptlets,
31 * expressions and declarations, which should be rocognized by the master syntax, as expressions
32 * can appear embedded in a JSP tag. Moreover, they all share Java syntax.
33 *
34 * @author Petr Jiricka
35 * @deprecated Use JSP Lexer instead
36 */

37
38 public class JspTagTokenContext extends TokenContext {
39
40     //there is not any token category for jsp tags
41
//TODO - consider whether there is a need to create a category for jsp tags
42
public static final TokenCategory tokenCategory = null;
43     
44     // Numeric-ids
45
public static final int TEXT_ID = 1;
46     public static final int ERROR_ID = 2;
47     public static final int TAG_ID = 3;
48     public static final int SYMBOL_ID = 4;
49     public static final int SYMBOL2_ID = 5;
50     public static final int COMMENT_ID = 6;
51     public static final int ATTRIBUTE_ID = 7;
52     public static final int ATTR_VALUE_ID = 8;
53     public static final int EOL_ID = 9;
54     public static final int AFTER_UNEXPECTED_LT_ID = 10;
55     public static final int WHITESPACE_ID = 11;
56     
57     
58
59     // TokenIDs
60
public static final BaseTokenID TEXT = new BaseTokenID("text", TEXT_ID, tokenCategory); // NOI18N
61
public static final BaseTokenID ERROR = new BaseTokenID("error", ERROR_ID, tokenCategory); // NOI18N
62
public static final BaseTokenID TAG = new BaseTokenID("tag-directive", TAG_ID, tokenCategory); // NOI18N
63
public static final BaseTokenID SYMBOL = new BaseTokenID("symbol", SYMBOL_ID, tokenCategory); // NOI18N
64
public static final BaseTokenID SYMBOL2 = new BaseTokenID("scriptlet-delimiter", SYMBOL2_ID, tokenCategory); // NOI18N
65
public static final BaseTokenID COMMENT = new BaseTokenID("comment", COMMENT_ID, tokenCategory); // NOI18N
66
public static final BaseTokenID ATTRIBUTE = new BaseTokenID("attribute-name", ATTRIBUTE_ID, tokenCategory); // NOI18N
67
public static final BaseTokenID ATTR_VALUE = new BaseTokenID("attribute-value", ATTR_VALUE_ID, tokenCategory); // NOI18N
68
public static final BaseTokenID EOL = new BaseTokenID("EOL", EOL_ID, tokenCategory); // NOI18N
69
public static final BaseTokenID AFTER_UNEXPECTED_LT = new BaseTokenID("AFTER_UNEXPECTED_LT", AFTER_UNEXPECTED_LT_ID, tokenCategory); // NOI18N
70
public static final BaseTokenID WHITESPACE = new BaseTokenID("whitespace", WHITESPACE_ID, tokenCategory); // NOI18N
71

72
73     // Context instance declaration
74
public static final JspTagTokenContext context = new JspTagTokenContext();
75
76     public static final TokenContextPath contextPath = context.getContextPath();
77
78
79     JspTagTokenContext() {
80         super("jsptag-"); // NOI18N
81

82         try {
83             addDeclaredTokenIDs();
84         } catch (Exception JavaDoc e) {
85             ErrorManager.getDefault ().notify (ErrorManager.INFORMATIONAL, e);
86         }
87
88     }
89
90 }
91
92
Popular Tags