public class MarkupModelWindow extends UserDataHolderBase implements MarkupModelEx
Constructor and Description |
---|
MarkupModelWindow(MarkupModelEx editorMarkupModel,
DocumentWindow document) |
Modifier and Type | Method and Description |
---|---|
RangeHighlighter |
addLineHighlighter(int line,
int layer,
TextAttributes textAttributes)
Adds a highlighter covering the specified line in the document.
|
void |
addMarkupModelListener(Disposable parentDisposable,
MarkupModelListener listener) |
RangeHighlighterEx |
addPersistentLineHighlighter(int line,
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 fontStyleChanged) |
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 rangeHighlighter)
Removes the specified highlighter instance.
|
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 MarkupModelWindow(MarkupModelEx editorMarkupModel, DocumentWindow document)
public Document getDocument()
MarkupModel
getDocument
in interface MarkupModel
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 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 RangeHighlighter addLineHighlighter(int line, int layer, TextAttributes textAttributes)
MarkupModel
addLineHighlighter
in interface MarkupModel
line
- 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 void removeHighlighter(RangeHighlighter rangeHighlighter)
MarkupModel
removeHighlighter
in interface MarkupModel
rangeHighlighter
- the highlighter to remove.public void removeAllHighlighters()
MarkupModel
removeAllHighlighters
in interface MarkupModel
public RangeHighlighter [] getAllHighlighters()
MarkupModel
getAllHighlighters
in interface MarkupModel
public void dispose()
dispose
in interface MarkupModelEx
public RangeHighlighterEx addPersistentLineHighlighter(int line, int layer, TextAttributes textAttributes)
addPersistentLineHighlighter
in interface MarkupModelEx
public boolean containsHighlighter(RangeHighlighter highlighter)
containsHighlighter
in interface MarkupModelEx
public void addMarkupModelListener(Disposable parentDisposable, MarkupModelListener listener)
addMarkupModelListener
in interface MarkupModelEx
public void setRangeHighlighterAttributes(RangeHighlighter highlighter, TextAttributes textAttributes)
setRangeHighlighterAttributes
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 void fireAttributesChanged(RangeHighlighterEx segmentHighlighter, boolean renderersChanged, boolean fontStyleChanged)
fireAttributesChanged
in interface MarkupModelEx
public void fireAfterAdded(RangeHighlighterEx segmentHighlighter)
fireAfterAdded
in interface MarkupModelEx
public void fireBeforeRemoved(RangeHighlighterEx segmentHighlighter)
fireBeforeRemoved
in interface MarkupModelEx
public void addRangeHighlighter(RangeHighlighterEx marker, int start, int end, boolean greedyToLeft, boolean greedyToRight, int layer)
addRangeHighlighter
in interface MarkupModelEx