Package org.eclipse.jface.text.rules

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


    setRules(result);
  }
 
  public void setTokenData(String tokenKey, Object data) {
    if (tokenKey == IStyleConstantsJSPEL.EL_KEYWORD) {
      fKeywordToken = new Token(data);
      fTypeToken = new Token(data);
    } else if (tokenKey == IStyleConstantsJSPEL.EL_DEFAULT) {
      fDefaultToken = new Token(data);
    }
  }
View Full Code Here


    setRules(result);
  }
 
  public void setTokenData(String tokenKey, Object data) {
    if (tokenKey == IStyleConstantsJSPJava.JAVA_KEYWORD) {
      fKeywordToken = new Token(data);
      fTypeToken = new Token(data);
    } else if (tokenKey == IStyleConstantsJSPJava.JAVA_STRING) {
      fStringToken = new Token(data);
    } else if (tokenKey == IStyleConstantsJSPJava.JAVA_SINGLE_LINE_COMMENT) {
      fSingleLineCommentToken = new Token(data);
    } else if (tokenKey == IStyleConstantsJSPJava.JAVA_DEFAULT) {
      fDefaultToken = new Token(data);
    }
  }
View Full Code Here

  }
 

  public BaseCodeScanner(DestecsColorProvider provider)
  {
    IToken type = new Token(new TextAttribute(provider.getColor(new RGB(0, 0, 192)), null, SWT.BOLD));
    IToken keyword = new Token(new TextAttribute(provider.getColor(DestecsColorProvider.KEYWORD), null, SWT.BOLD));
    IToken string = new Token(new TextAttribute(provider.getColor(DestecsColorProvider.STRING)));
    IToken comment = new Token(new TextAttribute(provider.getColor(DestecsColorProvider.SINGLE_LINE_COMMENT)));
    IToken other = new Token(new TextAttribute(provider.getColor(DestecsColorProvider.DEFAULT)));

    List<IRule> rules = new ArrayList<IRule>();
    // Add rule for single line comments.
    rules.add(new EndOfLineRule("--", comment));
    rules.add(new EndOfLineRule("//", comment));
View Full Code Here

    public SchemaCodeScanner( SchemaTextAttributeProvider provider )
    {
        List<IRule> rules = new ArrayList<IRule>();

        IToken keyword = new Token( provider.getAttribute( SchemaTextAttributeProvider.KEYWORD_ATTRIBUTE ) );
        IToken string = new Token( provider.getAttribute( SchemaTextAttributeProvider.STRING_ATTRIBUTE ) );
        IToken undefined = new Token( provider.getAttribute( SchemaTextAttributeProvider.DEFAULT_ATTRIBUTE ) );
        IToken ATToken = new Token( provider.getAttribute( SchemaTextAttributeProvider.ATTRIBUTETYPE_ATTRIBUTE ) );
        IToken OCToken = new Token( provider.getAttribute( SchemaTextAttributeProvider.OBJECTCLASS_ATTRIBUTE ) );
        IToken oid = new Token( provider.getAttribute( SchemaTextAttributeProvider.OID_ATTRIBUTE ) );

        // 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
View Full Code Here

     */
    public ACICodeScanner( ACITextAttributeProvider provider )
    {
        List<IRule> rules = new ArrayList<IRule>();

        IToken keyword = new Token( provider.getAttribute( ACITextAttributeProvider.KEYWORD_ATTRIBUTE ) );
        IToken undefined = new Token( provider.getAttribute( ACITextAttributeProvider.DEFAULT_ATTRIBUTE ) );
        IToken string = new Token( provider.getAttribute( ACITextAttributeProvider.STRING_ATTRIBUTE ) );
        IToken grantValue = new Token( provider.getAttribute( ACITextAttributeProvider.GRANT_VALUE ) );
        IToken denyValue = new Token( provider.getAttribute( ACITextAttributeProvider.DENY_VALUE ) );
        IToken identification = new Token( provider.getAttribute( ACITextAttributeProvider.IDENTIFICATION_ATTRIBUTE ) );
        IToken precedence = new Token( provider.getAttribute( ACITextAttributeProvider.PRECEDENCE_ATTRIBUTE ) );
        IToken authenticationLevel = new Token( provider
            .getAttribute( ACITextAttributeProvider.AUTHENTICATIONLEVEL_ATTRIBUTE ) );
        IToken itemOrUserFirst = new Token( provider.getAttribute( ACITextAttributeProvider.ITEMORUSERFIRST_ATTRIBUTE ) );
        IToken user = new Token( provider.getAttribute( ACITextAttributeProvider.USER_ATTRIBUTE ) );

        // 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
View Full Code Here

    public final static String LDIF_RECORD = "__ldif_record";


    public LdifPartitionScanner()
    {
        IToken record = new Token( LDIF_RECORD );

        IPredicateRule[] rules = new IPredicateRule[1];
        rules[0] = new LdifRecordRule( record );

        setPredicateRules( rules );
View Full Code Here

 
  protected FitScanner getFitScanner() {
    if (fitScanner == null) {
      fitScanner = new FitScanner(colorManager);
      fitScanner.setDefaultReturnToken(
        new Token(
          new TextAttribute(
            colorManager.getColor(IFitColorConstants.DEFAULT))));
    }
    return fitScanner;
  }
View Full Code Here

      "-->scan4" /*in earlier Coco/R versions only*/ };
  private static final String[] PARSER_TOKENS = { "-->constants", "-->pragmas",
      "-->productions", "-->parseRoot", "-->errors" };

  public FramePartitionScanner() {
    final IToken multiLineCommentToken = new Token(FramePartitions.MULTI_LINE_COMMENT);
    final IToken singleLineCommentToken = new Token(FramePartitions.SINGLE_LINE_COMMENT);
    final IToken stringToken = new Token(FramePartitions.STRING);
    final IToken charToken = new Token(FramePartitions.CHARACTER);
    final IToken frameToken = new Token(FramePartitions.FRAME_KEYWORD);

    List<IPredicateRule> rules = new ArrayList<IPredicateRule>();

    // Add rule for multiple line comments.
    rules.add(new MultiLineRule("/*", "*/", multiLineCommentToken, (char)0, true));
View Full Code Here

    else if(token.isUndefined()){
      return Token.UNDEFINED;
    }
    else {
      //System.out.println(token.getData());
    IToken t = new Token(token.getData());
    return t;
    }
  }
View Full Code Here

  public void addPropertyChangedListener(PropertyChangedListener l) {
    propertyChangedListeners.add(l);
  }

  private void addSyntax(Enum<?> syntaxId, Color color) {
    syntaxTable.put(syntaxId, new Token(new TextAttribute(color, null,
        SWT.NORMAL)));
  }
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.