KickJava   Java API By Example, From Geeks To Geeks.

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


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.TokenContext;
23 import org.netbeans.editor.TokenContextPath;
24 import org.netbeans.editor.ext.java.JavaTokenContext;
25 import org.openide.ErrorManager;
26
27 /**
28  * Fake token contexts for JSP scriptlets, declarations and expressions
29  *
30  * @author Marek Fukala
31  * @version 1.00
32  * @deprecated Use JSP lexer instead
33  */

34
35 public class JspJavaFakeTokenContext {
36
37     public static class JavaScriptletTokenContext extends TokenContext {
38
39         // Context instance declaration
40
public static final JavaScriptletTokenContext context = new JavaScriptletTokenContext();
41         
42         /** Token path for embeded java token context */
43         public static final TokenContextPath contextPath =
44             context.getContextPath(JavaTokenContext.contextPath);
45         
46         private JavaScriptletTokenContext() {
47             super("", new TokenContext[] { // NOI18N
48
JavaTokenContext.context
49             }
50             );
51             
52             try {
53                 addDeclaredTokenIDs();
54             } catch (Exception JavaDoc e) {
55                 ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
56             }
57             
58         }
59         
60     }
61     
62     public static class JavaDeclarationTokenContext extends TokenContext {
63         
64         // Context instance declaration
65
public static final JavaDeclarationTokenContext context = new JavaDeclarationTokenContext();
66         
67         /** Token path for embeded java token context */
68         public static final TokenContextPath contextPath =
69             context.getContextPath(JavaTokenContext.contextPath);
70         
71         private JavaDeclarationTokenContext() {
72             super("", new TokenContext[] { // NOI18N
73
JavaTokenContext.context
74             }
75             );
76             
77             try {
78                 addDeclaredTokenIDs();
79             } catch (Exception JavaDoc e) {
80                 ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
81             }
82             
83         }
84         
85     }
86     
87     public static class JavaExpressionTokenContext extends TokenContext {
88         
89         // Context instance declaration
90
public static final JavaExpressionTokenContext context = new JavaExpressionTokenContext();
91         
92         /** Token path for embeded java token context */
93         public static final TokenContextPath contextPath =
94             context.getContextPath(JavaTokenContext.contextPath);
95         
96         private JavaExpressionTokenContext() {
97             super("", new TokenContext[] { // NOI18N
98
JavaTokenContext.context
99             }
100             );
101             
102             try {
103                 addDeclaredTokenIDs();
104             } catch (Exception JavaDoc e) {
105                 ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
106             }
107             
108         }
109         
110     }
111     
112     
113 }
114
115
Popular Tags