Package org.eclipse.jface.text.rules

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


import org.eclipse.jface.text.rules.WhitespaceRule;

public class XMLTagScanner extends RuleBasedScanner {

    public XMLTagScanner(ColorManager manager) {
        IToken string = new Token(new TextAttribute(manager.getColor(IXMLColorConstants.STRING)));

        // CheckStyle:MagicNumber| OFF
        IRule[] rules = new IRule[3];
        // CheckStyle:MagicNumber| ON
View Full Code Here


import org.eclipse.jface.text.rules.WhitespaceRule;

public class XMLScanner extends RuleBasedScanner {

    public XMLScanner(ColorManager manager) {
        IToken procInstr = new Token(new TextAttribute(manager
                .getColor(IXMLColorConstants.PROC_INSTR)));

        IRule[] rules = new IRule[2];
        // Add rule for processing instructions
        rules[0] = new SingleLineRule("<?", "?>", procInstr);
View Full Code Here

    public static final String XML_TAG = "__xml_tag";

    public XMLPartitionScanner() {

        IToken xmlComment = new Token(XML_COMMENT);
        IToken tag = new Token(XML_TAG);

        IPredicateRule[] rules = new IPredicateRule[2];

        rules[0] = new MultiLineRule("<!--", "-->", xmlComment);
        rules[1] = new TagRule(tag);
View Full Code Here

    }

    protected XMLScanner getXMLScanner() {
        if (scanner == null) {
            scanner = new XMLScanner(colorManager);
            scanner.setDefaultReturnToken(new Token(new TextAttribute(colorManager
                    .getColor(IXMLColorConstants.DEFAULT))));
        }
        return scanner;
    }
View Full Code Here

    }

    protected XMLTagScanner getXMLTagScanner() {
        if (tagScanner == null) {
            tagScanner = new XMLTagScanner(colorManager);
            tagScanner.setDefaultReturnToken(new Token(new TextAttribute(colorManager
                    .getColor(IXMLColorConstants.TAG))));
        }
        return tagScanner;
    }
View Full Code Here

  };
  public final static String QVT_KEYWORD = "__qvt_keyword";
 
  public QVTScanner(ColorManager manager) {
    IToken comment =
      new Token(
        new TextAttribute(
          manager.getColor(IQVTColorConstants.QVT_COMMENT)));
   
    IToken keyword = new Token(
        new TextAttribute(
            //manager.getColor(IQVTColorConstants.TAG)));
            manager.getColor(IQVTColorConstants.TEST),null,SWT.BOLD));   
   
    IToken string = new Token(
        new TextAttribute(
            manager.getColor(IQVTColorConstants.STRING)));
   
    IToken defaut = new Token(
        new TextAttribute(
            manager.getColor(IQVTColorConstants.DEFAULT)));
   
    IWordDetector detector = new QVTWordDetector();
    WordRule wr = new WordRule(detector,defaut);
View Full Code Here

      "package", "modeltype", "from", "import", "derived", "literal",
      "configuration", "property", "constructor", "tag", "typedef" };

  public QVTPartitionScanner() {

    IToken qvtcode = new Token(MM_DECLARATION);
    IToken comment = new Token(MM_COMMENT);

    List<PatternRule> ruleListe = new java.util.ArrayList<PatternRule>();

    ruleListe.add(new EndOfLineRule("--", comment));
    ruleListe.add(new EndOfLineRule("//", comment));
View Full Code Here

  }

  protected QVTScanner getQvtScanner() {
    if (scanner == null) {
      scanner = new QVTScanner(colorManager);
      scanner.setDefaultReturnToken(new Token(new TextAttribute(
          colorManager.getColor(IQVTColorConstants.DEFAULT))));
    }
    return scanner;
  }
View Full Code Here

public class TxtSupport implements TargetLanguageSupport {

  @Override
  public TargetPartitionScanner createPartitionScanner() {
    RuleBasedTargetPartitionScanner result = new RuleBasedTargetPartitionScanner();
    result.setDefaultReturnToken(new Token(PartitionType.TEXT.name()));
    return result;
  }
View Full Code Here

        identifierChar);
  }

  public DirectiveRule(String name, String tokenData, boolean nameOnly,
      char identifierChar) {
    super("!", "!", new Token(tokenData)); //$NON-NLS-1$ //$NON-NLS-2$
    this.name = name;
    this.nameOnly = nameOnly;
    this.identifierChar = identifierChar;
  }
View Full Code Here

TOP

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

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.