1 19 20 package org.netbeans.editor.ext.html; 21 22 import org.netbeans.editor.BaseTokenCategory; 23 import org.netbeans.editor.BaseTokenID; 24 import org.netbeans.editor.TokenCategory; 25 import org.netbeans.editor.TokenID; 26 import org.netbeans.editor.TokenContext; 27 import org.netbeans.editor.TokenContextPath; 28 import org.netbeans.editor.Utilities; 29 30 39 40 public class HTMLTokenContext extends TokenContext { 41 42 public static final int TEXT_ID = 1; 44 public static final int WS_ID = TEXT_ID + 1; 45 public static final int ERROR_ID = WS_ID + 1; 46 public static final int TAG_OPEN_ID = ERROR_ID + 1; 47 public static final int TAG_CLOSE_ID = TAG_OPEN_ID + 1; 48 public static final int ARGUMENT_ID = TAG_CLOSE_ID + 1; 49 public static final int OPERATOR_ID = ARGUMENT_ID + 1; 50 public static final int VALUE_ID = OPERATOR_ID + 1; 51 public static final int BLOCK_COMMENT_ID = VALUE_ID + 1; 52 public static final int SGML_COMMENT_ID = BLOCK_COMMENT_ID + 1; 53 public static final int DECLARATION_ID = SGML_COMMENT_ID + 1; 54 public static final int CHARACTER_ID = DECLARATION_ID + 1; 55 public static final int EOL_ID = CHARACTER_ID + 1; 56 public static final int TAG_OPEN_SYMBOL_ID = EOL_ID + 1; public static final int TAG_CLOSE_SYMBOL_ID = TAG_OPEN_SYMBOL_ID + 1; 59 public static final int TAG_CATEGORY_ID = TAG_CLOSE_SYMBOL_ID + 1; 61 62 63 public static final BaseTokenCategory TAG_CATEGORY 64 = new BaseTokenCategory("tag", TAG_CATEGORY_ID); 66 67 69 public static final BaseTokenID TEXT = new BaseTokenID( "text", TEXT_ID ); 71 public static final BaseTokenID WS = new BaseTokenID( "ws", WS_ID ); 73 public static final BaseTokenID ERROR = new BaseTokenID( "error", ERROR_ID ); 75 public static final BaseTokenID TAG_OPEN = new BaseTokenID( "open-tag", TAG_OPEN_ID, TAG_CATEGORY ); 77 public static final BaseTokenID TAG_CLOSE = new BaseTokenID( "close-tag", TAG_CLOSE_ID, TAG_CATEGORY ); 79 public static final BaseTokenID ARGUMENT = new BaseTokenID( "argument", ARGUMENT_ID ); 81 public static final BaseTokenID OPERATOR = new BaseTokenID( "operator", OPERATOR_ID ); 83 public static final BaseTokenID VALUE = new BaseTokenID( "value", VALUE_ID ); 85 public static final BaseTokenID BLOCK_COMMENT = new BaseTokenID( "block-comment", BLOCK_COMMENT_ID ); 87 public static final BaseTokenID SGML_COMMENT = new BaseTokenID( "sgml-comment", SGML_COMMENT_ID ); 89 public static final BaseTokenID DECLARATION = new BaseTokenID( "sgml-declaration", DECLARATION_ID ); 91 public static final BaseTokenID CHARACTER = new BaseTokenID( "character", CHARACTER_ID ); 93 public static final BaseTokenID EOL = new BaseTokenID( "EOL", EOL_ID ); 95 public static final BaseTokenID TAG_OPEN_SYMBOL = new BaseTokenID("tag-open-symbol", TAG_OPEN_SYMBOL_ID, TAG_CATEGORY); 97 public static final BaseTokenID TAG_CLOSE_SYMBOL = new BaseTokenID("tag-close-symbol", TAG_CLOSE_SYMBOL_ID, TAG_CATEGORY); 99 public static final HTMLTokenContext context = new HTMLTokenContext(); 101 102 public static final TokenContextPath contextPath = context.getContextPath(); 103 104 105 private HTMLTokenContext() { 106 super("html-"); 108 try { 109 addDeclaredTokenIDs(); 110 } catch (Exception e) { 111 Utilities.annotateLoggable(e); 112 } 113 114 } 115 116 } 117 | Popular Tags |