KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > css > text > syntax > CSSTokenContext


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 package org.netbeans.modules.css.text.syntax;
20
21 import org.netbeans.editor.BaseTokenCategory;
22 import org.netbeans.editor.BaseTokenID;
23 import org.netbeans.editor.TokenContext;
24 import org.netbeans.editor.TokenContextPath;
25
26 import org.netbeans.modules.css.text.syntax.javacc.lib.*;
27
28 /**
29  * Token-ids and token-categories for CSS.
30  *
31  * @author Miloslav Metelka
32  * @author Petr Kuzel
33  * @version 1.0
34  */

35 public class CSSTokenContext extends TokenContext {
36
37     public final static int ATKW_ID = 1;
38     public final static int COMMENT_ID = 2;
39     public final static int EOL_ID = 3;
40     public final static int ERROR_ID = 4;
41     public final static int PLAIN_ID = 5;
42     public final static int PROPERTY_ID = 6;
43     public final static int SELECTOR_ID = 7;
44
45
46     public final static JJTokenID ATKW = new JJTokenID("at-keyword", ATKW_ID); // NOI18N
47
public final static JJTokenID COMMENT = new JJTokenID("comment", COMMENT_ID); // NOI18N
48
public final static JJTokenID EOL = new JJTokenID("eol", EOL_ID); // NOI18N
49
public final static JJTokenID ERROR = new JJTokenID("error", ERROR_ID, true); // NOI18N
50
public final static JJTokenID PLAIN = new JJTokenID("plain", PLAIN_ID); // NOI18N
51
public final static JJTokenID PROPERTY = new JJTokenID("property", PROPERTY_ID); // NOI18N
52
public final static JJTokenID SELECTOR = new JJTokenID("selector", SELECTOR_ID); // NOI18N
53

54     // Context instance declaration
55
public static final CSSTokenContext context = new CSSTokenContext();
56
57     public static final TokenContextPath contextPath = context.getContextPath();
58
59     private CSSTokenContext() {
60         super("css-"); // NOI18N
61

62         try {
63             addDeclaredTokenIDs();
64         } catch (Exception JavaDoc e) {
65             if (Boolean.getBoolean("netbeans.debug.exceptions")) { // NOI18N
66
e.printStackTrace();
67             }
68         }
69
70     }
71 }
72
Popular Tags