Package org.fxmisc.richtext
Interface EditActions<PS,SEG,S>
-
- All Superinterfaces:
TextEditingArea<PS,SEG,S>
- All Known Subinterfaces:
ClipboardActions<PS,SEG,S>
- All Known Implementing Classes:
CodeArea,GenericStyledArea,InlineCssTextArea,InlineCssTextField,StyleClassedTextArea,StyleClassedTextField,StyledTextArea,StyledTextField
public interface EditActions<PS,SEG,S> extends TextEditingArea<PS,SEG,S>
Specifies actions for editing the content of aTextEditingArea.
-
-
Property Summary
-
Properties inherited from interface org.fxmisc.richtext.TextEditingArea
anchor, beingUpdated, caretBounds, caretColumn, caretPosition, currentParagraph, length, selectedText, selectionBounds, selection, showCaret, text
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidappend(StyledDocument<PS,SEG,S> document)Appends the given rich-text content to the end of this text-editing area.default voidappend(SEG seg, S style)Append text with a style.default voidappendText(String text)Appends the given text to the end of the text content.default voidclear()Clears the area, so that it displays only an empty paragraph.default voiddeleteNextChar()Deletes the character that follows the current caret position from the text.default voiddeletePreviousChar()Deletes the character that precedes the current caret position from the text.default voiddeleteText(int start, int end)Removes a range of text.default voiddeleteText(int startParagraph, int startColumn, int endParagraph, int endColumn)Removes a range of text.default voiddeleteText(IndexRange range)Removes a range of text.default voidinsert(int paragraphIndex, int columnPosition, StyledDocument<PS,SEG,S> document)Inserts the given rich-text content at the position returned fromgetAbsolutePosition(paragraphIndex, columnPosition).default voidinsert(int position, StyledDocument<PS,SEG,S> document)Inserts the given rich-text content at the given position.default voidinsert(int position, SEG seg, S style)Inserts text with a style at the given position.default voidinsertText(int paragraphIndex, int columnPosition, String text)Inserts the given text at the position returned fromgetAbsolutePosition(paragraphIndex, columnPosition).default voidinsertText(int position, String text)Inserts the given text at the given position.default voidmoveSelectedText(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.default voidreplace(StyledDocument<PS,SEG,S> replacement)Replaces the entire content with the given rich-text content.default voidreplaceSelection(String replacement)Replaces the selection with the given replacement String.default voidreplaceSelection(StyledDocument<PS,SEG,S> replacement)Replaces the selection with the given rich-text replacement.default voidreplaceText(String replacement)Replaces the entire content with the given text.-
Methods inherited from interface org.fxmisc.richtext.TextEditingArea
anchorProperty, beingUpdatedProperty, caretBoundsProperty, caretColumnProperty, caretPositionProperty, createMultiChange, createMultiChange, currentParagraphProperty, displaceCaret, dispose, getAbsolutePosition, getAnchor, getCaretBounds, getCaretColumn, getCaretPosition, getCaretSelectionBind, getContent, getCurrentParagraph, getDocument, getLength, getLocale, getParagraph, getParagraphLength, getParagraphs, getParagraphSelection, getParagraphSelection, getSegOps, getSelectedText, getSelection, getSelectionBounds, getShowCaret, getText, getText, getText, getText, getText, isBeingUpdated, lengthProperty, multiPlainChanges, multiRichChanges, plainTextChanges, replace, replace, replace, replace, replace, replace, replaceText, replaceText, replaceText, richChanges, selectedTextProperty, selectionBoundsProperty, selectionProperty, selectRange, selectRange, setShowCaret, showCaretProperty, subDocument, subDocument, subDocument, subDocument, textProperty
-
-
-
-
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.
-
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 fromgetAbsolutePosition(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 fromgetAbsolutePosition(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 hold0 <= start <= end <= getLength().- Parameters:
start- Start position of the range to removeend- 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 hold0 <= start <= end <= getLength()wherestart = getAbsolutePosition(startParagraph, startColumn);and is inclusive, andint 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.
-
-