Interface StyledDocument<PS,​SEG,​S>

    • Method Detail

      • length

        int length()
      • getText

        java.lang.String getText()
      • getText

        default java.lang.String getText​(javafx.scene.control.IndexRange range)
      • getText

        default java.lang.String getText​(int start,
                                         int end)
      • getText

        default java.lang.String getText​(int paragraphIndex)
      • getParagraph

        default Paragraph<PS,​SEG,​S> getParagraph​(int index)
      • getParagraphLength

        default int getParagraphLength​(int paragraphIndex)
      • subSequence

        default StyledDocument<PS,​SEG,​S> subSequence​(javafx.scene.control.IndexRange range)
      • charAt

        default char charAt​(int index)
      • getStyleOfChar

        default S getStyleOfChar​(int index)
      • getStyleOfChar

        default S getStyleOfChar​(int paragraph,
                                 int column)
      • getStyleAtPosition

        default S getStyleAtPosition​(int position)
      • getStyleAtPosition

        default S getStyleAtPosition​(int paragraph,
                                     int position)
      • getParagraphStyle

        default PS getParagraphStyle​(int paragraph)
      • getParagraphStyleAtPosition

        default PS getParagraphStyleAtPosition​(int position)
      • getStyleRangeAtPosition

        default javafx.scene.control.IndexRange getStyleRangeAtPosition​(int position)
      • getStyleRangeAtPosition

        default javafx.scene.control.IndexRange getStyleRangeAtPosition​(int paragraph,
                                                                        int position)
      • getStyleSpans

        default StyleSpans<S> getStyleSpans​(int from,
                                            int to)
      • getStyleSpans

        default StyleSpans<S> getStyleSpans​(int paragraph)
      • getStyleSpans

        default StyleSpans<S> getStyleSpans​(int paragraph,
                                            int from,
                                            int to)
      • getAbsolutePosition

        default int getAbsolutePosition​(int paragraphIndex,
                                        int columnPosition)
        Returns the absolute position (i.e. the spot in-between characters) of the given column position in the given paragraph.

        For example, given a text with only one line "text" and a columnPosition value of 1, the value, 1, as in "position 1" would be returned:

          ┌ character index 0
          | ┌ character index 1
          | |   ┌ character index 3
          | |   |
          v v   v
        
         |t|e|x|t|
        
         ^ ^     ^
         | |     |
         | |     â”” position 4
         | â”” position 1
         â”” position 0
         

        Warning: Off-By-One errors can easily occur

        If the column index spans outside of the given paragraph's length, the returned value will pass on to the previous/next paragraph. In other words, given a document with two paragraphs (where the first paragraph's text is "some" and the second "thing"), then the following statements are true:

        • getAbsolutePosition(0, "some".length()) == 4 == getAbsolutePosition(1, -1)
        • getAbsolutePosition(0, "some".length() + 1) == 5 == getAbsolutePosition(1, 0)
        Parameters:
        paragraphIndex - The index of the paragraph from which to start.
        columnPosition - If positive, the index going forward (the given paragraph's line or the next one(s)). If negative, the index going backward (the previous paragraph's line(s))