本文整理汇总了Java中org.eclipse.jface.text.rules.RuleBasedScanner.setDefaultReturnToken方法的典型用法代码示例。如果您正苦于以下问题:Java RuleBasedScanner.setDefaultReturnToken方法的具体用法?Java RuleBasedScanner.setDefaultReturnToken怎么用?Java RuleBasedScanner.setDefaultReturnToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.text.rules.RuleBasedScanner
的用法示例。
在下文中一共展示了RuleBasedScanner.setDefaultReturnToken方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCommentScanner
import org.eclipse.jface.text.rules.RuleBasedScanner; //导入方法依赖的package包/类
public static final RuleBasedScanner createCommentScanner() {
final TextAttribute attribute = new TextAttribute(
Activator.getDefault().getColor(GlslEditor.COMMENTS_COLOR)
);
final Token commentToken = new Token(attribute);
RuleBasedScanner scanner = new RuleBasedScanner();
scanner.setDefaultReturnToken(commentToken);
scanner.setRules(new IRule[0]);
return scanner;
}
示例2: getStartEndTokenScanner
import org.eclipse.jface.text.rules.RuleBasedScanner; //导入方法依赖的package包/类
private ITokenScanner getStartEndTokenScanner() {
if (startEndTokenScanner == null) {
RuleBasedScanner ts = new RuleBasedScanner();
IToken seqToken = new Token(getStartEndTokenType());
List<IRule> rules = new ArrayList<IRule>();
for (String[] pair : getPartitionerSwitchStrategy().getSwitchTagPairs()) {
rules.add(new SingleTagRule(pair[0], seqToken));
rules.add(new SingleTagRule(pair[1], seqToken));
}
ts.setRules(rules.toArray(new IRule[rules.size()]));
ts.setDefaultReturnToken(new Token("text")); //$NON-NLS-1$
startEndTokenScanner = ts;
}
return startEndTokenScanner;
}
示例3: getCommentScanner
import org.eclipse.jface.text.rules.RuleBasedScanner; //导入方法依赖的package包/类
ITokenScanner getCommentScanner() {
// lazy init
if (this.commentScanner == null) {
final Token comment = new Token(new TextAttribute(JFaceResources.getColorRegistry().get(COMMENT_COLOR)));
// no rules needed, because this will apply to comment partition
// only
final RuleBasedScanner ruleBasedScanner = new RuleBasedScanner();
// this will apply the syntax
ruleBasedScanner.setDefaultReturnToken(comment);
this.commentScanner = ruleBasedScanner;
}
return commentScanner;
}
示例4: createCommentScanner
import org.eclipse.jface.text.rules.RuleBasedScanner; //导入方法依赖的package包/类
private RuleBasedScanner createCommentScanner() {
RuleBasedScanner commentScanner= new RuleBasedScanner();
commentScanner.setDefaultReturnToken(new Token(
getTextAttribute(prefs, SQLEditorStatementTypes.SINGLE_LINE_COMMENTS)));
return commentScanner;
}
示例5: createMultiCommentScanner
import org.eclipse.jface.text.rules.RuleBasedScanner; //导入方法依赖的package包/类
private RuleBasedScanner createMultiCommentScanner() {
RuleBasedScanner commentScanner= new RuleBasedScanner();
commentScanner.setDefaultReturnToken(new Token(
getTextAttribute(prefs, SQLEditorStatementTypes.MULTI_LINE_COMMENTS)));
return commentScanner;
}
示例6: createCharacterStringLiteralCommentScanner
import org.eclipse.jface.text.rules.RuleBasedScanner; //导入方法依赖的package包/类
private RuleBasedScanner createCharacterStringLiteralCommentScanner() {
RuleBasedScanner commentScanner= new RuleBasedScanner();
commentScanner.setDefaultReturnToken(new Token(
getTextAttribute(prefs, SQLEditorStatementTypes.CHARACTER_STRING_LITERAL)));
return commentScanner;
}