Package org.eclipse.jface.text.rules

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


  private void initCommands(){ 
    _commandList = CommandList.getCommands();
   
  }
  public TMLScriptScanner() {   
    IToken string = new Token(TextStyles.STRING);
 
    initCommands();   

    List<IRule> rules = new ArrayList<IRule>();
    rules.add(createCommandRule());   
View Full Code Here


 
 
 
 
  private IRule createCommandRule() {
    IToken keyword = new Token(TextStyles.STYLE_TMLSCRIPT_KEYWORD);

    WordRule wordRule= new WordRule(new JavaScriptWordDetector(), new Token(TextStyles.STYLE_DEFAULT));

     
      Iterator<String> iter = _commandList.iterator();
     
      while (iter.hasNext()){       
View Full Code Here

   
   
    _ruleScanner = new RuleBasedPartitionScanner();
    _ruleScanner.setPredicateRules(rules.toArray(new IPredicateRule[0]));   
   
    setDefaultReturnToken(new Token(TMLSCRIPT));
  }
View Full Code Here

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

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

  protected RSScanner getVSScanner() {
    if (scanner == null) {
      scanner = new RSScanner(colorManager);
      scanner.setDefaultReturnToken(
        new Token(
          new TextAttribute(
            colorManager.getColor(IRSColorConstants.DEFAULT))));
    }
    return scanner;
  }
View Full Code Here

        }
        gotten = true;
        if (text == null) {
            return Token.EOF;
        }
        return new Token(getAttribute(text));
    }
View Full Code Here

public class ErlCommentScanner extends ErlTokenScanner {

    public ErlCommentScanner(final IColorManager colorManager) {
        super(colorManager);
        final Token defaultToken = ErlTokenScanner.getToken(TokenHighlight.COMMENT
                .getName());
        setDefaultReturnToken(defaultToken);

        final Token edocTag = ErlTokenScanner.getToken(TokenHighlight.EDOC_TAG.getName());
        final Token htmlTag = ErlTokenScanner.getToken(TokenHighlight.HTML_TAG.getName());

        final List<IRule> rulesList = Lists.newArrayList();
        rulesList.add(new WordRule(new EdocTagDetector(), edocTag));
        rulesList.add(new SingleLineRule("<", ">", htmlTag));
        final WordRule taskRule = new WordRule(new IWordDetector() {
View Full Code Here

public class ErlStringScanner extends ErlTokenScanner {

    public ErlStringScanner(final IColorManager colorManager) {
        super(colorManager);
        final Token defaultToken = ErlTokenScanner.getToken(TokenHighlight.STRING
                .getName());
        setDefaultReturnToken(defaultToken);

        final Token tildeTag = ErlTokenScanner.getToken(TokenHighlight.TILDE_TAG
                .getName());
        final Token escapeTag = ErlTokenScanner.getToken(TokenHighlight.ESCAPE_TAG
                .getName());

        final List<IRule> rulesList = Lists.newArrayList();
        rulesList.add(new RegexpRule("~[0-9*]*(\\.[0-9*]+)?.?t?[~cfegswWpPBbXx#+ni]",
                tildeTag));
View Full Code Here

public class ErlangPartitionScanner extends RuleBasedPartitionScanner {

    public ErlangPartitionScanner() {
        super();
        final IToken character = new Token(IErlangPartitions.ERLANG_CHARACTER);
        final IToken string = new Token(IErlangPartitions.ERLANG_STRING);
        final IToken comment = new Token(IErlangPartitions.ERLANG_COMMENT);
        final IToken qatom = new Token(IErlangPartitions.ERLANG_QATOM);

        final List<IRule> rules = Lists.newArrayList();
        rules.add(new ErlangCharRule(character));
        rules.add(new EndOfLineRule("%", comment));
        rules.add(new MultiLineRule("\"", "\"", string, '\\', true));
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.