001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.web.core.syntax.deprecated;
043:
044: import java.util.logging.Level;
045: import java.util.logging.Logger;
046: import org.netbeans.editor.BaseTokenCategory;
047: import org.netbeans.editor.TokenCategory;
048: import org.netbeans.editor.TokenContextPath;
049: import org.netbeans.editor.BaseTokenID;
050:
051: /**
052: * Syntax Token Context class for JSP directives. Tokens from this token context
053: * are used for jsp directives. The only difference between them is that directive
054: * tokens has a special token context category.
055: *
056: * @author Marek Fukala
057: * @deprecated Use Jsp Lexer instead.
058: */
059:
060: public class JspDirectiveTokenContext extends JspTagTokenContext {
061:
062: //token ids - are inherited from superclass
063:
064: //token category ids
065: public static final int TAG_CATEGORY_ID = WHITESPACE_ID + 1;
066:
067: //token category for jsp directives
068: public static final TokenCategory tokenCategory = new BaseTokenCategory(
069: "directive", TAG_CATEGORY_ID); // NOI18N
070:
071: // TokenIDs
072: public static final BaseTokenID TEXT = new BaseTokenID("text",
073: TEXT_ID, tokenCategory); // NOI18N
074: public static final BaseTokenID ERROR = new BaseTokenID("error",
075: ERROR_ID, tokenCategory); // NOI18N
076: public static final BaseTokenID TAG = new BaseTokenID(
077: "tag-directive", TAG_ID, tokenCategory); // NOI18N
078: public static final BaseTokenID SYMBOL = new BaseTokenID("symbol",
079: SYMBOL_ID, tokenCategory); // NOI18N
080: public static final BaseTokenID SYMBOL2 = new BaseTokenID(
081: "scriptlet-delimiter", SYMBOL2_ID, tokenCategory); // NOI18N
082: public static final BaseTokenID COMMENT = new BaseTokenID(
083: "comment", COMMENT_ID, tokenCategory); // NOI18N
084: public static final BaseTokenID ATTRIBUTE = new BaseTokenID(
085: "attribute-name", ATTRIBUTE_ID, tokenCategory); // NOI18N
086: public static final BaseTokenID ATTR_VALUE = new BaseTokenID(
087: "attribute-value", ATTR_VALUE_ID, tokenCategory); // NOI18N
088: public static final BaseTokenID EOL = new BaseTokenID("EOL",
089: EOL_ID, tokenCategory); // NOI18N
090: public static final BaseTokenID AFTER_UNEXPECTED_LT = new BaseTokenID(
091: "AFTER_UNEXPECTED_LT", AFTER_UNEXPECTED_LT_ID,
092: tokenCategory); // NOI18N
093: public static final BaseTokenID WHITESPACE = new BaseTokenID(
094: "whitespace", WHITESPACE_ID, tokenCategory); // NOI18N
095:
096: // Context instance declaration
097: public static final JspDirectiveTokenContext context = new JspDirectiveTokenContext();
098:
099: public static final TokenContextPath contextPath = context
100: .getContextPath();
101:
102: JspDirectiveTokenContext() {
103: super (); // NOI18N
104:
105: try {
106: addDeclaredTokenIDs();
107: } catch (Exception e) {
108: Logger.getLogger("global").log(Level.INFO, null, e);
109: }
110:
111: }
112:
113: }
|