Interface OccurrenceMarker

  • All Known Implementing Classes:
    HtmlOccurrenceMarker, XmlOccurrenceMarker

    public interface OccurrenceMarker
    An OccurrenceMarker is called when the caret stops moving after a short period. If the current TokenMaker returns an instance of this class, it is told to mark all occurrences of the identifier at the caret position.
    • Method Detail

      • getTokenToMark

        Token getTokenToMark​(RSyntaxTextArea textArea)
        Returns the token to mark occurrences, of, provided it matches the criteria put forth by isValidType(RSyntaxTextArea, Token). For most languages, this method should return the token at the caret position.
        Parameters:
        textArea - The text area.
        Returns:
        The token to (possibly) mark occurrences of, or null if none.
      • isValidType

        boolean isValidType​(RSyntaxTextArea textArea,
                            Token t)
        Returns whether the specified token is a type that we can do a "mark occurrences" of. Typically, this will delegate to RSyntaxTextArea.getMarkOccurrencesOfTokenType(int).
        Parameters:
        textArea - The text area.
        t - The token.
        Returns:
        Whether we should mark all occurrences of this token.
      • markOccurrences

        void markOccurrences​(RSyntaxDocument doc,
                             Token t,
                             RSyntaxTextAreaHighlighter h,
                             SmartHighlightPainter p)
        Called when occurrences of a token should be marked.
        Parameters:
        doc - The document.
        t - The document whose relevant occurrences should be marked.
        h - The highlighter to add the highlights to.
        p - The painter for the highlights.