Package org.eclipse.jface.text.rules

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


    IToken script = provider.getToken(HTMLPlugin.PREF_COLOR_SCRIPT);
    List rules = new ArrayList();
   
    rules.add(new SingleLineRule("\"", "\"", string, '\\'));
    rules.add(new SingleLineRule("\'", "\'", string, '\\'));
    rules.add(new WhitespaceRule(new HTMLWhitespaceDetector()));
   
    WordRule delimitor = new WordRule(new IWordDetector(){
      public boolean isWordStart(char c){
        if(c=='<' || c=='%' || c=='@'){
          return true;
View Full Code Here


   
    IRule[] rules = new IRule[3];
   
    rules[0] = new MultiLineRule("\"" , "\"" , string, '\\');
    rules[1] = new MultiLineRule("'"  , "'"  , string, '\\');
    rules[2] = new WhitespaceRule(new HTMLWhitespaceDetector());
   
    setRules(rules);
  }
View Full Code Here

      new Token(new TextAttribute(manager.getColor(IToolColorConstants.DEFAULT)));
   
    IRule[] rules = new IRule[4];
   
    // Add generic whitespace rule.
    rules[0] = new WhitespaceRule(new ToolWhitespaceDetector());
   
    // Add rule for strings and character constants.
    rules[1] = new SingleLineRule("'", "'", string, '\\');

    WordRule wordRule = new WordRule(new ToolWordDetector(), other, true);
View Full Code Here

    // Add rule for strings and character constants.
    rules.add(new SingleLineRule("\"", "\"", string, '\\'));
    rules.add(new SingleLineRule("'", "'", string, '\\'));

    // Add generic whitespace rule.
    rules.add(new WhitespaceRule(new SQLWhiteSpaceDetector()));

    // Add word rule for keywords, types, and constants.
    WordRule wordRule = new WordRule(new SQLWordDetector(),
        other);
    for (int i = 0; i < reservedwords.length; i++)
View Full Code Here

      new Token(new TextAttribute(manager.getColor(IToolColorConstants.DEFAULT)));
   
    IRule[] rules = new IRule[4];
   
    // Add generic whitespace rule.
    rules[0] = new WhitespaceRule(new ToolWhitespaceDetector());
   
    // Add rule for strings and character constants.
    rules[1] = new SingleLineRule("'", "'", string, '\\');

    WordRule wordRule = new WordRule(new ToolWordDetector(), other, true);
View Full Code Here

        new MultiLineRule("/*", "*/", commentToken, (char) 0, false)//$NON-NLS-1$ //$NON-NLS-2$
        new SingleLineRule("\"", "\"", stringToken, '\\'), //$NON-NLS-1$ //$NON-NLS-2$
        // Regexp
        new SingleLineRule("/", "/", stringToken, '\\'), //$NON-NLS-1$ //$NON-NLS-2$
        new SingleLineRule("'", "'", stringToken, '\\'), //$NON-NLS-1$ //$NON-NLS-2$
        new WhitespaceRule(new IWhitespaceDetector() {
          public boolean isWhitespace(char c) {
            return Character.isWhitespace(c);
          }
        }),

View Full Code Here

 
  public void initializeRules() {
    List rules = new ArrayList();

    // Add generic whitespace rule.
    rules.add(new WhitespaceRule(new JSPELWhitespaceDetector()));

    // Add word rule for keywords, types, and constants.
    WordRule wordRule = new WordRule(new JSPELWordDetector(), fDefaultToken);
    for (int i = 0; i < fgKeywords.length; i++)
      wordRule.addWord(fgKeywords[i], fKeywordToken);
View Full Code Here

    // Add rule for strings.
    rules.add(new SingleLineRule("\"", "\"", string, '\\'));
    rules.add(new SingleLineRule("'", "'", string, '\\'));
    // Add generic whitespace rule.
    rules.add(new WhitespaceRule(new WhitespaceDetector()));
    // Add word rule for keywords.
    WordRule wordRule = new WordRule(new ContractWordDetector(), other);

    for (String keywd : getKeywords())
    {
View Full Code Here

        // Rules for Strings
        rules.add( new SingleLineRule( "\"", "\"", string, '\0', true ) ); //$NON-NLS-1$ //$NON-NLS-2$
        rules.add( new SingleLineRule( "'", "'", string, '\0', true ) ); //$NON-NLS-1$ //$NON-NLS-2$
        // Generic rule for whitespaces
        rules.add( new WhitespaceRule( new IWhitespaceDetector()
        {
            /**
             * Indicates if the given character is a whitespace
             * @param c the character to analyse
             * @return <code>true</code> if the character is to be considered as a whitespace,  <code>false</code> if not.
View Full Code Here

        // Rules for Strings
        rules.add( new SingleLineRule( "\"", "\"", string, '\0', true ) ); //$NON-NLS-1$ //$NON-NLS-2$
        rules.add( new SingleLineRule( "'", "'", string, '\0', true ) ); //$NON-NLS-1$ //$NON-NLS-2$
        // Generic rule for whitespaces
        rules.add( new WhitespaceRule( new IWhitespaceDetector()
        {
            /**
             * Indicates if the given character is a whitespace
             * @param c the character to analyse
             * @return <code>true</code> if the character is to be considered as a whitespace,  <code>false</code> if not.
View Full Code Here

TOP

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

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.