Search in sources :

Example 1 with SeveritiesProvider

use of com.intellij.codeInsight.daemon.impl.SeveritiesProvider in project intellij-community by JetBrains.

the class ColorSettingsUtil method addInspectionSeverityAttributes.

private static void addInspectionSeverityAttributes(List<AttributesDescriptor> descriptors) {
    descriptors.add(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));
        }
    }
}
Also used : AttributesDescriptor(com.intellij.openapi.options.colors.AttributesDescriptor) TextAttributesKey(com.intellij.openapi.editor.colors.TextAttributesKey) SeveritiesProvider(com.intellij.codeInsight.daemon.impl.SeveritiesProvider) HighlightInfoType(com.intellij.codeInsight.daemon.impl.HighlightInfoType)

Example 2 with SeveritiesProvider

use of com.intellij.codeInsight.daemon.impl.SeveritiesProvider in project intellij-community by JetBrains.

the class ApplicationInspectionProfileManager method registerProvidedSeverities.

// It should be public to be available from Upsource
public static void registerProvidedSeverities() {
    for (SeveritiesProvider provider : Extensions.getExtensions(SeveritiesProvider.EP_NAME)) {
        for (HighlightInfoType t : provider.getSeveritiesHighlightInfoTypes()) {
            HighlightSeverity highlightSeverity = t.getSeverity(null);
            SeverityRegistrar.registerStandard(t, highlightSeverity);
            TextAttributesKey attributesKey = t.getAttributesKey();
            Icon icon = t instanceof HighlightInfoType.Iconable ? ((HighlightInfoType.Iconable) t).getIcon() : null;
            HighlightDisplayLevel.registerSeverity(highlightSeverity, attributesKey, icon);
        }
    }
}
Also used : HighlightSeverity(com.intellij.lang.annotation.HighlightSeverity) TextAttributesKey(com.intellij.openapi.editor.colors.TextAttributesKey) SeveritiesProvider(com.intellij.codeInsight.daemon.impl.SeveritiesProvider) HighlightInfoType(com.intellij.codeInsight.daemon.impl.HighlightInfoType)

Example 3 with SeveritiesProvider

use of com.intellij.codeInsight.daemon.impl.SeveritiesProvider in project intellij-community by JetBrains.

the class GeneralColorsPage method getCustomSeveritiesDemoText.

private static String getCustomSeveritiesDemoText() {
    final StringBuilder buff = new StringBuilder();
    for (SeveritiesProvider provider : Extensions.getExtensions(SeveritiesProvider.EP_NAME)) {
        for (HighlightInfoType highlightInfoType : provider.getSeveritiesHighlightInfoTypes()) {
            final String tag = getHighlightDescTagName(highlightInfoType);
            buff.append("  <").append(tag).append(">");
            buff.append(tag.toLowerCase());
            buff.append("</").append(tag).append(">").append("\n");
        }
    }
    return buff.toString();
}
Also used : SeveritiesProvider(com.intellij.codeInsight.daemon.impl.SeveritiesProvider) HighlightInfoType(com.intellij.codeInsight.daemon.impl.HighlightInfoType)

Aggregations

HighlightInfoType (com.intellij.codeInsight.daemon.impl.HighlightInfoType)3 SeveritiesProvider (com.intellij.codeInsight.daemon.impl.SeveritiesProvider)3 TextAttributesKey (com.intellij.openapi.editor.colors.TextAttributesKey)2 HighlightSeverity (com.intellij.lang.annotation.HighlightSeverity)1 AttributesDescriptor (com.intellij.openapi.options.colors.AttributesDescriptor)1