Interface EditActions<PS,​SEG,​S>

    • Method Detail

      • appendText

        default void appendText​(String text)
        Appends the given text to the end of the text content.
      • append

        default void append​(StyledDocument<PS,​SEG,​S> document)
        Appends the given rich-text content to the end of this text-editing area.
      • append

        default void append​(SEG seg,
                            S style)
        Append text with a style.
      • insertText

        default void insertText​(int position,
                                String text)
        Inserts the given text at the given position.
        Parameters:
        position - The position to insert the text.
        text - The text to insert.
      • insertText

        default void insertText​(int paragraphIndex,
                                int columnPosition,
                                String text)
        Inserts the given text at the position returned from getAbsolutePosition(paragraphIndex, columnPosition).

        Caution: see TextEditingArea.getAbsolutePosition(int, int) to know how the column index argument can affect the returned position.

        Parameters:
        text - The text to insert
      • insert

        default void insert​(int position,
                            StyledDocument<PS,​SEG,​S> document)
        Inserts the given rich-text content at the given position.
        Parameters:
        position - The position to insert the text.
        document - The rich-text content to insert.
      • insert

        default void insert​(int position,
                            SEG seg,
                            S style)
        Inserts text with a style at the given position.
      • insert

        default void insert​(int paragraphIndex,
                            int columnPosition,
                            StyledDocument<PS,​SEG,​S> document)
        Inserts the given rich-text content at the position returned from getAbsolutePosition(paragraphIndex, columnPosition).

        Caution: see TextEditingArea.getAbsolutePosition(int, int) to know how the column index argument can affect the returned position.

        Parameters:
        document - The rich-text content to insert.
      • deleteText

        default void deleteText​(IndexRange range)
        Removes a range of text.
        Parameters:
        range - The range of text to delete. It must not be null. Its start and end values specify the start and end positions within the area.
        See Also:
        deleteText(int, int)
      • deleteText

        default void deleteText​(int start,
                                int end)
        Removes a range of text. It must hold 0 <= start <= end <= getLength().
        Parameters:
        start - Start position of the range to remove
        end - End position of the range to remove
      • deleteText

        default void deleteText​(int startParagraph,
                                int startColumn,
                                int endParagraph,
                                int endColumn)
        Removes a range of text. It must hold 0 <= start <= end <= getLength() where start = getAbsolutePosition(startParagraph, startColumn); and is inclusive, and int end = getAbsolutePosition(endParagraph, endColumn); and is exclusive.

        Caution: see TextEditingArea.getAbsolutePosition(int, int) to know how the column index argument can affect the returned position.

      • deletePreviousChar

        default void deletePreviousChar()
        Deletes the character that precedes the current caret position from the text.
      • deleteNextChar

        default void deleteNextChar()
        Deletes the character that follows the current caret position from the text.
      • clear

        default void clear()
        Clears the area, so that it displays only an empty paragraph.
      • replaceText

        default void replaceText​(String replacement)
        Replaces the entire content with the given text.
      • replace

        default void replace​(StyledDocument<PS,​SEG,​S> replacement)
        Replaces the entire content with the given rich-text content.
      • replaceSelection

        default void replaceSelection​(String replacement)
        Replaces the selection with the given replacement String. If there is no selection, then the replacement text is simply inserted at the current caret position. If there was a selection, then the selection is cleared and the given replacement text is inserted.
      • replaceSelection

        default void replaceSelection​(StyledDocument<PS,​SEG,​S> replacement)
        Replaces the selection with the given rich-text replacement. If there is no selection, then the replacement is simply inserted at the current caret position. If there was a selection, then the selection is cleared and the given replacement text is inserted.
      • moveSelectedText

        default void moveSelectedText​(int position)
        If something is currently selected and the given position is outside of the selection, moves the selected rich-text document to the given position by deleting it from the area and re-inserting it at the given position. If nothing is selected, moves the caret ot that position.