Search in sources :

Example 1 with TrafficLightRenderer

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

the class FontEditorPreview method installTrafficLights.

static void installTrafficLights(@NotNull EditorEx editor) {
    TrafficLightRenderer renderer = new TrafficLightRenderer(null, null, null) {

        @NotNull
        @Override
        protected DaemonCodeAnalyzerStatus getDaemonCodeAnalyzerStatus(@NotNull SeverityRegistrar severityRegistrar) {
            DaemonCodeAnalyzerStatus status = new DaemonCodeAnalyzerStatus();
            status.errorAnalyzingFinished = true;
            status.errorCount = new int[] { 1, 2 };
            return status;
        }
    };
    Disposer.register((Disposable) editor.getCaretModel(), renderer);
    ((EditorMarkupModel) editor.getMarkupModel()).setErrorStripeRenderer(renderer);
    ((EditorMarkupModel) editor.getMarkupModel()).setErrorStripeVisible(true);
}
Also used : TrafficLightRenderer(com.intellij.codeInsight.daemon.impl.TrafficLightRenderer) SeverityRegistrar(com.intellij.codeInsight.daemon.impl.SeverityRegistrar) NotNull(org.jetbrains.annotations.NotNull) EditorMarkupModel(com.intellij.openapi.editor.ex.EditorMarkupModel)

Aggregations

SeverityRegistrar (com.intellij.codeInsight.daemon.impl.SeverityRegistrar)1 TrafficLightRenderer (com.intellij.codeInsight.daemon.impl.TrafficLightRenderer)1 EditorMarkupModel (com.intellij.openapi.editor.ex.EditorMarkupModel)1 NotNull (org.jetbrains.annotations.NotNull)1