Class HtmlOccurrenceMarker

  • All Implemented Interfaces:
    OccurrenceMarker

    public class HtmlOccurrenceMarker
    extends java.lang.Object
    implements OccurrenceMarker
    Marks occurrences of the current token for HTML. Tags that require a closing tag have their "opposite" tag closed.
    Version:
    1.0
    • Field Detail

      • CLOSE_TAG_START

        private static final char[] CLOSE_TAG_START
      • TAG_SELF_CLOSE

        private static final char[] TAG_SELF_CLOSE
      • TAGS_REQUIRING_CLOSING

        private static final java.util.Set<java.lang.String> TAGS_REQUIRING_CLOSING
    • Constructor Detail

      • HtmlOccurrenceMarker

        public HtmlOccurrenceMarker()
    • Method Detail

      • getRequiredClosingTags

        public static java.util.Set<java.lang.String> getRequiredClosingTags()
        Returns the set of HTML tags that require a closing tag.
        Returns:
        The set of HTML tags that require a closing tag.
      • getTagNameTokenForCaretOffset

        public static Token getTagNameTokenForCaretOffset​(RSyntaxTextArea textArea,
                                                          OccurrenceMarker occurrenceMarker)
        If the caret is inside a tag, this method returns the token representing the tag name; otherwise, null is returned.

        Currently, this method only checks for tag names on the same line as the caret, for simplicity. In the future it could check prior lines until the tag name is found.

        Parameters:
        textArea - The text area.
        occurrenceMarker - The occurrence marker.
        Returns:
        The token to mark occurrences of. Note that, if the specified occurrence marker identifies tokens other than tag names, these other element types may be returned.