Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.TextAttribute


    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);

    NonRuleBasedDamagerRepairer ndr =
      new NonRuleBasedDamagerRepairer(
        new TextAttribute(
          colorManager.getColor(XMLColorConstants.XML_COMMENT)));
    reconciler.setDamager(ndr, XMLPartitionScanner.XML_COMMENT);
    reconciler.setRepairer(ndr, XMLPartitionScanner.XML_COMMENT);

    return reconciler;
View Full Code Here


     * Construct a new XMLScanner.
     * @param manager The ColorManager associated with this XMLScanner.
     */
    public XMLScanner(ColorManager manager) {
        IToken procInstr =
                new Token(new TextAttribute(
                        manager.getColor(XMLColorConstants.PROC_INSTR)));

        IRule[] rules = new IRule[2];
        //Add rule for processing instructions
        rules[0] = new SingleLineRule("<?", "?>", procInstr); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

    // Add generic whitespace rule.
    rules[0] = new WhitespaceRule(new WhitespaceDetector());

    setRules(rules);
        setDefaultReturnToken(new Token(new TextAttribute(manager.getTextColor())));
  }
View Full Code Here

import org.eclipse.jface.text.rules.WhitespaceRule;

public class SentenceScanner extends RuleBasedScanner {

  public SentenceScanner(ColorManager manager) {
    IToken string = new Token(new TextAttribute(manager.getStringColor()));
        final Token terminals = new Token(new TextAttribute(manager.getTerminalsColor()));
        Token template = new Token(new TextAttribute(manager.getTemplateColor()));
        Token keyword = new Token(new TextAttribute(manager.getKeywordsColor()));
        Token others = new Token(new TextAttribute(manager.getOtherColor()));

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

    // Add rule for double quotes
    rules.add(new SingleLineRule("\"", "\"", string, '\\'));
View Full Code Here

import org.eclipse.jface.text.rules.WhitespaceRule;

public class XMLTagScanner extends RuleBasedScanner {

    public XMLTagScanner(ColorManager manager) {
        IToken string = new Token(new TextAttribute(manager.getColor(IXMLColorConstants.STRING)));

        IRule[] rules = new IRule[3];

        // Add rule for double quotes
        rules[0] = new SingleLineRule("\"", "\"", string, '\\');
View Full Code Here

  public IToken getToken(String prefKey){
     Token token = (Token) tokenTable.get(prefKey);
     if (token == null){
      String colorName = store.getString(prefKey);
      RGB rgb = StringConverter.asRGB(colorName);
      token = new Token(new TextAttribute(getColor(rgb)));
      tokenTable.put(prefKey, token);
     }
     return token;
  }
View Full Code Here

     String prefKey = event.getProperty();
     Token token = (Token) tokenTable.get(prefKey);
     if (token != null){
      String colorName = store.getString(prefKey);
      RGB rgb = StringConverter.asRGB(colorName);
      token.setData(new TextAttribute(getColor(rgb)));
     }
  }
View Full Code Here

  }

  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

    dr = new DefaultDamagerRepairer(getXMLScanner());
    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);

    NonRuleBasedDamagerRepairer ndr = new NonRuleBasedDamagerRepairer(new TextAttribute(
            colorManager.getColor(IXMLColorConstants.XML_COMMENT)));
    reconciler.setDamager(ndr, XMLPartitionScanner.XML_COMMENT);
    reconciler.setRepairer(ndr, XMLPartitionScanner.XML_COMMENT);

    return reconciler;
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.TextAttribute

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.