public abstract class HighlightManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
HighlightManager.HideFlags |
Constructor and Description |
---|
HighlightManager() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addOccurrenceHighlight(Editor editor,
int start,
int end,
TextAttributes attributes,
int flags,
java.util.Collection<? super RangeHighlighter> outHighlighters,
java.awt.Color scrollMarkColor)
Highlights a specified range of text in an editor and optionally adds a mark on the gutter.
|
abstract void |
addOccurrenceHighlights(Editor editor,
PsiElement [] elements,
TextAttributes attributes,
boolean hideByTextChange,
java.util.Collection<? super RangeHighlighter> outHighlighters)
Highlights the text ranges of the specified elements in the specified editor.
|
abstract void |
addOccurrenceHighlights(Editor editor,
PsiReference [] occurrences,
TextAttributes attributes,
boolean hideByTextChange,
java.util.Collection<? super RangeHighlighter> outHighlighters)
Highlights the text ranges of the specified references in the specified editor.
|
abstract void |
addRangeHighlight(Editor editor,
int startOffset,
int endOffset,
TextAttributes attributes,
boolean hideByTextChange,
boolean hideByAnyKey,
java.util.Collection<? super RangeHighlighter> highlighters)
Highlights a specified range of text in an editor.
|
abstract void |
addRangeHighlight(Editor editor,
int startOffset,
int endOffset,
TextAttributes attributes,
boolean hideByTextChange,
java.util.Collection<? super RangeHighlighter> outHighlighters)
Highlights a specified range of text in an editor.
|
static HighlightManager |
getInstance(Project project) |
abstract boolean |
removeSegmentHighlighter(Editor editor,
RangeHighlighter highlighter)
Removes a range highlighter added by
addRangeHighlight(com.intellij.openapi.editor.Editor, int, int, com.intellij.openapi.editor.markup.TextAttributes, boolean, java.util.Collection<? super com.intellij.openapi.editor.markup.RangeHighlighter>) or another method in this class. |
public static final int HIDE_BY_ESCAPE
addOccurrenceHighlight(com.intellij.openapi.editor.Editor, int, int, com.intellij.openapi.editor.markup.TextAttributes, int, java.util.Collection<? super com.intellij.openapi.editor.markup.RangeHighlighter>, java.awt.Color)
should be removed when the user presses Esc.public static final int HIDE_BY_ANY_KEY
addOccurrenceHighlight(com.intellij.openapi.editor.Editor, int, int, com.intellij.openapi.editor.markup.TextAttributes, int, java.util.Collection<? super com.intellij.openapi.editor.markup.RangeHighlighter>, java.awt.Color)
should be removed when the user presses any key.public static final int HIDE_BY_TEXT_CHANGE
addOccurrenceHighlight(com.intellij.openapi.editor.Editor, int, int, com.intellij.openapi.editor.markup.TextAttributes, int, java.util.Collection<? super com.intellij.openapi.editor.markup.RangeHighlighter>, java.awt.Color)
should be removed when the editor text is changed.public static HighlightManager getInstance(Project project)
public abstract void addRangeHighlight(Editor editor, int startOffset, int endOffset, TextAttributes attributes, boolean hideByTextChange, java.util.Collection<? super RangeHighlighter> outHighlighters)
removeSegmentHighlighter(com.intellij.openapi.editor.Editor, com.intellij.openapi.editor.markup.RangeHighlighter)
must be used for that.editor
- the editor in which the highlighting is performed.startOffset
- the start offset of the text range to highlight.endOffset
- the end offset of the text range to highlight.attributes
- the attributes to highlight the text with.hideByTextChange
- if true, the highlighting is removed automatically if the editor text is changed.outHighlighters
- if not null, the created RangeHighlighter
object is added to this collection.public abstract void addRangeHighlight(Editor editor, int startOffset, int endOffset, TextAttributes attributes, boolean hideByTextChange, boolean hideByAnyKey, java.util.Collection<? super RangeHighlighter> highlighters)
removeSegmentHighlighter(com.intellij.openapi.editor.Editor, com.intellij.openapi.editor.markup.RangeHighlighter)
must be used for that.editor
- the editor in which the highlighting is performed.startOffset
- the start offset of the text range to highlight.endOffset
- the end offset of the text range to highlight.attributes
- the attributes to highlight the text with.hideByTextChange
- if true, the highlighting is removed automatically if the editor text is changed.hideByAnyKey
- if true, the highlighting is removed automatically when the user presses any key.highlighters
- if not null, the created RangeHighlighter
object is added to this collection.public abstract boolean removeSegmentHighlighter(Editor editor, RangeHighlighter highlighter)
addRangeHighlight(com.intellij.openapi.editor.Editor, int, int, com.intellij.openapi.editor.markup.TextAttributes, boolean, java.util.Collection<? super com.intellij.openapi.editor.markup.RangeHighlighter>)
or another method in this class.editor
- the editor in which the highlighter should be removed.highlighter
- the highlighter to remove.public abstract void addOccurrenceHighlights(Editor editor, PsiReference [] occurrences, TextAttributes attributes, boolean hideByTextChange, java.util.Collection<? super RangeHighlighter> outHighlighters)
editor
- the editor in which the highlighting is performed.occurrences
- the references to highlight.attributes
- the attributes to highlight the text with.hideByTextChange
- if true, the highlighting is removed automatically if the editor text is changed.outHighlighters
- if not null, the created RangeHighlighter
objects are added to this collection.public abstract void addOccurrenceHighlights(Editor editor, PsiElement [] elements, TextAttributes attributes, boolean hideByTextChange, java.util.Collection<? super RangeHighlighter> outHighlighters)
editor
- the editor in which the highlighting is performed.elements
- the elements to highlight.attributes
- the attributes to highlight the text with.hideByTextChange
- if true, the highlighting is removed automatically if the editor text is changed.outHighlighters
- if not null, the created RangeHighlighter
objects are added to this collection.public abstract void addOccurrenceHighlight(Editor editor, int start, int end, TextAttributes attributes, int flags, java.util.Collection<? super RangeHighlighter> outHighlighters, java.awt.Color scrollMarkColor)
removeSegmentHighlighter(com.intellij.openapi.editor.Editor, com.intellij.openapi.editor.markup.RangeHighlighter)
must be used for that.editor
- the editor in which the highlighting is performed.start
- the start offset of the text range to highlight.end
- the end offset of the text range to highlight.attributes
- the attributes to highlight the text with.flags
- the flags specifying when the highlighting is removed (a combination of
HIDE_BY_ESCAPE
, HIDE_BY_ANY_KEY
and HIDE_BY_TEXT_CHANGE
).outHighlighters
- if not null, the created RangeHighlighter
object is added to this collection.scrollMarkColor
- if not null, a gutter mark with the specified color is added in addition to the editor highlight.