當前位置: 首頁>>代碼示例>>Java>>正文


Java RuleBasedScanner.setDefaultReturnToken方法代碼示例

本文整理匯總了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;
}
 
開發者ID:Johnnei,項目名稱:GLSL-Eclipse,代碼行數:13,代碼來源:GlslScanners.java

示例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;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:16,代碼來源:CompositeSourceViewerConfiguration.java

示例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;
}
 
開發者ID:abstratt,項目名稱:textuml,代碼行數:14,代碼來源:SyntaxHighlighter.java

示例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;
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:7,代碼來源:SQLEditorSourceViewerConfiguration.java

示例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;
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:7,代碼來源:SQLEditorSourceViewerConfiguration.java

示例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;
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:7,代碼來源:SQLEditorSourceViewerConfiguration.java


注:本文中的org.eclipse.jface.text.rules.RuleBasedScanner.setDefaultReturnToken方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。