Top Description Methods
org.fxmisc.richtext

public Interface EditActions<PS, SEG, S>

extends TextEditingArea<PS, SEG, S>
Known Direct Subinterfaces
org.fxmisc.richtext.ClipboardActions
Known Direct Implementers
org.fxmisc.richtext.GenericStyledArea
Imports
javafx.scene.control.IndexRange, org.fxmisc.richtext.model.StyledDocument

Specifies actions for editing the content of a TextEditingArea.

Method Summary

Modifier and TypeMethod and Description
public default void
append(StyledDocument<PS, SEG, S> document)

Appends the given rich-text content to the end of this text-editing area.

public default void
append(SEG seg, S style)

Append text with a style.

public default void
appendText(String text)

Appends the given text to the end of the text content.

public default void
clear()

Clears the area, so that it displays only an empty paragraph.

public default void
deleteNextChar()

Deletes the character that follows the current caret position from the text.

public default void
deletePreviousChar()

Deletes the character that precedes the current caret position from the text.

public default void
deleteText(IndexRange
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.
range
)

Removes a range of text.

public default void
deleteText(int
Start position of the range to remove
start
,
int
End position of the range to remove
end
)

Removes a range of text.

public default void
deleteText(int startParagraph, int startColumn, int endParagraph, int endColumn)

Removes a range of text.

public default void
insert(int
The position to insert the text.
position
,
StyledDocument<PS, SEG, S>
The rich-text content to insert.
document
)

Inserts the given rich-text content at the given position.

public default void
insert(int position, SEG seg, S style)

Inserts text with a style at the given position.

public default void
insert(int paragraphIndex, int columnPosition, StyledDocument<PS, SEG, S>
The rich-text content to insert.
document
)

Inserts the given rich-text content at the position returned from getAbsolutePosition(paragraphIndex, columnPosition).

public default void
insertText(int
The position to insert the text.
position
,
String
The text to insert.
text
)

Inserts the given text at the given position.

public default void
insertText(int paragraphIndex, int columnPosition, String
The text to insert
text
)

Inserts the given text at the position returned from getAbsolutePosition(paragraphIndex, columnPosition).

public 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.

public default void
replace(StyledDocument<PS, SEG, S> replacement)

Replaces the entire content with the given rich-text content.

public default void
replaceSelection(String replacement)

Replaces the selection with the given replacement String.

public default void
replaceSelection(StyledDocument<PS, SEG, S> replacement)

Replaces the selection with the given rich-text replacement.

public default void
replaceText(String replacement)

Replaces the entire content with the given text.

Inherited from org.fxmisc.richtext.TextEditingArea:
anchorPropertybeingUpdatedPropertycaretBoundsPropertycaretColumnPropertycaretPositionPropertycreateMultiChangecreateMultiChangecurrentParagraphPropertydisplaceCaretdisposegetAbsolutePositiongetAnchorgetCaretBoundsgetCaretColumngetCaretPositiongetCaretSelectionBindgetContentgetCurrentParagraphgetDocumentgetLengthgetLocalegetParagraphgetParagraphLengthgetParagraphsgetParagraphSelectiongetParagraphSelectiongetSegOpsgetSelectedTextgetSelectiongetSelectionBoundsgetShowCaretgetTextgetTextgetTextgetTextgetTextisBeingUpdatedlengthPropertymultiPlainChangesmultiRichChangesplainTextChangesreplacereplacereplacereplacereplacereplacereplaceTextreplaceTextreplaceTextrichChangesselectedTextPropertyselectionBoundsPropertyselectionPropertyselectRangeselectRangesetShowCaretshowCaretPropertysubDocumentsubDocumentsubDocumentsubDocumenttextProperty

Method Detail

appendback to summary
public default void append(StyledDocument<PS, SEG, S> document)

Appends the given rich-text content to the end of this text-editing area.

appendback to summary
public default void append(SEG seg, S style)

Append text with a style.

appendTextback to summary
public default void appendText(String text)

Appends the given text to the end of the text content.

clearback to summary
public default void clear()

Clears the area, so that it displays only an empty paragraph.

deleteNextCharback to summary
public default void deleteNextChar()

Deletes the character that follows the current caret position from the text.

deletePreviousCharback to summary
public default void deletePreviousChar()

Deletes the character that precedes the current caret position from the text.

deleteTextback to summary
public default void deleteText(IndexRange range)

Removes a range of text.

Parameters
range:IndexRange

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)
deleteTextback to summary
public default void deleteText(int start, int end)

Removes a range of text. It must hold 0 <= start <= end <= getLength().

Parameters
start:int

Start position of the range to remove

end:int

End position of the range to remove

deleteTextback to summary
public 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 getAbsolutePosition(int, int) to know how the column index argument can affect the returned position.

insertback to summary
public default void insert(int position, StyledDocument<PS, SEG, S> document)

Inserts the given rich-text content at the given position.

Parameters
position:int

The position to insert the text.

document:StyledDocument<PS, SEG, S>

The rich-text content to insert.

insertback to summary
public default void insert(int position, SEG seg, S style)

Inserts text with a style at the given position.

insertback to summary
public 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 getAbsolutePosition(int, int) to know how the column index argument can affect the returned position.

Parameters
document:StyledDocument<PS, SEG, S>

The rich-text content to insert.

insertTextback to summary
public default void insertText(int position, String text)

Inserts the given text at the given position.

Parameters
position:int

The position to insert the text.

text:String

The text to insert.

insertTextback to summary
public default void insertText(int paragraphIndex, int columnPosition, String text)

Inserts the given text at the position returned from getAbsolutePosition(paragraphIndex, columnPosition).

Caution

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

Parameters
text:String

The text to insert

moveSelectedTextback to summary
public 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.

replaceback to summary
public default void replace(StyledDocument<PS, SEG, S> replacement)

Replaces the entire content with the given rich-text content.

replaceSelectionback to summary
public 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.

replaceSelectionback to summary
public 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.

replaceTextback to summary
public default void replaceText(String replacement)

Replaces the entire content with the given text.