Package org.eclipse.jface.text

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


    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

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

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

    }

    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

    }

    protected XMLTagScanner getXMLTagScanner() {
        if (tagScanner == null) {
            tagScanner = new XMLTagScanner(colorManager);
            tagScanner.setDefaultReturnToken(new Token(new TextAttribute(colorManager
                    .getColor(PreferenceConstants.EDITOR_COLOR_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(PreferenceConstants.EDITOR_COLOR_XML_COMMENT)));
        reconciler.setDamager(ndr, XMLPartitionScanner.XML_COMMENT);
        reconciler.setRepairer(ndr, XMLPartitionScanner.XML_COMMENT);

        return reconciler;
View Full Code Here

                    + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX ) ).intValue();
            }
        }

        Color color = LdifEditorActivator.getDefault().getColor( rgb );
        TextAttribute textAttribute = new TextAttribute( color, null, style );
        return textAttribute;
    }
View Full Code Here

        // TextAttribute DEFAULT_TEXT_ATTRIBUTE = new
        // TextAttribute(Activator.getDefault().getColor(new RGB(0, 0,
        // 0)));

        TextAttribute COMMENT_TEXT_ATTRIBUTE = geTextAttribute( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_COMMENT );
        TextAttribute KEYWORD_TEXT_ATTRIBUTE = geTextAttribute( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_KEYWORD );
        TextAttribute DN_TEXT_ATTRIBUTE = geTextAttribute( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_DN );
        TextAttribute ATTRIBUTE_TEXT_ATTRIBUTE = geTextAttribute( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_ATTRIBUTE );
        TextAttribute VALUETYPE_TEXT_ATTRIBUTE = geTextAttribute( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_VALUETYPE );
        TextAttribute VALUE_TEXT_ATTRIBUTE = geTextAttribute( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_VALUE );
        TextAttribute ADD_TEXT_ATTRIBUTE = geTextAttribute( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEADD );
        TextAttribute MODIFY_TEXT_ATTRIBUTE = geTextAttribute( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEMODIFY );
        TextAttribute DELETE_TEXT_ATTRIBUTE = geTextAttribute( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEDELETE );
        TextAttribute MODDN_TEXT_ATTRIBUTE = geTextAttribute( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEMODDN );

        for ( int z = 0; z < containers.length; z++ )
        {

            LdifContainer container = containers[z];
View Full Code Here

        // String className = moduleDescription.getClassName();
        // moduleClassesNameList.add(className);
        // }
        // }

        IToken string = new Token(new TextAttribute(provider.getColor(JavaColorProvider.STRING)));
        IToken comment = new Token(new TextAttribute(provider.getColor(JavaColorProvider.SINGLE_LINE_COMMENT)));

        IToken keywordTok = new Token(new TextAttribute(provider.getColor(JavaColorProvider.KEYWORD), null, SWT.BOLD));
        IToken methodTok = new Token(new TextAttribute(provider.getColor(JavaColorProvider.METHOD), null, SWT.ITALIC));
        IToken typeTok = new Token(new TextAttribute(provider.getColor(JavaColorProvider.TYPE)));
        IToken constantsTok = new Token(new TextAttribute(provider.getColor(JavaColorProvider.CONSTANTS)));
        IToken geoscriptTok = new Token(new TextAttribute(provider.getColor(JavaColorProvider.GEOSCRIPT), null, SWT.BOLD));

        IToken other = new Token(new TextAttribute(provider.getColor(JavaColorProvider.DEFAULT)));
        IToken modulesFieldsTok = new Token(new TextAttribute(provider.getColor(JavaColorProvider.MODULES_FIELDS)));
        IToken omsComponentsTok = new Token(new TextAttribute(provider.getColor(JavaColorProvider.OMS_COMPONENTS)));
        IToken omsModulesTok = new Token(new TextAttribute(provider.getColor(JavaColorProvider.OMS_MODULES)));

        List rules = new ArrayList();

        // Add rule for single line comments.
        rules.add(new EndOfLineRule("//", comment)); //$NON-NLS-1$
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.