Class TextArea.Paragraph

  • Enclosing class:
    TextArea

    public static final class TextArea.Paragraph
    extends java.lang.Object
    Class representing a paragraph of text.
    • Constructor Detail

      • Paragraph

        public Paragraph()
    • Method Detail

      • getCharacters

        public java.lang.CharSequence getCharacters()
        Returns:
        The characters in this paragraph.
      • getTextArea

        public TextArea getTextArea()
        Returns:
        The TextArea this paragraph belongs to.
      • append

        public void append​(char character)
        Append the given character to this paragraph.
        Parameters:
        character - The character to append.
      • clear

        public void clear()
        Clear all the characters in this paragraph.
      • insertText

        public void insertText​(java.lang.CharSequence text,
                               int index)
        Insert the characters at the given index into this paragraph.
        Parameters:
        text - The sequence of characters to insert.
        index - The index into this paragraph where to insert the text.
      • removeText

        public void removeText​(int index)
        Remove all the text in this paragraph starting at the index.
        Parameters:
        index - The starting index in the paragraph where to remove the text.
      • removeText

        public void removeText​(int index,
                               int count)
        Remove some of the text in this paragraph.
        Parameters:
        index - Index in the paragraph where to start to remove the text.
        count - Number of characters to remove starting at the index.
      • getOffset

        public int getOffset()
        Returns:
        The relative offset of the text in this paragraph from the beginning of the entire text.