Package org.eclipse.jface.text.rules

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


        try {
          int partOffset = currentToken.getOffset() - 1;
          if (partOffset >= 0) {
            ITypedRegion region = _document.getPartition(partOffset);
            if (region != null) {
              previousToken = new TokenBean(new Token(region.getType()), region.getLength(), region.getOffset());
            }
          }
        } catch (BadLocationException e) {
        }
      }
View Full Code Here


    }
    return null;
  }
 
  public static String determineTMLTagName(ITypedRegion region, IDocument document) {
    TokenBean bean = new TokenBean(new Token(region.getType()),  region.getLength(), region.getOffset());
    return determineTMLTagName(bean, document);
  }
View Full Code Here

*
*/
public class TMLStartTagContentScanner extends RuleBasedScanner {

  public TMLStartTagContentScanner() {
    setDefaultReturnToken(new Token(TextStyles.STYLE_ATTRIBUTE));
   
    IToken tag = new Token(TextStyles.STYLE_TML_TAG);
    IToken defaultToken = new Token(TextStyles.STYLE_DEFAULT);
    IToken string = new Token(TextStyles.STRING);
    IToken tmlScriptlet = new Token(TextStyles.TML_SCRIPTLET);   
   
    List<IRule> rules = new ArrayList<IRule>();
   
    rules.add(new SingleLineRule("<", " ", tag, '\\', true));
   
View Full Code Here

*
*/
public class TagScanner extends RuleBasedScanner {

  public TagScanner() { 
    IToken defaultToken = new Token(TextStyles.STYLE_DEFAULT);
    setDefaultReturnToken(defaultToken);
   
    IToken string = new Token(TextStyles.STRING_HTML);
    IToken tag = new Token(TextStyles.STYLE_TAG);
   
    List<IRule> rules = new ArrayList<IRule>();
   
   
   
View Full Code Here

 
  public TMLRuleBasedPartitionScanner() {
    List<IPredicateRule> rules = new ArrayList<IPredicateRule>();       
   
    SingleLineRule mdHeaderRule = new SingleLineRule("##MD", null, new Token(TMLPartitionScanner.TML_METAHEADER), '\\', true);
    mdHeaderRule.setColumnConstraint(0);
    rules.add(mdHeaderRule);
    rules.add(new MultiLineRule("<!--", "-->", new Token(TMLPartitionScanner.COMMENT), '\\', true));
    rules.add(new MultiLineRule("<tml:comment>", "</tml:comment>", new Token(TMLPartitionScanner.TML_COMMENT), '\\', true));
    rules.add(new MultiLineRule("<tml:disable>", "</tml:disable>", new Token(TMLPartitionScanner.TML_DISABLE), '\\', true));
    rules.add(new TagRule("<tml:", ">", new Token(TMLPartitionScanner.TML_TAG_START), '\\', true));
    //rules.add(new MultiLineRule("<tml:", ">", new Token(TMLPartitionScanner.TML_TAG_START), '\\', true));
    rules.add(new SingleLineRule("</tml:", ">", new Token(TMLPartitionScanner.TML_TAG_STOP)));
   
    setPredicateRules(rules.toArray(new IPredicateRule[0]));
  }
View Full Code Here

*
*/
public class TMLEndTagContentScanner extends RuleBasedScanner {

  public TMLEndTagContentScanner() {
    IToken tag = new Token(TextStyles.STYLE_TML_TAG);   
   
   
    List<IRule> rules = new ArrayList<IRule>();
   
    rules.add(new SingleLineRule("<", ">", tag));
View Full Code Here

 

  protected TMLScriptScanner getTMLScriptScanner() {
    if (scanner == null) {
      scanner = new TMLScriptScanner();
      scanner.setDefaultReturnToken(new Token(TextStyles.STYLE_DEFAULT));
    }
    return scanner;
  }
View Full Code Here

import de.innovationgate.eclipse.editors.helpers.CharacterScannerWrapper;

public class TMLScriptMultiLineCommentRule extends MultiLineRule{

  public TMLScriptMultiLineCommentRule() {
    super("/*", "*/", new Token(TMLScriptPartitionScanner.MCOMMENT), '\\', true);
  }
View Full Code Here

import de.innovationgate.eclipse.editors.helpers.CharacterScannerWrapper;

public class TMLScriptSingelLineCommentRule extends SingleLineRule {

  public TMLScriptSingelLineCommentRule() {
    super("//", null, new Token(TMLScriptPartitionScanner.SCOMMENT), '\\', true);
  }
View Full Code Here

        tokens.add(bean);
      }
    } while (!tmptoken.equals(Token.EOF));
   
    List<IToken> typelist = new ArrayList<IToken>();
    typelist.add(new Token(null));
    if (_defaultReturnToken != null) {
      typelist.add(_defaultReturnToken);
    }
    return sumUnknownInTokenList(tokens, typelist);     
  }
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.