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


Java MultiLineRule类代码示例

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


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

示例1: RelationModelPartitionScanner

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的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.MultiLineRule; //导入依赖的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: addGroovyRules

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的package包/类
protected void addGroovyRules(List<IPredicateRule> rules) {
	IToken groovyAnnotation = createToken(ANNOTATION);
	IToken javaDocComment = createToken(GROOVY_DOC);
	IToken groovyComment = createToken(COMMENT);
	IToken groovySimpleString = createToken(STRING);
	IToken groovyGString = createToken(GSTRING);
	IToken groovyKeyWord = createToken(GROOVY_KEYWORD);
	IToken javaKeyWord = createToken(JAVA_KEYWORD);
	IToken javaLiteral = createToken(JAVA_LITERAL);

	rules.add(new MultiLineRule("/**", "*/", javaDocComment));
	rules.add(new MultiLineRule("/*", "*/", groovyComment));
	rules.add(new SingleLineRule("//", "", groovyComment));

	rules.add(new MultiLineRule("\"", "\"", groovyGString, '\\'));
	rules.add(new MultiLineRule("\'", "\'", groovySimpleString, '\\'));

	buildWordRules(rules, javaKeyWord, JavaKeyWords.values(), javaWordDetector);
	buildWordRules(rules, javaLiteral, JavaLiteralKeyWords.values(), javaWordDetector);

	buildWordRules(rules, groovyKeyWord, GroovyKeyWords.values(), javaWordDetector);

	buildAnnotationRules(rules, groovyAnnotation, onlyAnnotationWordDetector);
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:25,代码来源:AbstractGroovyBasedDocumentPartitionScanner.java

示例4: EiffelPartitionScanner

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的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

示例5: XMLPartitionScanner

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的package包/类
public XMLPartitionScanner() {

      IToken xmlComment = new Token(XML_COMMENT);
      IToken xmlPI = new Token(XML_PI);
      IToken startTag = new Token(XML_START_TAG);
      IToken endTag = new Token(XML_END_TAG);
      IToken docType = new Token(XML_DOCTYPE);
      IToken text = new Token(XML_TEXT);

      IPredicateRule[] rules = new IPredicateRule[7];

      rules[0] = new NonMatchingRule();
      rules[1] = new MultiLineRule("<!--", "-->", xmlComment);
      rules[2] = new MultiLineRule("<?", "?>", xmlPI);
      rules[3] = new MultiLineRule("</", ">", endTag);
      rules[4] = new StartTagRule(startTag);
      rules[5] = new MultiLineRule("<!DOCTYPE", ">", docType);
      rules[6] = new XMLTextPredicateRule(text);

      setPredicateRules(rules);
   }
 
开发者ID:nextinterfaces,项目名称:http4e,代码行数:22,代码来源:XMLPartitionScanner.java

示例6: SqlCommentPartitionScanner

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的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

示例7: XMLPartitionScanner

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的package包/类
public XMLPartitionScanner() {

		IToken xmlComment = new Token(XML_COMMENT);
		IToken xmlPI = new Token(XML_PI);
		IToken startTag = new Token(XML_START_TAG);
		IToken endTag = new Token(XML_END_TAG);
		IToken docType = new Token(XML_DOCTYPE);
		// IToken text = new Token(XML_TEXT);
		// IToken tag = new Token(XML_TAG);

		IPredicateRule[] rules = new IPredicateRule[6];

		rules[0] = new NonMatchingRule();
		rules[1] = new MultiLineRule("<!--", "-->", xmlComment, '\\', true);
		rules[2] = new MultiLineRule("<?", "?>", xmlPI);
		rules[3] = new MultiLineRule("</", ">", endTag);
		rules[4] = new StartTagRule(startTag);
		rules[5] = new MultiLineRule("<!DOCTYPE", ">", docType);

		// rules[6] = new XMLTextPredicateRule(text);
		// rules[7] = new TagRule(tag);

		setPredicateRules(rules);
	}
 
开发者ID:ncleclipse,项目名称:ncl30-eclipse,代码行数:25,代码来源:XMLPartitionScanner.java

示例8: PartitionScanner

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的package包/类
public PartitionScanner() {
	super();

	IToken matter = new Token(Partitions.FRONT_MATTER);
	IToken comment = new Token(Partitions.COMMENT);
	IToken codeblock = new Token(Partitions.CODEBLOCK);
	IToken htmlblock = new Token(Partitions.HTMLBLOCK);
	IToken dotblock = new Token(Partitions.DOTBLOCK);
	IToken mathblock = new Token(Partitions.MATHBLOCK);

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

	rules.add(new FrontMatterRule("---", "---", matter, '\\'));
	rules.add(new MatchRule("\\$\\S", "\\S\\$", mathblock, '\\', false));
	rules.add(new MultiLineRule("$$", "$$", mathblock, '\\'));
	rules.add(new MultiLineRule("<!--", "-->", comment, '\\'));
	rules.add(new HtmlCodeRule(htmlblock));
	rules.add(new DotCodeRule(dotblock));
	rules.add(new MultiLineRule("~~~", "~~~", codeblock, '\\'));
	rules.add(new MultiLineRule("```", "```", codeblock, '\\'));
	rules.add(new IndentedCodeRule(codeblock));

	IPredicateRule[] rule = new IPredicateRule[rules.size()];
	setPredicateRules(rules.toArray(rule));
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:26,代码来源:PartitionScanner.java

示例9: XMLScanner

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的package包/类
public XMLScanner(ColorManager manager) {
	IToken procInstr =
		new Token(
			new TextAttribute(
				manager.getColor(IXMLColorConstants.PROC_INSTR)));
	IToken docType =
		new Token(
			new TextAttribute(
				manager.getColor(IXMLColorConstants.DOCTYPE)));

	IRule[] rules = new IRule[3];
	//Add rule for processing instructions and doctype
	rules[0] = new MultiLineRule("<?", "?>", procInstr);
	rules[1] = new MultiLineRule("<!DOCTYPE", ">", docType);
	// Add generic whitespace rule.
	rules[2] = new WhitespaceRule(new XMLWhitespaceDetector());

	setRules(rules);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:20,代码来源:XMLScanner.java

示例10: XMLPartitionScanner

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的package包/类
public XMLPartitionScanner()
{

	IToken xmlComment = new Token(XML_COMMENT);
	IToken xmlPI = new Token(XML_PI);
	IToken startTag = new Token(XML_START_TAG);
	IToken endTag = new Token(XML_END_TAG);
	IToken docType = new Token(XML_DOCTYPE);
	IToken text = new Token(XML_TEXT);

	IPredicateRule[] rules = new IPredicateRule[7];

	rules[0] = new NonMatchingRule();
	rules[1] = new MultiLineRule("<!--", "-->", xmlComment);
	rules[2] = new MultiLineRule("<?", "?>", xmlPI);
	rules[3] = new MultiLineRule("</", ">", endTag);
	rules[4] = new StartTagRule(startTag);
	rules[5] = new MultiLineRule("<!DOCTYPE", ">", docType);
	rules[6] = new XMLTextPredicateRule(text);

	setPredicateRules(rules);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:23,代码来源:XMLPartitionScanner.java

示例11: XMLTokenScanner

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的package包/类
/**
 * XMLTokenScanner
 */
public XMLTokenScanner()
{
	List<IRule> rules = new ArrayList<IRule>();

	rules.add(new WhitespaceRule(new WhitespaceDetector()));
	rules.add(new MultiLineRule("<!--", "-->", createToken(XMLTokenType.COMMENT))); //$NON-NLS-1$ //$NON-NLS-2$
	rules.add(new DocTypeRule(createToken(XMLTokenType.DOCTYPE), false));
	rules.add(new MultiLineRule("<![CDATA[", "]]>", createToken(XMLTokenType.CDATA))); //$NON-NLS-1$ //$NON-NLS-2$
	rules.add(new TagRule("?xml", createToken(XMLTokenType.DECLARATION))); //$NON-NLS-1$
	rules.add(new TagRule("/", createToken(XMLTokenType.END_TAG))); //$NON-NLS-1$
	rules.add(new TagRule(createToken(XMLTokenType.START_TAG)));

	// text
	IToken token = createToken(XMLTokenType.TEXT);
	rules.add(new WordRule(new WordDetector(), token));

	setRules(rules.toArray(new IRule[rules.size()]));
	setDefaultReturnToken(token);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:23,代码来源:XMLTokenScanner.java

示例12: createTagPartitioner

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的package包/类
protected IDocumentPartitioner createTagPartitioner(IDocument document,
		String[] tags) {
	IPredicateRule[] tagRules = new IPredicateRule[tags.length];
	for (int i = 0; i < tags.length; i++) {
		if (CLOSE_TAG_TOKEN.equals(tags[i])) {
			tagRules[i] = new MultiLineRule("</", ">", new Token(tags[i]));
		} else if (COMMENT_TOKEN.equals(tags[i])) {
			tagRules[i] = new MultiLineRule("<!--", "-->", new Token(
					tags[i]));
		} else {
			tagRules[i] = new MultiLineRule("<" + tags[i], ">", new Token(
					tags[i]));
		}
	}
	return createConnectPartitioner(document, tagRules, tags);
}
 
开发者ID:aleksandr-m,项目名称:strutsclipse,代码行数:17,代码来源:AbstractXmlParser.java

示例13: ApexPartitionScanner

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的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

示例14: MDScanner

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的package包/类
public MDScanner(ColorManager cm) {
this.cm = cm;      
Token heading = new Token(new TextAttribute(cm.getColor(MDColorConstants.HEADER), null, SWT.BOLD));
   Token comment = new Token(new TextAttribute(cm.getColor(MDColorConstants.COMMENT)));
   Token emphasis = new Token(new TextAttribute(cm.getColor(MDColorConstants.DEFAULT), null, SWT.ITALIC));
   setRules(new IRule[] {           
      new HeaderRule(heading),
      new EmphasisRule("_", emphasis),
      new EmphasisRule("***", emphasis),
      new EmphasisRule("**", emphasis),
      new EmphasisRule("*", emphasis),
      new MultiLineRule("<!--", "-->", comment),
      new WhitespaceRule(new IWhitespaceDetector() {
         public boolean isWhitespace(char c) {
            return Character.isWhitespace(c);
         }
      }),
   });
}
 
开发者ID:shvenkat,项目名称:Eclipse-Markdown-Editor-Plugin,代码行数:20,代码来源:MDScanner.java

示例15: RustPartitionScanner

import org.eclipse.jface.text.rules.MultiLineRule; //导入依赖的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


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