KickJava   Java API By Example, From Geeks To Geeks.

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


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.modules.web.core.syntax.deprecated.JspJavaFakeTokenContext;
23 import org.netbeans.editor.BaseTokenID;
24 import org.netbeans.editor.TokenContext;
25 import org.netbeans.editor.TokenContextPath;
26 import org.netbeans.editor.ext.html.HTMLTokenContext;
27 import org.netbeans.editor.ext.plain.PlainTokenContext;
28 import org.netbeans.modules.web.core.syntax.deprecated.ELTokenContext;
29 import org.openide.ErrorManager;
30
31 /**
32 * Token context for JSP.
33 *
34 * @author Miloslav Metelka
35 * @deprecated Use JSP Lexer instead
36 */

37
38 public class JspMultiTokenContext extends TokenContext {
39
40     // Jsp token numericIDs
41
public static final int ERROR_ID = 1;
42
43     /** jsp-error token-id */
44     public static final BaseTokenID ERROR = new BaseTokenID("error", ERROR_ID); // NOI18N
45

46     // Context instance declaration
47
public static final JspMultiTokenContext context = new JspMultiTokenContext();
48
49     public static final TokenContextPath contextPath = context.getContextPath();
50
51     /** Path for jsp-tags in jsp */
52     public static final TokenContextPath jspTagContextPath
53         = context.getContextPath(JspTagTokenContext.contextPath);
54
55     /** Path for Expression Language tokens in jsp */
56     public static final TokenContextPath elContextPath
57         = context.getContextPath(ELTokenContext.contextPath);
58
59     /** Path for java tokens in jsp */
60     public static final TokenContextPath javaScriptletContextPath
61         = context.getContextPath(JspJavaFakeTokenContext.JavaScriptletTokenContext.contextPath);
62
63     public static final TokenContextPath javaExpressionContextPath
64         = context.getContextPath(JspJavaFakeTokenContext.JavaExpressionTokenContext.contextPath);
65
66     public static final TokenContextPath javaDeclarationContextPath
67         = context.getContextPath(JspJavaFakeTokenContext.JavaDeclarationTokenContext.contextPath);
68
69     
70     /** Path for HTML tokens in jsp */
71     public static final TokenContextPath htmlContextPath
72         = context.getContextPath(HTMLTokenContext.contextPath);
73
74     /** Path for plain tokens in jsp */
75     public static final TokenContextPath plainContextPath
76         = context.getContextPath(PlainTokenContext.contextPath);
77
78
79     private JspMultiTokenContext() {
80         super("jsp-", new TokenContext[] { // NOI18N
81
JspTagTokenContext.context,
82                 ELTokenContext.context,
83                 JspJavaFakeTokenContext.JavaScriptletTokenContext.context,
84                 JspJavaFakeTokenContext.JavaDeclarationTokenContext.context,
85                 JspJavaFakeTokenContext.JavaExpressionTokenContext.context,
86                 HTMLTokenContext.context,
87                 PlainTokenContext.context
88             }
89         );
90
91         try {
92             addDeclaredTokenIDs();
93         } catch (Exception JavaDoc e) {
94             ErrorManager.getDefault ().notify (ErrorManager.INFORMATIONAL, e);
95         }
96
97     }
98
99 }
100
101
Popular Tags