Examples of TextAttribute


Examples of org.eclipse.jface.text.TextAttribute

        region.getLength(),
        getDefaultTextAttribute());
  }

  private TextAttribute getDefaultTextAttribute() {
    return new TextAttribute(colorManager.getColor((PreferenceConverter.getColor(PlayPlugin.getDefault().getPreferenceStore(),
        fDefaultTextAttribute))));
  }
View Full Code Here

Examples of org.eclipse.jface.text.TextAttribute

            style = SWT.BOLD;
        } else if (IoRequest.RE_PROMPT.matcher(string).matches()) {
            fg = fColorManager.getColor(new RGB(80, 80, 80));
            style = SWT.BOLD;
        }
        return new TextAttribute(fg, bg, style);
    }
View Full Code Here

Examples of org.eclipse.jface.text.TextAttribute

        int lastStart = region.getOffset();
        int length = 0;
        boolean firstToken = true;
        IToken lastToken = Token.UNDEFINED;
        TextAttribute lastAttribute = getTokenTextAttribute(lastToken);

        fScanner.setRange(fDocument, lastStart, region.getLength());

        while (true) {
            final IToken token = fScanner.nextToken();
            if (token == null) {
                try {
                    ErlLogger.warn("null token from '%s'>>>",
                            fDocument.get(lastStart, region.getLength()));
                } catch (final BadLocationException e) {
                    ErlLogger.warn("null token from '%s'", fDocument.get());
                }
                break;
            }
            if (token.isEOF()) {
                break;
            }

            final TextAttribute attribute = getTokenTextAttribute(token);
            // if (lastAttribute != null && lastAttribute.equals(attribute)) {
            // length += fScanner.getTokenLength();
            // firstToken= false;
            // } else {
            if (!firstToken) {
View Full Code Here

Examples of org.eclipse.jface.text.TextAttribute

    protected TextAttribute getTextAttribute(final TokenHighlight th) {
        final IPreferenceStore store = ErlideUIPlugin.getDefault().getPreferenceStore();
        final HighlightStyle data = th.getStyle(store);
        // load from prefsstore
        return new TextAttribute(fColorManager.getColor(data.getColor()), null,
                data.getStyles());
    }
View Full Code Here

Examples of org.eclipse.jface.text.TextAttribute

        }
        return t_default;
    }

    private void fixTokenData(final Token token, final RGB color, final int style) {
        final TextAttribute attr = (TextAttribute) token.getData();
        final int newStyle = style == -1 ? attr.getStyle() : style;
        final Color newColor = color == null ? attr.getForeground() : fColorManager
                .getColor(color);
        token.setData(new TextAttribute(newColor, attr.getBackground(), newStyle));
    }
View Full Code Here

Examples of org.eclipse.jface.text.TextAttribute

     if (token == null){
         String colorName = store.getString(prefKey);
         if (colorName.equals(""))
           Logging.error("No such preference stored: " + prefKey);
         RGB rgb = StringConverter.asRGB(colorName);
           token = new Token(new TextAttribute(getColor(rgb), null, style));
         tokenTable.put(prefKey, token);
     }
     return token;
  }
View Full Code Here

Examples of org.eclipse.jface.text.TextAttribute

    RGB rgb = StringConverter.asRGB(colorName);
    return getTextAttribute(rgb, style);
  }

  public TextAttribute getTextAttribute(RGB rgb, int style) {
    return new TextAttribute(getColor(rgb), null, style);
  }
View Full Code Here

Examples of org.eclipse.jface.text.TextAttribute

public class XMLTagScanner extends RuleBasedScanner {

    public XMLTagScanner(ColorManager manager) {
        Color color = manager.getColor(PreferenceConstants.EDITOR_COLOR_STRING);
        IToken string = new Token(new TextAttribute(color));

        // CheckStyle:MagicNumber| OFF
        IRule[] rules = new IRule[3];
        // CheckStyle:MagicNumber| ON
View Full Code Here

Examples of org.eclipse.jface.text.TextAttribute

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

public class XMLScanner extends RuleBasedScanner {

    public XMLScanner(ColorManager manager) {
        IToken procInstr = new Token(new TextAttribute(manager
                .getColor(PreferenceConstants.EDITOR_COLOR_PROC_INSTR)));

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

Examples of org.eclipse.jface.text.TextAttribute

    }

    protected XMLScanner getXMLScanner() {
        if (scanner == null) {
            scanner = new XMLScanner(colorManager);
            scanner.setDefaultReturnToken(new Token(new TextAttribute(colorManager
                    .getColor(PreferenceConstants.EDITOR_COLOR_DEFAULT))));
        }
        return scanner;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.