Package org.eclipse.jface.text.rules

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


    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) {
        /* this should be the case only for FTL text */
        rules.add(rule);
      }
    }
 
View Full Code Here


    fTokenOffset= fOffset;
    fColumn= UNDEFINED;

    IToken token;
    for (IRule r : fRules) {
      IPredicateRule rule = (IPredicateRule) r;
      token= rule.getSuccessToken();
      if (token.getData().equals(contentType)) {
        token = rule.evaluate(this, true);
        if (token.isEOF() || !token.isUndefined()) {
          return token;
        }
      }
    }
View Full Code Here

  public TargetPartitionScanner createPartitionScanner() {

    XmlPartitionType[] partitiontTypes = XmlPartitionType.values();
    List<IPredicateRule> rules = new ArrayList<IPredicateRule>(partitiontTypes.length);
    for (XmlPartitionType xmlPartitionType : partitiontTypes) {
      IPredicateRule rule = xmlPartitionType.createPartitioningRule();
      if (rule != null) {
        rules.add(rule);
      }
    }
    RuleBasedTargetPartitionScanner result = new RuleBasedTargetPartitionScanner();
View Full Code Here

      boolean resume= (this.fPartitionOffset > -1 && this.fPartitionOffset < this.fOffset);
      // Set the token offset according to whether we're in a partition or not.
      this.fTokenOffset= resume ? this.fPartitionOffset : this.fOffset;
     
     
      IPredicateRule rule;
      IToken token;
      // Run through all the rules looking for a match.
      for (int i= 0; i < this.fRules.length; i++) {
        rule= (IPredicateRule) this.fRules[i];
        /*
         * Get the success token for this rule so we can
         * check if it matches the current content type.
         */
        token = rule.getSuccessToken();
        //System.out.println("Checking if content type - " + fContentType + " matches " + token.getData());
        if (this.fContentType.equals(token.getData().toString())
                || this.fContentType.equals(token.getData().toString() + "_begin")
                || this.fContentType.equals(token.getData().toString() + "_end")
                || this.fContentType.equals(token.getData().toString() + "_attribs")) {
          // The content type matches, so we want to run the resume on the rule.
          token= rule.evaluate(this, resume);
          if (!token.isUndefined()) {
              this.fContentType= null;
            return token;
          }
        }
View Full Code Here

TOP

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

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.