public class MarkupModelImpl extends UserDataHolderBase implements MarkupModelEx
Modifier and Type | Method and Description |
---|---|
RangeHighlighter |
addLineHighlighter(int lineNumber,
int layer,
TextAttributes textAttributes)
Adds a highlighter covering the specified line in the document.
|
void |
addMarkupModelListener(Disposable parentDisposable,
MarkupModelListener listener) |
RangeHighlighterEx |
addPersistentLineHighlighter(int lineNumber,
int layer,
TextAttributes textAttributes) |
RangeHighlighter |
addRangeHighlighter(int startOffset,
int endOffset,
int layer,
TextAttributes textAttributes,
HighlighterTargetArea targetArea)
Adds a highlighter covering the specified range of the document, which can modify
the attributes used for text rendering, add a gutter marker and so on.
|
void |
addRangeHighlighter(RangeHighlighterEx marker,
int start,
int end,
boolean greedyToLeft,
boolean greedyToRight,
int layer) |
RangeHighlighterEx |
addRangeHighlighterAndChangeAttributes(int startOffset,
int endOffset,
int layer,
TextAttributes textAttributes,
HighlighterTargetArea targetArea,
boolean isPersistent,
Consumer<? super RangeHighlighterEx> changeAttributesAction) |
void |
changeAttributesInBatch(RangeHighlighterEx highlighter,
Consumer<? super RangeHighlighterEx> changeAttributesAction) |
boolean |
containsHighlighter(RangeHighlighter highlighter) |
void |
dispose() |
void |
fireAfterAdded(RangeHighlighterEx segmentHighlighter) |
void |
fireAttributesChanged(RangeHighlighterEx segmentHighlighter,
boolean renderersChanged,
boolean fontStyleOrColorChanged) |
void |
fireBeforeRemoved(RangeHighlighterEx segmentHighlighter) |
RangeHighlighter [] |
getAllHighlighters()
Returns all highlighter instances contained in the model.
|
Document |
getDocument()
Returns the document to which the markup model is attached.
|
MarkupIterator<RangeHighlighterEx> |
overlappingIterator(int startOffset,
int endOffset) |
MarkupIterator<RangeHighlighterEx> |
overlappingIterator(int startOffset,
int endOffset,
boolean onlyRenderedInGutter,
boolean onlyRenderedInScrollBar) |
boolean |
processRangeHighlightersOutside(int start,
int end,
Processor<? super RangeHighlighterEx> processor) |
boolean |
processRangeHighlightersOverlappingWith(int start,
int end,
Processor<? super RangeHighlighterEx> processor) |
void |
removeAllHighlighters()
Removes all highlighter instances.
|
void |
removeHighlighter(RangeHighlighter segmentHighlighter)
Removes the specified highlighter instance.
|
static TextRangeInterval |
roundToLineBoundaries(Document document,
int startOffset,
int endOffset) |
void |
setRangeHighlighterAttributes(RangeHighlighter highlighter,
TextAttributes textAttributes) |
changeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUserData, putUserData
public void dispose()
dispose
in interface MarkupModelEx
public RangeHighlighter addLineHighlighter(int lineNumber, int layer, TextAttributes textAttributes)
MarkupModel
addLineHighlighter
in interface MarkupModel
lineNumber
- the line number of the line to highlight.layer
- relative priority of the highlighter (highlighters with higher
layer number override highlighters with lower layer number;
layer number values for standard IDE highlighters are defined in
HighlighterLayer
)textAttributes
- the attributes to use for highlighting, or null
if the highlighter
does not modify the text attributes.public RangeHighlighterEx addPersistentLineHighlighter(int lineNumber, int layer, TextAttributes textAttributes)
addPersistentLineHighlighter
in interface MarkupModelEx
public RangeHighlighter [] getAllHighlighters()
MarkupModel
getAllHighlighters
in interface MarkupModel
public RangeHighlighterEx addRangeHighlighterAndChangeAttributes(int startOffset, int endOffset, int layer, TextAttributes textAttributes, HighlighterTargetArea targetArea, boolean isPersistent, Consumer<? super RangeHighlighterEx> changeAttributesAction)
addRangeHighlighterAndChangeAttributes
in interface MarkupModelEx
public void changeAttributesInBatch(RangeHighlighterEx highlighter, Consumer<? super RangeHighlighterEx> changeAttributesAction)
changeAttributesInBatch
in interface MarkupModelEx
public void addRangeHighlighter(RangeHighlighterEx marker, int start, int end, boolean greedyToLeft, boolean greedyToRight, int layer)
addRangeHighlighter
in interface MarkupModelEx
public RangeHighlighter addRangeHighlighter(int startOffset, int endOffset, int layer, TextAttributes textAttributes, HighlighterTargetArea targetArea)
MarkupModel
RangeMarker
instances and use the same rules for tracking
the range after document changes.addRangeHighlighter
in interface MarkupModel
startOffset
- the start offset of the range to highlight.endOffset
- the end offset of the range to highlight.layer
- relative priority of the highlighter (highlighters with higher
layer number override highlighters with lower layer number;
layer number values for standard IDE highlighters are defined in
HighlighterLayer
)textAttributes
- the attributes to use for highlighting, or null
if the highlighter
does not modify the text attributes.targetArea
- type of highlighting (specific range or all full lines covered by the range).public void removeHighlighter(RangeHighlighter segmentHighlighter)
MarkupModel
removeHighlighter
in interface MarkupModel
segmentHighlighter
- the highlighter to remove.public void removeAllHighlighters()
MarkupModel
removeAllHighlighters
in interface MarkupModel
public Document getDocument()
MarkupModel
getDocument
in interface MarkupModel
public void addMarkupModelListener(Disposable parentDisposable, MarkupModelListener listener)
addMarkupModelListener
in interface MarkupModelEx
public void setRangeHighlighterAttributes(RangeHighlighter highlighter, TextAttributes textAttributes)
setRangeHighlighterAttributes
in interface MarkupModelEx
public void fireAttributesChanged(RangeHighlighterEx segmentHighlighter, boolean renderersChanged, boolean fontStyleOrColorChanged)
fireAttributesChanged
in interface MarkupModelEx
public void fireAfterAdded(RangeHighlighterEx segmentHighlighter)
fireAfterAdded
in interface MarkupModelEx
public void fireBeforeRemoved(RangeHighlighterEx segmentHighlighter)
fireBeforeRemoved
in interface MarkupModelEx
public boolean containsHighlighter(RangeHighlighter highlighter)
containsHighlighter
in interface MarkupModelEx
public boolean processRangeHighlightersOverlappingWith(int start, int end, Processor<? super RangeHighlighterEx> processor)
processRangeHighlightersOverlappingWith
in interface MarkupModelEx
public boolean processRangeHighlightersOutside(int start, int end, Processor<? super RangeHighlighterEx> processor)
processRangeHighlightersOutside
in interface MarkupModelEx
public MarkupIterator<RangeHighlighterEx> overlappingIterator(int startOffset, int endOffset)
overlappingIterator
in interface MarkupModelEx
public MarkupIterator<RangeHighlighterEx> overlappingIterator(int startOffset, int endOffset, boolean onlyRenderedInGutter, boolean onlyRenderedInScrollBar)
overlappingIterator
in interface MarkupModelEx
public static TextRangeInterval roundToLineBoundaries(Document document, int startOffset, int endOffset)