Package org.eclipse.jface.text.rules

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


  }

  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 class ToolScanner extends RuleBasedScanner {

  public ToolScanner(ColorManager manager) {
    IToken reservedWord =
      new Token(
        new TextAttribute(
          manager.getColor(IToolColorConstants.KEYWORD), null, Font.BOLD));
   
   
    IToken udsLibrary =
      new Token(
        new TextAttribute(
          manager.getColor(IToolColorConstants.UDS_LIBRARY), null, Font.BOLD | Font.ITALIC));
    IToken type =
      new Token(
          new TextAttribute(manager.getColor(IToolColorConstants.TYPE), null, Font.BOLD));
   
    IToken string =
      new Token(new TextAttribute(manager
        .getColor(IToolColorConstants.STRING)));
   
//    IToken comment =
//      new Token(new TextAttribute(manager
//        .getColor(IToolColorConstants.TOOL_COMMENT)));
   
    IToken operator =
      new Token(new TextAttribute(manager
        .getColor(IToolColorConstants.DEFAULT), null, Font.BOLD));
   
    IToken other =
      new Token(new TextAttribute(manager.getColor(IToolColorConstants.DEFAULT)));
   
    IRule[] rules = new IRule[4];
   
    // Add generic whitespace rule.
    rules[0] = new WhitespaceRule(new ToolWhitespaceDetector());
View Full Code Here

   * with a color and font. A list of rules with the corresponding token are
   * created. The method ends with setting the scanner's set of rules
   */
  public SQLScanner() {
    SQLColorProvider provider = new SQLColorProvider();
    IToken keyword = new Token(new TextAttribute(provider
        .getColor(SQLColorProvider.KEYWORD), provider
        .getColor(SQLColorProvider.BACKGROUND), SWT.BOLD | SWT.ITALIC));
    IToken type = new Token(new TextAttribute(provider
        .getColor(SQLColorProvider.TYPE), provider
        .getColor(SQLColorProvider.BACKGROUND), SWT.BOLD));
    IToken string = new Token(new TextAttribute(provider
        .getColor(SQLColorProvider.STRING)));
    IToken comment = new Token(new TextAttribute(provider
        .getColor(SQLColorProvider.SINGLE_LINE_COMMENT)));
//    IToken other = new Token(new TextAttribute(provider
//        .getColor(SQLColorProvider.DEFAULT)));
    IToken other = new Token(new TextAttribute(provider
        .getColor(SQLColorProvider.DEFAULT), provider
            .getColor(SQLColorProvider.BACKGROUND), SWT.ITALIC));

    setDefaultReturnToken(other);
    List<IRule> rules = new ArrayList<IRule>();
View Full Code Here

public class ToolScanner extends RuleBasedScanner {

  public ToolScanner(ColorManager manager) {
    IToken reservedWord =
      new Token(
        new TextAttribute(
          manager.getColor(IToolColorConstants.KEYWORD), null, Font.BOLD));
   
   
    IToken udsLibrary =
      new Token(
        new TextAttribute(
          manager.getColor(IToolColorConstants.UDS_LIBRARY), null, Font.BOLD | Font.ITALIC));
    IToken type =
      new Token(
          new TextAttribute(manager.getColor(IToolColorConstants.TYPE), null, Font.BOLD));
   
    IToken string =
      new Token(new TextAttribute(manager
        .getColor(IToolColorConstants.STRING)));
   
//    IToken comment =
//      new Token(new TextAttribute(manager
//        .getColor(IToolColorConstants.TOOL_COMMENT)));
   
    IToken operator =
      new Token(new TextAttribute(manager
        .getColor(IToolColorConstants.DEFAULT), null, Font.BOLD));
   
    IToken other =
      new Token(new TextAttribute(manager.getColor(IToolColorConstants.DEFAULT)));
   
    IRule[] rules = new IRule[4];
   
    // Add generic whitespace rule.
    rules[0] = new WhitespaceRule(new ToolWhitespaceDetector());
View Full Code Here

  public final static String TOOL_COMMENT = "__tool_comment";
  public final static String TOOL_SQL= "__tool_sql";
 
  public ToolPartitionScanner() {

    IToken toolComment = new Token(TOOL_COMMENT);
    IToken toolSQL = new Token(TOOL_SQL);

   
    ArrayList<IPredicateRule> rules = new ArrayList<IPredicateRule>();
    rules.add(new MultiLineCommentRule(toolComment));
    rules.add(new DoubleHyphenCommentRule(toolComment));
View Full Code Here

  protected ToolScanner getToolScanner() {
    if (scanner == null) {
      scanner = new ToolScanner(colorManager);
      scanner.setDefaultReturnToken(
        new Token(
          new TextAttribute(
            colorManager.getColor(IToolColorConstants.DEFAULT))));
    }
    return scanner;
  }
View Full Code Here

  /**
   * Use the default Eclipse higlighting scheme.
   */
  private void createRules() {
    Token keywordToken = new Token(
        new TextAttribute(EditorColors.getColor(new RGB(127, 0, 85)), null, SWT.BOLD));

    commentToken = new Token(commentAttribute);

    Token jsDocToken = new Token(jsDocAttribute);

    Token stringToken = new Token(
        new TextAttribute(EditorColors.getColor(new RGB(42, 0, 255)), null, SWT.NORMAL));

    RGB blackRgb = new RGB(0, 0, 0);

    Token numberToken = new Token(
        new TextAttribute(EditorColors.getColor(blackRgb), null, SWT.NORMAL));

    Token normalToken = new Token(
        new TextAttribute(EditorColors.getColor(blackRgb), null, SWT.NORMAL));
    setDefaultReturnToken(normalToken);

    setRules(new IRule[] {
        new EndOfLineRule("//", commentToken), //$NON-NLS-1$
View Full Code Here

                      "-cmatch", "-cnotmatch", "-creplace", "-ccontains", "-cnotcontains", "-is", "-isnot", "-as", "-and", "-or", "-band", "-bor", "-not"};
  private static String[] scopes = {"$script", "$global", "$function", "$local", "$private"};
 
  public PowershellCodeScanner(PowershellColors pscolors) {

    IToken comment = new Token(new TextAttribute(new Color(Display.getCurrent(), PowershellColors.COMMENT)));
    IToken string = new Token(new TextAttribute(new Color(Display.getCurrent(), PowershellColors.STRING)));
    IToken variable = new Token(new TextAttribute(new Color(Display.getCurrent(), PowershellColors.VARIABLE)));
    IToken scope = new Token(new TextAttribute(new Color(Display.getCurrent(), PowershellColors.VARIABLE), null, SWT.BOLD));
    IToken keyword = new Token(new TextAttribute(new Color(Display.getCurrent(), PowershellColors.KEYWORD), null, SWT.BOLD));
    IToken dashKeyword = new Token(new TextAttribute(new Color(Display.getCurrent(), PowershellColors.DASH_KEYWORD), null, SWT.BOLD));

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

    // Add rule for single line comments.
    rules.add(new EndOfLineRule("#", comment));
View Full Code Here

  }

  protected XVRScanner getXVRScanner(){
    if(xvrScanner == null){
      xvrScanner = new XVRScanner(colorManager);
      xvrScanner.setDefaultReturnToken(new Token(new TextAttribute(colorManager.getColor(IXVRColorConstants.DEFAULT))));
    }
    return xvrScanner;
  }
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.