当前位置: 首页>>代码示例>>Java>>正文


Java EndOfLineRule类代码示例

本文整理汇总了Java中org.eclipse.jface.text.rules.EndOfLineRule的典型用法代码示例。如果您正苦于以下问题:Java EndOfLineRule类的具体用法?Java EndOfLineRule怎么用?Java EndOfLineRule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EndOfLineRule类属于org.eclipse.jface.text.rules包,在下文中一共展示了EndOfLineRule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RelationModelPartitionScanner

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
public RelationModelPartitionScanner() {
  final IToken commentPartition = new Token(RelationModelPartitionScanner.RELATION_MODEL_COMMENT);
  final IToken optionPartition = new Token(RelationModelPartitionScanner.RELATION_MODEL_OPTION);
  final IToken universePartition =
      new Token(RelationModelPartitionScanner.RELATION_MODEL_UNIVERSE);
  final IToken relBoundPartition =
      new Token(RelationModelPartitionScanner.RELATION_MODEL_REL_BOUND);

  final List<IRule> rules = new ArrayList<IRule>();
  rules.add(new MultiLineRule("/**", "**/", commentPartition));
  rules.add(new EndOfLineRule("--", commentPartition));
  // rules.add(new EndOfLineRule("//", commentPartition));
  rules.add(new MultiLineRule("options {", "}", optionPartition));
  rules.add(new MultiLineRule("universe {", "}", universePartition));
  rules.add(new MultiLineRule("universe [", "]", universePartition));
  rules.add(new RelationBoundsRule("relations", "}", relBoundPartition));

  final IPredicateRule[] result = new IPredicateRule[rules.size()];
  rules.toArray(result);
  this.setPredicateRules(result);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:22,代码来源:RelationModelPartitionScanner.java

示例2: ModelScanner

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
public ModelScanner(final ColorManager colorManager) {

    final IToken bracketsToken =
        new Token(new TextAttribute(colorManager.getColor(IValidationColorConstants.BRACKETS)));
    final IToken commToken =
        new Token(new TextAttribute(colorManager.getColor(IValidationColorConstants.COMMENT)));

    final List<IRule> rules = new ArrayList<>();

    rules.add(new WhitespaceRule(new ValidationWhitespaceDetector()));
    rules.add(new BracketsRule(bracketsToken));
    rules.add(new MultiLineRule("/**", "**/", commToken));
    rules.add(new EndOfLineRule("--", commToken));

    final IRule[] result = new IRule[rules.size()];
    rules.toArray(result);
    this.setRules(result);
  }
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:19,代码来源:ModelScanner.java

示例3: EiffelPartitionScanner

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
public EiffelPartitionScanner() {
	super();
	
	IToken multilineComment = new Token(MULTILINE_COMMENT);
	IToken singlelineComment = new Token(SINGLELINE_COMMENT);
	IToken string = new Token(STRING);
	
	List<Object> rules = new ArrayList<>();
	
	//Add rule for single line comments.
	rules.add(new EndOfLineRule("--", singlelineComment));
	
	// Add rule for strings and character constants.
	rules.add(new SingleLineRule("\"", "\"", string, '\\'));
	rules.add(new SingleLineRule("'", "'", string, '\\'));
	
	//Add rules for multi-line comments and eiffeldocs
	rules.add(new MultiLineRule("--[[", "]]", multilineComment, (char) 0, true));
	
	IPredicateRule[] result = new IPredicateRule[rules.size()];
	rules.toArray(result);
	setPredicateRules(result);
}
 
开发者ID:Imhotup,项目名称:LibertyEiffel-Eclipse-Plugin,代码行数:24,代码来源:EiffelPartitionScanner.java

示例4: SqlCommentPartitionScanner

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
private SqlCommentPartitionScanner() {
	IToken commentToken = new Token(SQL_COMMENT);

	List<IPredicateRule> rules= new ArrayList<>();

	rules.add(new EndOfLineRule("--", commentToken, '\\'));
	rules.add(new MultiLineRule("/*", "*/", commentToken, '\\'));
	
	rules.add(new WordPredicateRule(commentToken));
	rules.add(new SingleLineRule("\"", "\"", Token.UNDEFINED, '\\')); 
	rules.add(new SingleLineRule("'", "'", Token.UNDEFINED, '\\'));

	IPredicateRule[] result= new IPredicateRule[rules.size()];
	rules.toArray(result);
	setPredicateRules(result);
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:17,代码来源:SqlCommentPartitionScanner.java

示例5: TexArgScanner

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
/**
 * A default constructor.
 * @param manager
 */
public TexArgScanner(ColorManager manager) {
    IToken commentToken = new Token(new TextAttribute(manager
            .getColor(ColorManager.COMMENT),
            null,
            manager.getStyle(ColorManager.COMMENT_STYLE)));

    //Commands are colored in argument color with command styles 
    IToken commandToken = new Token(
            new TextAttribute(
                    manager.getColor(ColorManager.CURLY_BRACKETS),
                    null,
                    manager.getStyle(ColorManager.COMMAND_STYLE)));

    List<IRule> rules = new ArrayList<IRule>();
    rules.add(new EndOfLineRule("%", commentToken, '\\'));
    rules.add(new WhitespaceRule(new WhitespaceDetector()));
    rules.add(new WordRule(new TexWord(), commandToken));

    IRule[] result = new IRule[rules.size()];
    rules.toArray(result);
    setRules(result);
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:27,代码来源:TexArgScanner.java

示例6: TexOptArgScanner

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
/**
 * A default constructor.
 * @param manager
 */
public TexOptArgScanner(ColorManager manager) {
    IToken commentToken = new Token(new TextAttribute(manager
            .getColor(ColorManager.COMMENT),
            null,
            manager.getStyle(ColorManager.COMMENT_STYLE)));

    //Commands are colored in argument color with command styles 
    IToken commandToken = new Token(
            new TextAttribute(
                    manager.getColor(ColorManager.SQUARE_BRACKETS),
                    null,
                    manager.getStyle(ColorManager.COMMAND_STYLE)));

    List<IRule> rules = new ArrayList<IRule>();
    rules.add(new EndOfLineRule("%", commentToken, '\\'));
    rules.add(new WhitespaceRule(new WhitespaceDetector()));
    rules.add(new WordRule(new TexWord(), commandToken));

    IRule[] result = new IRule[rules.size()];
    rules.toArray(result);
    setRules(result);
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:27,代码来源:TexOptArgScanner.java

示例7: createRules

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
@Override
protected List<IRule> createRules() {
	IToken keywordToken = getToken(Prefs.EDITOR_MATH_KEYWORD_COLOR);
	IToken symbolToken = getToken(Prefs.EDITOR_MATH_SYMBOL_COLOR);
	IToken commentToken = getToken(Prefs.EDITOR_MATH_COMMENT_COLOR);
	// IToken defaultToken = getToken(Prefs.EDITOR_DEFAULT_COLOR);

	WordRule wordRule = new WordRule(new MathWordDetector(), keywordToken, true);
	WordRule symbolRule = new WordRule(new MathSymbolDetector(), symbolToken, true);

	List<IRule> rules = new ArrayList<IRule>();
	rules.add(wordRule);
	rules.add(symbolRule);
	rules.add(new EndOfLineRule("%", commentToken));
	rules.add(new WhitespaceRule(new WhitespaceDetector()));
	return rules;
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:18,代码来源:ScannerMath.java

示例8: DMScanner

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
public DMScanner(final ColorManager manager)
{
	final IToken dmPreprocessor						= new Token(new TextAttribute(manager.getColor(IDMColorConstants.DM_PREPROCESSOR)));
	final IToken keyword							= new Token(new TextAttribute(manager.getColor(IDMColorConstants.KEYWORD)));
	final IToken defaultToken						= new Token(new TextAttribute(manager.getColor(IDMColorConstants.DEFAULT)));
	final IToken numberToken						= new Token(new TextAttribute(manager.getColor(IDMColorConstants.NUMBER)));

	final IRule[] rules								= new IRule[4];
	//Add rule for processing instructions
	rules[0]										= new EndOfLineRule("#", dmPreprocessor);
	// Add generic whitespace rule.
	rules[1]										= new WhitespaceRule(new DMWhitespaceDetector());
	// Add keyword detection
	rules[2]										= new DMKeywordRule(keyword, defaultToken, false);
	// Add number detection
	rules[3]										= new FloatRule(numberToken);

	this.setRules(rules);
}
 
开发者ID:nullquery,项目名称:BYONDclipse,代码行数:20,代码来源:DMScanner.java

示例9: createRules

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
/**
 * Creates the list of <code>IRule</code>.
 * If you have to customize rules, override this method.
 *
 * @return the list of <code>IRule</code>
 */
protected List<IRule> createRules() {
    IToken normal  = new Token(new TextAttribute(new Color(Display.getCurrent(),
            IHTMLColorConstants.FOREGROUND)));
    IToken string  = new Token(new TextAttribute(new Color(Display.getCurrent(),
            IHTMLColorConstants.JAVA_STRING)));
    IToken comment = new Token(new TextAttribute(new Color(Display.getCurrent(),
            IHTMLColorConstants.JAVA_COMMENT)));
    IToken keyword = new Token(new TextAttribute(new Color(Display.getCurrent(),
            IHTMLColorConstants.JAVA_KEYWORD)));
    List<IRule> rules = new ArrayList<IRule>();
    rules.add(new SingleLineRule("\"", "\"", string, '\\'));
    rules.add(new SingleLineRule("'", "'", string, '\\'));
    rules.add(new SingleLineRule("\\//", null, normal));
    rules.add(new EndOfLineRule("//", comment));
    WordRule wordRule = new WordRule(new JavaWordDetector(), normal);
    for (int i = 0; i < KEYWORDS.length; i++) {
        wordRule.addWord(KEYWORDS[i], keyword);
    }
    rules.add(wordRule);
    return rules;
}
 
开发者ID:apache,项目名称:syncope,代码行数:28,代码来源:JavaScriptScanner.java

示例10: ApexPartitionScanner

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
/**
 * Creates the partitioner and sets up the appropriate rules.
 */
public ApexPartitionScanner() {
    super();

    IToken comment = new Token(APEX_MULTILINE_COMMENT);

    List<IPredicateRule> rules = new ArrayList<>();

    // Add rule for single line comments.
    rules.add(new EndOfLineRule("//", Token.UNDEFINED));

    // Add rule for strings and character constants.
    rules.add(new SingleLineRule("\"", "\"", Token.UNDEFINED, '\\'));
    rules.add(new SingleLineRule("'", "'", Token.UNDEFINED, '\\'));

    // Add special case word rule.
    rules.add(new WordPredicateRule(comment));

    // Add rules for multi-line comments.
    rules.add(new MultiLineRule("/*", "*/", comment, (char) 0, true));

    IPredicateRule[] result = new IPredicateRule[rules.size()];
    rules.toArray(result);
    setPredicateRules(result);
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:28,代码来源:ApexPartitionScanner.java

示例11: RustPartitionScanner

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
/**
 * Creates the partitioner and sets up the appropriate rules.
 */
public RustPartitionScanner() {
	super();

	IToken javaDoc= new Token(HOT_DOC);
	IToken comment= new Token(RUST_MULTILINE_COMMENT);
	IToken other= new Token(RUST_OTHER);

	List<IPredicateRule> rules= new ArrayList<>();

	// Add rule for single line comments.
	rules.add(new EndOfLineRule("//", other)); //$NON-NLS-1$

	// Add rule for strings and character constants.
	rules.add(new SingleLineRule("\"", "\"", other, '\\')); //$NON-NLS-2$ //$NON-NLS-1$

	// Add special case word rule.
	rules.add(new WordPredicateRule(comment));

	// Add rules for multi-line comments and javadoc.
	rules.add(new MultiLineRule("/**", "*/", javaDoc, (char) 0, true)); //$NON-NLS-1$ //$NON-NLS-2$
	rules.add(new MultiLineRule("/*", "*/", comment, (char) 0, true)); //$NON-NLS-1$ //$NON-NLS-2$

	setPredicateRules(rules.toArray(new IPredicateRule[rules.size()]));
}
 
开发者ID:peq,项目名称:rustyeclipse,代码行数:28,代码来源:RustPartitionScanner.java

示例12: createRules

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
@Override
protected List<IRule> createRules() {
  List<IRule> rules = new ArrayList<IRule>();
  IToken keyword = this.getToken(GnColorConstants.GN_KEYWORD);
  IToken numberToken = getToken(GnColorConstants.GN_NUMBER);
  IToken comment = this.getToken(GnColorConstants.GN_COMMENT);
  IToken other = this.getToken(GnColorConstants.GN_DEFAULT);

  rules.add(new EndOfLineRule("#", comment));
  rules.add(new WhitespaceRule(new GnWhitespaceDetector()));

  WordRule wordRule = new WordRule(new GnWordDetector(), other);
  for (int i = 0; i < GnCodeUtil.KEYWORDS.length; i++) {
    wordRule.addWord(GnCodeUtil.KEYWORDS[i], keyword);
  }
  rules.add(wordRule);

  NumberRule numberRule = new NumberRule(numberToken);
  rules.add(numberRule);

  this.setDefaultReturnToken(other);
  return rules;
}
 
开发者ID:chromium,项目名称:eclipse-gn,代码行数:24,代码来源:GnCodeScanner.java

示例13: SQLPartitionScanner

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
/**
 *  
 */
public SQLPartitionScanner( )
{
	super( );
	IToken sqlComment = new Token( COMMENT );
	IToken sqlQuoteString = new Token( QUOTE_STRING );

	
	ArrayList rules = new ArrayList( );
	rules.add( new MultiLineRule( "\"", "\"", sqlQuoteString, '\\' ) ); //$NON-NLS-1$ //$NON-NLS-2$
	rules.add( new MultiLineRule( "\'", "\'", sqlQuoteString, '\\' ) ); //$NON-NLS-1$ //$NON-NLS-2$
	rules.add( new EndOfLineRule( "//", sqlComment ) ); //$NON-NLS-1$
	rules.add( new EndOfLineRule( "--", sqlComment ) ); //$NON-NLS-1$
	rules.add( new MultiLineRule( "/*", "*/", sqlComment ) ); //$NON-NLS-1$ //$NON-NLS-2$
	
	setPredicateRules( (IPredicateRule[]) rules.toArray( new IPredicateRule[rules.size( )] ) );

}
 
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:SQLPartitionScanner.java

示例14: SamplePartitionScanner

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
/**
 * Creates the partitioner and sets up the appropriate rules.
 */
public SamplePartitionScanner() {
	IToken tkString = new Token(LANG_STRING);
	IToken tkRawString = new Token(LANG_RAW_STRING);
	IToken tkCharacter = new Token(LANG_CHARACTER);
	IToken tkSingleComment = new Token(LANG_SINGLE_COMMENT);
	IToken tkMultiComment = new Token(LANG_MULTI_COMMENT);
	
	List<IPredicateRule> rules = new ArrayList<IPredicateRule>();
	
	rules.add(new MultiLineRule("`", "`", tkRawString, NO_ESCAPE, true));
	rules.add(new MultiLineRule("\"", "\"", tkString, '\\', true));
	rules.add(new SingleLineRule("'", "'", tkCharacter, '\\', true));
	
	rules.add(new EndOfLineRule("//", tkSingleComment, NO_ESCAPE));
	
	rules.add(new MultiLineRule("/*", "*/", tkMultiComment, NO_ESCAPE, true));
	
	
	setPredicateRules(rules.toArray(new IPredicateRule[rules.size()]));
}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:24,代码来源:SamplePartitionScanner.java

示例15: createKspPartitionScanner

import org.eclipse.jface.text.rules.EndOfLineRule; //导入依赖的package包/类
private IPartitionTokenScanner createKspPartitionScanner() {
	RuleBasedPartitionScanner scanner = new RuleBasedPartitionScanner();
	scanner.setPredicateRules(new IPredicateRule[] {
	/* String entre double quote. */
	new PatternRule("\"", "\"", new Token(KspRegionType.STRING.getContentType()), '\\', false),
	/* Commentaire multi-lignes */
	new PatternRule("/*", "*/", new Token(KspRegionType.COMMENT.getContentType()), '\\', false),
	/* Commentaire fin de ligne */
	new EndOfLineRule("//", new Token(KspRegionType.COMMENT.getContentType())) });
	return scanner;
}
 
开发者ID:sebez,项目名称:vertigo-chroma-kspplugin,代码行数:12,代码来源:KspDocumentSetupParticipant.java


注:本文中的org.eclipse.jface.text.rules.EndOfLineRule类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。