Search in sources :

Example 1 with ERRORS_ATTRIBUTES

use of com.intellij.openapi.editor.colors.CodeInsightColors.ERRORS_ATTRIBUTES in project intellij-community by JetBrains.

the class ParameterNameHintsConfigurable method highlightErrorLines.

private static void highlightErrorLines(@NotNull List<Integer> lines, @NotNull EditorTextField editorTextField) {
    Editor editor = editorTextField.getEditor();
    if (editor == null)
        return;
    final TextAttributes attributes = editor.getColorsScheme().getAttributes(ERRORS_ATTRIBUTES);
    final Document document = editor.getDocument();
    final int totalLines = document.getLineCount();
    MarkupModel model = editor.getMarkupModel();
    model.removeAllHighlighters();
    lines.stream().filter((current) -> current < totalLines).forEach((line) -> model.addLineHighlighter(line, HighlighterLayer.ERROR, attributes));
}
Also used : Language(com.intellij.lang.Language) java.util(java.util) SelectionModel(com.intellij.openapi.editor.SelectionModel) Document(com.intellij.openapi.editor.Document) Option(com.intellij.codeInsight.hints.Option) ItemListener(java.awt.event.ItemListener) ERRORS_ATTRIBUTES(com.intellij.openapi.editor.colors.CodeInsightColors.ERRORS_ATTRIBUTES) DocumentEvent(com.intellij.openapi.editor.event.DocumentEvent) ContainerUtil(com.intellij.util.containers.ContainerUtil) JBLabel(com.intellij.ui.components.JBLabel) CodeInsightBundle(com.intellij.codeInsight.CodeInsightBundle) DialogWrapper(com.intellij.openapi.ui.DialogWrapper) HighlighterLayer(com.intellij.openapi.editor.markup.HighlighterLayer) InlayParameterHintsProvider(com.intellij.codeInsight.hints.InlayParameterHintsProvider) DocumentAdapter(com.intellij.openapi.editor.event.DocumentAdapter) FileTypes(com.intellij.openapi.fileTypes.FileTypes) HintUtilsKt(com.intellij.codeInsight.hints.HintUtilsKt) ComboBox(com.intellij.openapi.ui.ComboBox) EditorTextField(com.intellij.ui.EditorTextField) ItemEvent(java.awt.event.ItemEvent) JBCheckBox(com.intellij.ui.components.JBCheckBox) StringUtil(com.intellij.openapi.util.text.StringUtil) InlayParameterHintsExtension(com.intellij.codeInsight.hints.InlayParameterHintsExtension) ListCellRendererWrapper(com.intellij.ui.ListCellRendererWrapper) Editor(com.intellij.openapi.editor.Editor) Collectors(java.util.stream.Collectors) ListComboBoxModel(org.jdesktop.swingx.combobox.ListComboBoxModel) MarkupModel(com.intellij.openapi.editor.markup.MarkupModel) java.awt(java.awt) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) TextAttributes(com.intellij.openapi.editor.markup.TextAttributes) IdeBorderFactory(com.intellij.ui.IdeBorderFactory) EditorFactory(com.intellij.openapi.editor.EditorFactory) NotNull(org.jetbrains.annotations.NotNull) javax.swing(javax.swing) TextAttributes(com.intellij.openapi.editor.markup.TextAttributes) Editor(com.intellij.openapi.editor.Editor) Document(com.intellij.openapi.editor.Document) MarkupModel(com.intellij.openapi.editor.markup.MarkupModel)

Aggregations

CodeInsightBundle (com.intellij.codeInsight.CodeInsightBundle)1 HintUtilsKt (com.intellij.codeInsight.hints.HintUtilsKt)1 InlayParameterHintsExtension (com.intellij.codeInsight.hints.InlayParameterHintsExtension)1 InlayParameterHintsProvider (com.intellij.codeInsight.hints.InlayParameterHintsProvider)1 Option (com.intellij.codeInsight.hints.Option)1 Language (com.intellij.lang.Language)1 Document (com.intellij.openapi.editor.Document)1 Editor (com.intellij.openapi.editor.Editor)1 EditorFactory (com.intellij.openapi.editor.EditorFactory)1 SelectionModel (com.intellij.openapi.editor.SelectionModel)1 ERRORS_ATTRIBUTES (com.intellij.openapi.editor.colors.CodeInsightColors.ERRORS_ATTRIBUTES)1 DocumentAdapter (com.intellij.openapi.editor.event.DocumentAdapter)1 DocumentEvent (com.intellij.openapi.editor.event.DocumentEvent)1 HighlighterLayer (com.intellij.openapi.editor.markup.HighlighterLayer)1 MarkupModel (com.intellij.openapi.editor.markup.MarkupModel)1 TextAttributes (com.intellij.openapi.editor.markup.TextAttributes)1 FileTypes (com.intellij.openapi.fileTypes.FileTypes)1 ComboBox (com.intellij.openapi.ui.ComboBox)1 DialogWrapper (com.intellij.openapi.ui.DialogWrapper)1 StringUtil (com.intellij.openapi.util.text.StringUtil)1