Package org.eclipse.jface.text.rules

Examples of org.eclipse.jface.text.rules.RuleBasedPartitionScanner


    List<IPredicateRule> rules = new ArrayList<IPredicateRule>();       
    rules.add(new TMLScriptMultiLineCommentRule());
    rules.add(new TMLScriptSingelLineCommentRule())
   
   
    _ruleScanner = new RuleBasedPartitionScanner();
    _ruleScanner.setPredicateRules(rules.toArray(new IPredicateRule[0]));   
   
    setDefaultReturnToken(new Token(TMLSCRIPT));
  }
View Full Code Here


      IConsoleDocumentPartitioner {

    private TextConsole console;

    public MM(TextConsole console) {
      super(new RuleBasedPartitionScanner(),
          new String[] { IDocument.DEFAULT_CONTENT_TYPE });
      this.console = console;
    }
View Full Code Here

   *
   * @see org.jboss.ide.eclipse.freemarker.target.TargetLanguageSupport#createColoringScanner(java.lang.String)
   */
  @Override
  public ITokenScanner createColoringScanner(String partitionType) {
    RuleBasedPartitionScanner result = new RuleBasedPartitionScanner();
    result.setDefaultReturnToken(PartitionType
        .createColoringToken(PreferenceKey.COLOR_TEXT));
    return result;
  }
View Full Code Here

  /**
   * Creates a new partition scanner.
   */
  public PartitionScanner() {

    this.delegate = new RuleBasedPartitionScanner();
    PartitionType[] partitionTypes = PartitionType.values();
    List<IPredicateRule> rules = new ArrayList<IPredicateRule>(partitionTypes.length);
    for (PartitionType partitionType : partitionTypes) {
      IPredicateRule rule = partitionType.createPartitioningRule();
      if (rule != null) {
View Full Code Here

    partitioner.connect(document);
    return document;
  }
 
  private IDocumentPartitioner createPartitioner(ITextEntityRenderer renderer) {
    final RuleBasedPartitionScanner scanner = new RuleBasedPartitionScanner();
    scanner.setPredicateRules(createRules(renderer));
    if(renderer != null && renderer.getDefaultPartitionType() != null) {
      scanner.setDefaultReturnToken(new Token(renderer.getDefaultPartitionType()));
    }
    return new FastPartitioner(scanner, getPartitionTypes(renderer));
  }
View Full Code Here

  protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
      IDocumentPartitioner partitioner =
        new GherkinPartitioner(
          new RuleBasedPartitionScanner(),
          new String[] { IDocument.DEFAULT_CONTENT_TYPE });
      partitioner.connect(document);
      document.setDocumentPartitioner(partitioner);
    }
    return document;
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.rules.RuleBasedPartitionScanner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.