Class TypedRangeHighlightProviderBase<R,​T>

    • 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 by getHighlightState()
      • getOriginalIndexMap

        @Nullable
        protected @Nullable java.util.Map<R,​java.lang.Integer> getOriginalIndexMap()
      • getOriginalOrderIndex

        protected int getOriginalOrderIndex()
      • clearHighlightsRaw

        public void clearHighlightsRaw()
      • getHighlightRangeFlags

        @Nullable
        public @Nullable java.util.Map<R,​java.lang.Integer> getHighlightRangeFlags()
        Description copied from interface: TypedRangeHighlightProvider
        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()
        Specified by:
        getHighlightRangeFlags in interface TypedRangeHighlightProvider<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: TypedRangeHighlightProvider
        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()
        Specified by:
        getHighlightRangeIndices in interface TypedRangeHighlightProvider<R,​T>
        Returns:
        map of range to highlight flags
      • 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:
        getHighlightAttributes in interface HighlightProvider<R>
        Parameters:
        index - highlighted range index
        flags - flags for attributes
        startOffset - start offset in editor
        endOffset - end offset in editor
        foregroundColor - foreground color
        effectColor - effect color
        effectType - effect type
        fontType - 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:
        getHighlightRangeIndex in interface TypedRangeHighlightProvider<R,​T>
        Parameters:
        range - highlighted range
        Returns:
        original index of range
      • 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: TypedRangeHighlightProvider
        Add highlight range
        Specified by:
        addHighlightRange in interface TypedRangeHighlightProvider<R,​T>
        Parameters:
        range - range object for highlight
        flags - flags for the highlight
        orderIndex - index to use if >0, else use next index
        Returns:
        order index used for the highlight
      • 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:
        removeHighlightRange in interface TypedRangeHighlightProvider<R,​T>
        Parameters:
        range - range to remove