本文整理汇总了Java中org.fife.ui.rsyntaxtextarea.Token.COMMENT_EOL属性的典型用法代码示例。如果您正苦于以下问题:Java Token.COMMENT_EOL属性的具体用法?Java Token.COMMENT_EOL怎么用?Java Token.COMMENT_EOL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.fife.ui.rsyntaxtextarea.Token
的用法示例。
在下文中一共展示了Token.COMMENT_EOL属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addToken
/**
* Checks the token to give it the exact ID it deserves before being passed
* up to the super method.
*
* @param segment <code>Segment</code> to get text from.
* @param start Start offset in <code>segment</code> of token.
* @param end End offset in <code>segment</code> of token.
* @param tokenType The token's type.
* @param startOffset The offset in the document at which the token occurs.
*/
@Override
public void addToken(Segment segment, int start, int end, int tokenType, int startOffset) {
switch (tokenType) {
// Since reserved words, functions, and data types are all passed
// into here as "identifiers," we have to see what the token
// really is...
case Token.IDENTIFIER:
int value = this.wordsToHighlight.get(segment, start, end);
if (value != -1) {
tokenType = value;
}
break;
case Token.WHITESPACE:
case Token.SEPARATOR:
case Token.OPERATOR:
case Token.ERROR_IDENTIFIER:
case Token.ERROR_NUMBER_FORMAT:
case Token.ERROR_STRING_DOUBLE:
case Token.ERROR_CHAR:
case Token.COMMENT_EOL:
case Token.COMMENT_MULTILINE:
case Token.LITERAL_BOOLEAN:
case Token.LITERAL_NUMBER_DECIMAL_INT:
case Token.LITERAL_NUMBER_FLOAT:
case Token.LITERAL_NUMBER_HEXADECIMAL:
case Token.LITERAL_STRING_DOUBLE_QUOTE:
case Token.LITERAL_CHAR:
break;
default:
throw new IllegalArgumentException("Unknown tokenType: '" + tokenType + "'");
}
super.addToken(segment, start, end, tokenType, startOffset);
}