本文整理匯總了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;
}