Example usage for com.intellij.openapi.options.colors AttributesDescriptor AttributesDescriptor

List of usage examples for com.intellij.openapi.options.colors AttributesDescriptor AttributesDescriptor

Introduction

In this page you can find the example usage for com.intellij.openapi.options.colors AttributesDescriptor AttributesDescriptor.

Prototype

public AttributesDescriptor(@Nls @NotNull String displayName, @NotNull TextAttributesKey key) 

Source Link

Document

Creates an attribute descriptor with the specified name and text attributes key.

Usage

From source file:com.intellij.application.options.colors.ColorSettingsUtil.java

License:Apache License

private static void addInspectionSeverityAttributes(List<AttributesDescriptor> descriptors) {
    descriptors.add(//from   w  w  w.ja va  2 s. c om
            new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.unknown.symbol"),
                    CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES));
    descriptors.add(new AttributesDescriptor(
            OptionsBundle.message("options.java.attribute.descriptor.deprecated.symbol"),
            CodeInsightColors.DEPRECATED_ATTRIBUTES));
    descriptors.add(
            new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.unused.symbol"),
                    CodeInsightColors.NOT_USED_ELEMENT_ATTRIBUTES));
    descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.error"),
            CodeInsightColors.ERRORS_ATTRIBUTES));
    descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.warning"),
            CodeInsightColors.WARNINGS_ATTRIBUTES));
    descriptors.add(
            new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.weak.warning"),
                    CodeInsightColors.WEAK_WARNING_ATTRIBUTES));
    descriptors.add(
            new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.server.problems"),
                    CodeInsightColors.GENERIC_SERVER_ERROR_OR_WARNING));
    descriptors.add(new AttributesDescriptor(
            OptionsBundle.message("options.java.attribute.descriptor.server.duplicate"),
            CodeInsightColors.DUPLICATE_FROM_SERVER));

    for (SeveritiesProvider provider : Extensions.getExtensions(SeveritiesProvider.EP_NAME)) {
        for (HighlightInfoType highlightInfoType : provider.getSeveritiesHighlightInfoTypes()) {
            final TextAttributesKey attributesKey = highlightInfoType.getAttributesKey();
            descriptors.add(new AttributesDescriptor(toDisplayName(attributesKey), attributesKey));
        }
    }
}

From source file:com.intellij.velocity.VelocityColorSettingsPage.java

License:Apache License

private static AttributesDescriptor createAttributesDescriptor(String displayNameKey,
        TextAttributesKey textAttributesKey) {
    return new AttributesDescriptor(VelocityBundle.message(displayNameKey), textAttributesKey);
}

From source file:com.intellij.xdebugger.impl.ui.DebuggerColorsPage.java

License:Apache License

@Override
@NotNull//  www.j  ava 2  s.c om
public AttributesDescriptor[] getAttributeDescriptors() {
    return new AttributesDescriptor[] {
            new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.breakpoint.line"),
                    DebuggerColors.BREAKPOINT_ATTRIBUTES),
            new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.execution.point"),
                    DebuggerColors.EXECUTIONPOINT_ATTRIBUTES),
            new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.not.top.frame"),
                    DebuggerColors.NOT_TOP_FRAME_ATTRIBUTES),
            new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.inlined.values"),
                    DebuggerColors.INLINED_VALUES),
            new AttributesDescriptor(
                    OptionsBundle.message("options.java.attribute.descriptor.inlined.values.modified"),
                    DebuggerColors.INLINED_VALUES_MODIFIED),
            new AttributesDescriptor(
                    OptionsBundle.message("options.java.attribute.descriptor.inlined.values.execution.line"),
                    DebuggerColors.INLINED_VALUES_EXECUTION_LINE), };
}

From source file:com.vladsch.idea.multimarkdown.highlighter.MultiMarkdownColorSettingsPage.java

License:Apache License

private void addTextAttributesKey(String name, TextAttributesKey attributesKey) {
    attributeDescriptors//  w  w  w  .j ava 2  s.  com
            .add(new AttributesDescriptor(MultiMarkdownBundle.message("colorsettings." + name), attributesKey));
}

From source file:consulo.play1.editor.highlight.PlayJavaColorSettingsPage.java

License:Apache License

@Nonnull
@Override//from   w ww .j  av  a  2s.  c  o  m
public AttributesDescriptor[] getAttributeDescriptors() {
    return new AttributesDescriptor[] {
            new AttributesDescriptor("Play tag start", PlayJavaColors.TEMPLATE_ELEMENTS),
            new AttributesDescriptor("Play tag name", PlayJavaColors.PLAY_TAG_NAME),
            new AttributesDescriptor("Route method", PlayJavaColors.ROUTE_METHOD) };
}

From source file:io.v.vdl.VdlColorSettingsPage.java

License:Open Source License

@NotNull
@Override/*from ww  w.ja  v a2 s . c o  m*/
public AttributesDescriptor[] getAttributeDescriptors() {
    AttributesDescriptor[] result = new AttributesDescriptor[attributes.size()];
    int i = 0;
    for (Map.Entry<String, TextAttributesKey> entry : attributes.entrySet()) {
        result[i++] = new AttributesDescriptor(entry.getKey(), entry.getValue());
    }
    return result;
}

From source file:net.nicoulaj.idea.byteman.highlighter.BytemanColorSettingsPage.java

License:Open Source License

/**
 * Utility method for populating {@link #attributeDescriptors}.
 *
 * @param displayNameKey the {@link Bundle} key for the displayed name
 * @param key            the text attributes key
 * @see #BytemanColorSettingsPage()/*from   w  w w .  j a  v  a 2s.c o m*/
 */
private void addDescriptor(@NotNull @NonNls String displayNameKey, @NotNull TextAttributesKey key) {
    attributeDescriptors.add(new AttributesDescriptor(message(displayNameKey), key));
}

From source file:net.nicoulaj.idea.markdown.highlighter.MarkdownColorSettingsPage.java

License:Apache License

/**
 * Build a new instance of {@link MarkdownColorSettingsPage}.
 */// ww w. ja  va 2 s.  c  om
public MarkdownColorSettingsPage() {

    // Populate attribute descriptors.
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.text"),
                    MarkdownHighlighterColors.TEXT_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.bold"),
                    MarkdownHighlighterColors.BOLD_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.italic"),
                    MarkdownHighlighterColors.ITALIC_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.explicit-link"),
                    MarkdownHighlighterColors.EXPLICIT_LINK_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.image"),
                    MarkdownHighlighterColors.IMAGE_ATTR_KEY));
    attributeDescriptors.add(new AttributesDescriptor(
            MarkdownBundle.message("markdown.editor.colorsettingspage.reference-image"),
            MarkdownHighlighterColors.REFERENCE_IMAGE_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.header-level-1"),
                    MarkdownHighlighterColors.HEADER_LEVEL_1_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.header-level-2"),
                    MarkdownHighlighterColors.HEADER_LEVEL_2_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.header-level-3"),
                    MarkdownHighlighterColors.HEADER_LEVEL_3_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.header-level-4"),
                    MarkdownHighlighterColors.HEADER_LEVEL_4_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.header-level-5"),
                    MarkdownHighlighterColors.HEADER_LEVEL_5_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.header-level-6"),
                    MarkdownHighlighterColors.HEADER_LEVEL_6_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.code"),
                    MarkdownHighlighterColors.CODE_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.quote"),
                    MarkdownHighlighterColors.QUOTE_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.table"),
                    MarkdownHighlighterColors.TABLE_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.hrule"),
                    MarkdownHighlighterColors.HRULE_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.special-text"),
                    MarkdownHighlighterColors.SPECIAL_TEXT_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.reference-link"),
                    MarkdownHighlighterColors.REFERENCE_LINK_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.wiki-link"),
                    MarkdownHighlighterColors.WIKI_LINK_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.auto-link"),
                    MarkdownHighlighterColors.AUTO_LINK_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.mail-link"),
                    MarkdownHighlighterColors.MAIL_LINK_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.verbatim"),
                    MarkdownHighlighterColors.VERBATIM_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.blockquote"),
                    MarkdownHighlighterColors.BLOCK_QUOTE_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.bullet-list"),
                    MarkdownHighlighterColors.BULLET_LIST_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.ordered-list"),
                    MarkdownHighlighterColors.ORDERED_LIST_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.list-item"),
                    MarkdownHighlighterColors.LIST_ITEM_ATTR_KEY));
    attributeDescriptors.add(new AttributesDescriptor(
            MarkdownBundle.message("markdown.editor.colorsettingspage.definition-list"),
            MarkdownHighlighterColors.DEFINITION_LIST_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.definition"),
                    MarkdownHighlighterColors.DEFINITION_ATTR_KEY));
    attributeDescriptors.add(new AttributesDescriptor(
            MarkdownBundle.message("markdown.editor.colorsettingspage.definition-term"),
            MarkdownHighlighterColors.DEFINITION_TERM_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.table-body"),
                    MarkdownHighlighterColors.TABLE_BODY_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.table-cell"),
                    MarkdownHighlighterColors.TABLE_CELL_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.table-column"),
                    MarkdownHighlighterColors.TABLE_COLUMN_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.table-row"),
                    MarkdownHighlighterColors.TABLE_ROW_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.table-header"),
                    MarkdownHighlighterColors.TABLE_HEADER_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.html-block"),
                    MarkdownHighlighterColors.HTML_BLOCK_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.inline-html"),
                    MarkdownHighlighterColors.INLINE_HTML_ATTR_KEY));
    attributeDescriptors
            .add(new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.reference"),
                    MarkdownHighlighterColors.REFERENCE_ATTR_KEY));
    attributeDescriptors.add(
            new AttributesDescriptor(MarkdownBundle.message("markdown.editor.colorsettingspage.abbreviation"),
                    MarkdownHighlighterColors.ABBREVIATION_ATTR_KEY));
}

From source file:org.codehaus.groovy.intellij.language.editor.GroovyColourSettingsPage.java

License:Apache License

private static AttributesDescriptor[] createAttributeDescriptors() {
    return new AttributesDescriptor[] { new AttributesDescriptor("Keyword", SyntacticAttributes.GROOVY_KEYWORD),
            new AttributesDescriptor("Number", SyntacticAttributes.GROOVY_NUMBER),
            new AttributesDescriptor("String", SyntacticAttributes.GROOVY_STRING),
            new AttributesDescriptor("Valid escape in string", SyntacticAttributes.GROOVY_VALID_STRING_ESCAPE),
            new AttributesDescriptor("Invalid escape in string",
                    SyntacticAttributes.GROOVY_INVALID_STRING_ESCAPE),
            new AttributesDescriptor("Regular expression", SyntacticAttributes.GROOVY_REGEXP),
            new AttributesDescriptor("Operator sign", SyntacticAttributes.GROOVY_OPERATION_SIGN),
            new AttributesDescriptor("Parentheses", SyntacticAttributes.GROOVY_PARENTHESES),
            new AttributesDescriptor("Brackets", SyntacticAttributes.GROOVY_BRACKETS),
            new AttributesDescriptor("Braces", SyntacticAttributes.GROOVY_BRACES),
            new AttributesDescriptor("Dot", SyntacticAttributes.GROOVY_DOT),
            new AttributesDescriptor("Comma", SyntacticAttributes.GROOVY_COMMA),
            new AttributesDescriptor("Semicolon", SyntacticAttributes.GROOVY_SEMICOLON),
            new AttributesDescriptor("Script header comment", SyntacticAttributes.GROOVY_SCRIPT_HEADER_COMMENT),
            new AttributesDescriptor("Line comment", SyntacticAttributes.GROOVY_LINE_COMMENT),
            new AttributesDescriptor("Block comment", SyntacticAttributes.GROOVY_BLOCK_COMMENT),
            new AttributesDescriptor("Javadoc comment", SyntacticAttributes.GROOVY_DOC_COMMENT),
            new AttributesDescriptor("Javadoc tag", SyntacticAttributes.GROOVY_DOC_TAG),
            new AttributesDescriptor("Javadoc markup", SyntacticAttributes.GROOVY_DOC_MARKUP),
            new AttributesDescriptor("Unknown symbol", CodeInsightAttributes.WRONG_REFERENCE_ATTRIBUTES),
            new AttributesDescriptor("Error", CodeInsightAttributes.ERROR_ATTRIBUTES),
            new AttributesDescriptor("Warning", CodeInsightAttributes.WARNING_ATTRIBUTES),
            new AttributesDescriptor("Deprecated symbol", CodeInsightAttributes.DEPRECATED_ATTRIBUTES),
            new AttributesDescriptor("Unused symbol", CodeInsightAttributes.NOT_USED_ELEMENT_ATTRIBUTES),
            new AttributesDescriptor("Class", CodeInsightAttributes.CLASS_NAME_ATTRIBUTES),
            new AttributesDescriptor("Interface", CodeInsightAttributes.INTERFACE_NAME_ATTRIBUTES),
            new AttributesDescriptor("Local variable", CodeInsightAttributes.LOCAL_VARIABLE_ATTRIBUTES),
            new AttributesDescriptor("Reassigned local variable",
                    CodeInsightAttributes.REASSIGNED_LOCAL_VARIABLE_ATTRIBUTES),
            new AttributesDescriptor("Reassigned parameter",
                    CodeInsightAttributes.REASSIGNED_PARAMETER_ATTRIBUTES),
            new AttributesDescriptor("Instance field", CodeInsightAttributes.INSTANCE_FIELD_ATTRIBUTES),
            new AttributesDescriptor("Static field", CodeInsightAttributes.STATIC_FIELD_ATTRIBUTES),
            new AttributesDescriptor("Parameter", CodeInsightAttributes.PARAMETER_ATTRIBUTES),
            new AttributesDescriptor("Method call", CodeInsightAttributes.METHOD_CALL_ATTRIBUTES),
            new AttributesDescriptor("Method declaration", CodeInsightAttributes.METHOD_DECLARATION_ATTRIBUTES),
            new AttributesDescriptor("Constructor call", CodeInsightAttributes.CONSTRUCTOR_CALL_ATTRIBUTES),
            new AttributesDescriptor("Constructor declaration",
                    CodeInsightAttributes.CONSTRUCTOR_DECLARATION_ATTRIBUTES),
            new AttributesDescriptor("Static method", CodeInsightAttributes.STATIC_METHOD_ATTRIBUTES),
            new AttributesDescriptor("Matched brace", CodeInsightAttributes.MATCHED_BRACE_ATTRIBUTES),
            new AttributesDescriptor("Unmatched brace", CodeInsightAttributes.UNMATCHED_BRACE_ATTRIBUTES),
            new AttributesDescriptor("Bad character", HighlighterColors.BAD_CHARACTER),
            new AttributesDescriptor("Breakpoint line", DebuggerColors.BREAKPOINT_ATTRIBUTES),
            new AttributesDescriptor("Execution point", DebuggerColors.EXECUTIONPOINT_ATTRIBUTES),
            new AttributesDescriptor("Annotation name", CodeInsightAttributes.ANNOTATION_NAME_ATTRIBUTES),
            new AttributesDescriptor("Annotation attribute name",
                    CodeInsightAttributes.ANNOTATION_ATTRIBUTE_NAME_ATTRIBUTES) };
}

From source file:org.consulo.play1.editor.highlight.PlayJavaColorSettingsPage.java

License:Apache License

@NotNull
@Override//from   w w  w  .  ja  v  a  2 s  .c om
public AttributesDescriptor[] getAttributeDescriptors() {
    return new AttributesDescriptor[] {
            new AttributesDescriptor("Play tag start", PlayJavaColors.TEMPLATE_ELEMENTS),
            new AttributesDescriptor("Play tag name", PlayJavaColors.PLAY_TAG_NAME),
            new AttributesDescriptor("Route method", PlayJavaColors.ROUTE_METHOD) };
}