Class TypedRangeHighlightProviderBase<R,T>
- java.lang.Object
-
- com.vladsch.plugin.util.ui.highlight.HighlightProviderBase<T>
-
- com.vladsch.plugin.util.ui.highlight.TypedRangeHighlightProviderBase<R,T>
-
- All Implemented Interfaces:
com.intellij.openapi.Disposable,HighlightProvider<T>,TypedRangeHighlightProvider<R,T>
- Direct Known Subclasses:
TextRangeHighlightProviderBase,WordHighlightProviderBase
public abstract class TypedRangeHighlightProviderBase<R,T> extends HighlightProviderBase<T> implements TypedRangeHighlightProvider<R,T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.intellij.openapi.Disposable
com.intellij.openapi.Disposable.Parent
-
Nested classes/interfaces inherited from interface com.vladsch.plugin.util.ui.highlight.TypedRangeHighlightProvider
TypedRangeHighlightProvider.Flags, TypedRangeHighlightProvider.IdeHighlight
-
-
Field Summary
-
Fields inherited from class com.vladsch.plugin.util.ui.highlight.HighlightProviderBase
myDelayedRunner, myHighlightColorRepeatIndex, myHighlightColors, myHighlightsMode, myInUpdateRegion, myLafManagerListener, myPendingChanged, mySettings
-
Fields inherited from interface com.vladsch.plugin.util.ui.highlight.TypedRangeHighlightProvider
ERROR_ATTRIBUTES_KEY, F_IDE_ERROR, F_IDE_HIGHLIGHT, F_IDE_IGNORED, F_IDE_WARNING, F_NONE, IDE_HIGHLIGHT, IGNORED_ATTRIBUTES_KEY, TYPO_ATTRIBUTES_KEY, WARNING_ATTRIBUTES_KEY
-
-
Constructor Summary
Constructors Constructor Description TypedRangeHighlightProviderBase(T settings)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intaddHighlightRange(R range, int flags, int orderIndex)Add highlight rangevoidclearHighlights()voidclearHighlightsRaw()voiddisposeComponent()@Nullable com.intellij.openapi.editor.markup.TextAttributesgetHighlightAttributes(int index, int flags, int startOffset, int endOffset, @Nullable java.awt.Color foregroundColor, @Nullable java.awt.Color effectColor, @Nullable com.intellij.openapi.editor.markup.EffectType effectType, int fontType)Must call getHighlightPattern() before calling this function for the first time to ensure the cached structures are updated.protected intgetHighlightIndex()@Nullable java.util.Map<R,java.lang.Integer>getHighlightRangeFlags()CAUTION: Do Not Use range value get flags for highlighting because implementors are free to modify the range before lookup, like change case NOTE: for lookup use value returned by getAdjustedRange()intgetHighlightRangeIndex(R range)Must call getHighlightPattern() before calling this function for the first time to ensure the cached structures are updated.@Nullable java.util.Map<R,java.lang.Integer>getHighlightRangeIndices()CAUTION: Do Not Use range value get flags for highlighting because implementors are free to modify the range before lookup, like change case NOTE: for lookup use value returned by getAdjustedRange()protected @Nullable java.util.HashMap<R,com.vladsch.flexmark.util.misc.Pair<java.lang.Integer,java.lang.Integer>>getHighlightState()static @Nullable com.intellij.openapi.editor.markup.TextAttributesgetIdeAttributes(int flags)intgetMaxHighlightRangeIndex()protected @Nullable java.util.Map<R,java.lang.Integer>getOriginalIndexMap()protected intgetOriginalOrderIndex()booleanhaveHighlights()protected abstract voidhighlightRangeAdded(R range, int flags, int originalOrderIndex)protected abstract voidhighlightRangeRemoved(R range)booleanisRangeHighlighted(R range)booleanisShowHighlights()voidremoveHighlightRange(R range)NOTE: does not call getAdjustedRange() because the subclass needs to take care of all adjustments hereprotected voidsetHighlightIndex(int index)protected voidsetHighlightState(@NotNull java.util.Map<R,com.vladsch.flexmark.util.misc.Pair<java.lang.Integer,java.lang.Integer>> state)Restore highlight stateprotected voidskipHighlightSets(int skipSets)-
Methods inherited from class com.vladsch.plugin.util.ui.highlight.HighlightProviderBase
addHighlightListener, dispose, endHighlightSet, enterUpdateRegion, fireHighlightsChanged, fireHighlightsUpdated, getCancellableJobScheduler, getColors, getDelayedRunner, getHighlightColorRepeatIndex, getHighlightColors, initComponent, isHighlightsMode, isInHighlightSet, leaveUpdateRegion, removeHighlightListener, restartHighlightSet, setHighlightsMode, settingsChanged, startHighlightSet, startHighlightSet, subscribeSettingsChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vladsch.plugin.util.ui.highlight.HighlightProvider
addHighlightListener, endHighlightSet, enterUpdateRegion, fireHighlightsChanged, fireHighlightsUpdated, highlightSet, highlightSet, initComponent, isHighlightsMode, leaveUpdateRegion, removeHighlightListener, restartHighlightSet, setHighlightsMode, settingsChanged, startHighlightSet, startHighlightSet
-
Methods inherited from interface com.vladsch.plugin.util.ui.highlight.TypedRangeHighlightProvider
addHighlightRange, getAdjustedRange, getHighlighter
-
-
-
-
Constructor Detail
-
TypedRangeHighlightProviderBase
public TypedRangeHighlightProviderBase(@NotNull T settings)
-
-
Method Detail
-
getHighlightState
@Nullable protected @Nullable java.util.HashMap<R,com.vladsch.flexmark.util.misc.Pair<java.lang.Integer,java.lang.Integer>> getHighlightState()
-
setHighlightState
protected void setHighlightState(@NotNull @NotNull java.util.Map<R,com.vladsch.flexmark.util.misc.Pair<java.lang.Integer,java.lang.Integer>> state)Restore highlight state- Parameters:
state- highlight state previously returned bygetHighlightState()
-
disposeComponent
public void disposeComponent()
- Specified by:
disposeComponentin interfaceHighlightProvider<R>- Overrides:
disposeComponentin classHighlightProviderBase<T>
-
getOriginalIndexMap
@Nullable protected @Nullable java.util.Map<R,java.lang.Integer> getOriginalIndexMap()
-
getOriginalOrderIndex
protected int getOriginalOrderIndex()
-
clearHighlightsRaw
public void clearHighlightsRaw()
-
clearHighlights
public void clearHighlights()
- Specified by:
clearHighlightsin interfaceHighlightProvider<R>
-
isRangeHighlighted
public boolean isRangeHighlighted(R range)
- Specified by:
isRangeHighlightedin interfaceTypedRangeHighlightProvider<R,T>
-
getHighlightRangeFlags
@Nullable public @Nullable java.util.Map<R,java.lang.Integer> getHighlightRangeFlags()
Description copied from interface:TypedRangeHighlightProviderCAUTION: Do Not Use range value get flags for highlighting because implementors are free to modify the range before lookup, like change case NOTE: for lookup use value returned by getAdjustedRange()- Specified by:
getHighlightRangeFlagsin interfaceTypedRangeHighlightProvider<R,T>- Returns:
- map of range to highlight flags
-
getHighlightRangeIndices
@Nullable public @Nullable java.util.Map<R,java.lang.Integer> getHighlightRangeIndices()
Description copied from interface:TypedRangeHighlightProviderCAUTION: Do Not Use range value get flags for highlighting because implementors are free to modify the range before lookup, like change case NOTE: for lookup use value returned by getAdjustedRange()- Specified by:
getHighlightRangeIndicesin interfaceTypedRangeHighlightProvider<R,T>- Returns:
- map of range to highlight flags
-
isShowHighlights
public boolean isShowHighlights()
- Specified by:
isShowHighlightsin interfaceHighlightProvider<R>
-
getHighlightAttributes
@Nullable public @Nullable com.intellij.openapi.editor.markup.TextAttributes getHighlightAttributes(int index, int flags, int startOffset, int endOffset, @Nullable @Nullable java.awt.Color foregroundColor, @Nullable @Nullable java.awt.Color effectColor, @Nullable @Nullable com.intellij.openapi.editor.markup.EffectType effectType, int fontType)Must call getHighlightPattern() before calling this function for the first time to ensure the cached structures are updated.- Specified by:
getHighlightAttributesin interfaceHighlightProvider<R>- Parameters:
index- highlighted range indexflags- flags for attributesstartOffset- start offset in editorendOffset- end offset in editorforegroundColor- foreground coloreffectColor- effect coloreffectType- effect typefontType- font type- Returns:
- text attributes to use for highlight or null if not highlighted
-
getIdeAttributes
@Nullable public static @Nullable com.intellij.openapi.editor.markup.TextAttributes getIdeAttributes(int flags)
-
getHighlightRangeIndex
public int getHighlightRangeIndex(R range)
Must call getHighlightPattern() before calling this function for the first time to ensure the cached structures are updated.- Specified by:
getHighlightRangeIndexin interfaceTypedRangeHighlightProvider<R,T>- Parameters:
range- highlighted range- Returns:
- original index of range
-
getMaxHighlightRangeIndex
public int getMaxHighlightRangeIndex()
- Specified by:
getMaxHighlightRangeIndexin interfaceTypedRangeHighlightProvider<R,T>
-
haveHighlights
public boolean haveHighlights()
- Specified by:
haveHighlightsin interfaceHighlightProvider<R>
-
highlightRangeAdded
protected abstract void highlightRangeAdded(R range, int flags, int originalOrderIndex)
-
addHighlightRange
public int addHighlightRange(R range, int flags, int orderIndex)
Description copied from interface:TypedRangeHighlightProviderAdd highlight range- Specified by:
addHighlightRangein interfaceTypedRangeHighlightProvider<R,T>- Parameters:
range- range object for highlightflags- flags for the highlightorderIndex- index to use if >0, else use next index- Returns:
- order index used for the highlight
-
skipHighlightSets
protected void skipHighlightSets(int skipSets)
- Specified by:
skipHighlightSetsin classHighlightProviderBase<T>
-
setHighlightIndex
protected void setHighlightIndex(int index)
- Specified by:
setHighlightIndexin classHighlightProviderBase<T>
-
getHighlightIndex
protected int getHighlightIndex()
- Specified by:
getHighlightIndexin classHighlightProviderBase<T>
-
highlightRangeRemoved
protected abstract void highlightRangeRemoved(R range)
-
removeHighlightRange
public void removeHighlightRange(R range)
NOTE: does not call getAdjustedRange() because the subclass needs to take care of all adjustments here- Specified by:
removeHighlightRangein interfaceTypedRangeHighlightProvider<R,T>- Parameters:
range- range to remove
-
-