Interface AuthorHighlighter


  • @API(type=NOT_EXTENDABLE,
         src=PUBLIC)
    public interface AuthorHighlighter
    The highlighter which will be available to users to add, remove and check highlights. To have access to this highlighter use the following method: WSAuthorEditorPageBase.getHighlighter()
    • Method Detail

      • addHighlight

        Highlight addHighlight​(int startOffset,
                               int endOffset,
                               HighlightPainter painter,
                               java.lang.Object additionalData)
                        throws javax.swing.text.BadLocationException
        Adds a highlight to the view. Returns a tag that can be used to refer to the highlight.
        Parameters:
        startOffset - the beginning of the range >= 0
        endOffset - the inclusive end of the range >= startOffset
        painter - the painter to use for the actual highlighting
        additionalData - The additional data which can be stored in the highlight. May be null. In Web Author, if the provided additional data is a map, all the keys/value pairs of String/String type are inserted as attributes in the generated HTML span element (excepting the "class" key, all keys are inserted as attributes names with a "data-" prefix).
        Returns:
        an object that refers to the highlight
        Throws:
        javax.swing.text.BadLocationException - for an invalid range specification
      • removeHighlight

        void removeHighlight​(Highlight highlight)
        Removes a highlight from the view.
        Parameters:
        highlight - which highlight to remove
      • removeHighlights

        void removeHighlights​(Highlight[] highlights)
        Removes multiple highlights from the view.
        Parameters:
        highlights - which highlights to be removed
        Since:
        23.1
      • removeAllHighlights

        void removeAllHighlights()
        Removes all highlights this highlighter is responsible for.
      • getHighlights

        Highlight[] getHighlights()
        Fetches the current list of highlights.
        Returns:
        the highlight list
      • findNonPersistentHighlights

        Highlight[] findNonPersistentHighlights​(int startOffset,
                                                int endOffset)
        Find all non-persistent highlights that intersect a range of content.
        Parameters:
        startOffset - The start offset of the range.
        endOffset - The end offset of the range.
        Returns:
        The list of non-persistent highlights
      • addListener

        void addListener​(AuthorHighlighterListener listener)
        Adds a listener to be notified about changes regarding highlights.
        Parameters:
        listener - The listener
        Since:
        21.1