PS
- type of style that can be applied to paragraphs (e.g. TextFlow
.SEG
- type of segment used in Paragraph
. Can be only text (plain or styled) or
a type that combines text and other Node
s.S
- type of style that can be applied to a segment.org.fxmisc.flowless.Virtualized
, ClipboardActions<PS,SEG,S>
, EditActions<PS,SEG,S>
, TwoDimensional
, NavigationActions<PS,SEG,S>
, StyleActions<PS,S>
, TextEditingArea<PS,SEG,S>
, UndoActions
, ViewActions<PS,SEG,S>
StyledTextArea
public class GenericStyledArea<PS,SEG,S> extends javafx.scene.layout.Region implements TextEditingArea<PS,SEG,S>, EditActions<PS,SEG,S>, ClipboardActions<PS,SEG,S>, NavigationActions<PS,SEG,S>, StyleActions<PS,S>, UndoActions, ViewActions<PS,SEG,S>, TwoDimensional, org.fxmisc.flowless.Virtualized
EditableStyledDocument
.
Accepts user input (keyboard, mouse) and provides API to assign style to text ranges. It is suitable for
syntax highlighting and rich-text editors.
By default, scroll bars do not appear when the content spans outside of the viewport.
To add scroll bars, the area needs to be wrapped in a VirtualizedScrollPane
. For example,
// shows area without scroll bars
InlineCssTextArea area = new InlineCssTextArea();
// add scroll bars that will display as needed
VirtualizedScrollPane<InlineCssTextArea> vsPane = new VirtualizedScrollPane<>(area);
Parent parent = // creation code
parent.getChildren().add(vsPane)
Every time the underlying EditableStyledDocument
changes via user interaction (e.g. typing) through
the GenericStyledArea
, the area will scroll to insure the caret is kept in view. However, this does not
occur if changes are done programmatically. For example, let's say the area is displaying the bottom part
of the area's EditableStyledDocument
and some code changes something in the top part of the document
that is not currently visible. If there is no call to requestFollowCaret()
at the end of that code,
the area will not auto-scroll to that section of the document. The change will occur, and the user will continue
to see the bottom part of the document as before. If such a call is there, then the area will scroll
to the top of the document and no longer display the bottom part of it.
For example...
// assuming the user is currently seeing the top of the area
// then changing the bottom, currently not visible part of the area...
int startParIdx = 40;
int startColPosition = 2;
int endParIdx = 42;
int endColPosition = 10;
// ...by itself will not scroll the viewport to where the change occurs
area.replaceText(startParIdx, startColPosition, endParIdx, endColPosition, "replacement text");
// adding this line after the last modification to the area will cause the viewport to scroll to that change
// leaving the following line out will leave the viewport unaffected and the user will not notice any difference
area.requestFollowCaret();
Additionally, when overriding the default user-interaction behavior, remember to include a call
to requestFollowCaret()
.
UndoManager
The default UndoManager can undo/redo either PlainTextChange
s or RichTextChange
s. To create
your own specialized version that may use changes different than these (or a combination of these changes
with others), create them using the convenient factory methods in UndoUtils
.
GenericStyledArea
uses KEY_TYPED
to handle ordinary
character input and KEY_PRESSED
to handle control key
combinations (including Enter and Tab). To add or override some keyboard
shortcuts, while keeping the rest in place, you would combine the default
event handler with a new one that adds or overrides some of the default
key combinations.
For example, this is how to bind Ctrl+S
to the save()
operation:
import static javafx.scene.input.KeyCode.*;
import static javafx.scene.input.KeyCombination.*;
import static org.fxmisc.wellbehaved.event.EventPattern.*;
import static org.fxmisc.wellbehaved.event.InputMap.*;
import org.fxmisc.wellbehaved.event.Nodes;
// installs the following consume InputMap,
// so that a CTRL+S event saves the document and consumes the event
Nodes.addInputMap(area, consume(keyPressed(S, CONTROL_DOWN), event -> save()));
The following lists either EventPattern
s that cannot be
overridden without negatively affecting the default mouse behavior or describe how to safely override things
in a special way without disrupting the auto scroll behavior.
EventPattern.mousePressed(MouseButton.PRIMARY).onlyIf(e -> e.getClickCount() == 1)
).
Do not override. Instead, use onOutsideSelectionMousePressed
,
onInsideSelectionMousePressReleased
, or see next item.
ViewActions.hideContextMenu()
some((where in your
overriding InputMap to maintain this behavior), these can be safely overridden via any of the
InputMapTemplate's factory methods
or
InputMap's factory methods
.
EventPattern.eventType(MouseEvent.DRAG_DETECTED).onlyIf(e -> e.getButton() == MouseButton.PRIMARY && !e.isMiddleButtonDown() && !e.isSecondaryButtonDown())
).
Do not override. Instead, use onNewSelectionDrag
or onSelectionDrag
.
EventPattern.mouseDragged().onlyIf(e -> e.getButton() == MouseButton.PRIMARY && !e.isMiddleButtonDown() && !e.isSecondaryButtonDown())
)
Do not override, but see next item.
EventPattern
s without affecting default behavior only if
process InputMaps (
InputMapTemplate.process(javafx.event.EventType, BiFunction)
,
InputMapTemplate.process(org.fxmisc.wellbehaved.event.EventPattern, BiFunction)
,
InputMap.process(javafx.event.EventType, Function)
, or
InputMap.process(org.fxmisc.wellbehaved.event.EventPattern, Function)
) are used and InputHandler.Result.PROCEED
is returned.
The area has a "catch all" Mouse Drag InputMap that will auto scroll towards the mouse drag event when it
occurs outside the bounds of the area and will stop auto scrolling when the mouse event occurs within the
area. However, this only works if the event is not consumed before the event reaches that InputMap.
To insure the auto scroll feature is enabled, set isAutoScrollOnDragDesired()
to true in your
process InputMap. If the feature is not desired for that specific drag event, set it to false in the
process InputMap.
Note: Due to this "catch-all" nature, all Mouse Drag Events are consumed.
EventPattern.mouseReleased().onlyIf(e -> e.getButton() == MouseButton.PRIMARY && !e.isMiddleButtonDown() && !e.isSecondaryButtonDown())
).
Do not override. Instead, use onNewSelectionDragFinished
, onSelectionDropped
, or see next item.
EventPattern
s without affecting default behavior only if
process InputMaps (
InputMapTemplate.process(javafx.event.EventType, BiFunction)
,
InputMapTemplate.process(org.fxmisc.wellbehaved.event.EventPattern, BiFunction)
,
InputMap.process(javafx.event.EventType, Function)
, or
InputMap.process(org.fxmisc.wellbehaved.event.EventPattern, Function)
) are used and InputHandler.Result.PROCEED
is returned.
The area has a "catch-all" InputMap that will consume all mouse released events and stop auto scroll if it
was scrolling. However, this only works if the event is not consumed before the event reaches that InputMap.
Note: Due to this "catch-all" nature, all Mouse Released Events are consumed.
Refer to the RichTextFX CSS Reference Guide .
To distinguish the actual operations one can do on this area from the boilerplate methods within this area (e.g. properties and their getters/setters, etc.), look at the interfaces this area implements. Each lists and documents methods that fall under that category.
To update multiple portions of the area's underlying document in one call, see createMultiChange()
.
To calculate a position or index within the area, read through the javadoc of
TwoDimensional
and TwoDimensional.Bias
.
Also, read the difference between "position" and "index" in
StyledDocument.getAbsolutePosition(int, int)
.
EditableStyledDocument
,
TwoDimensional
,
TwoDimensional.Bias
,
VirtualFlow
,
VirtualizedScrollPane
,
Caret
,
Selection
,
CaretSelectionBind
Type | Property | Description |
---|---|---|
javafx.beans.property.BooleanProperty |
autoScrollOnDragDesired |
|
org.reactfx.SuspendableNo |
beingUpdated |
True when an update to the area's
underling editable document is still occurring
or the viewport is being updated. |
javafx.beans.property.ObjectProperty<javafx.scene.control.ContextMenu> |
contextMenuObject |
|
javafx.beans.property.DoubleProperty |
contextMenuXOffset |
|
javafx.beans.property.DoubleProperty |
contextMenuYOffset |
|
javafx.beans.property.BooleanProperty |
editable |
|
org.reactfx.value.Var<java.lang.Double> |
estimatedScrollX |
The estimated scrollX value.
|
org.reactfx.value.Var<java.lang.Double> |
estimatedScrollY |
The estimated scrollY value.
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
length |
|
javafx.beans.property.ObjectProperty<java.time.Duration> |
mouseOverTextDelay |
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> |
onInsideSelectionMousePressReleased |
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> |
onNewSelectionDragFinished |
|
javafx.beans.property.ObjectProperty<java.util.function.Consumer<javafx.geometry.Point2D>> |
onNewSelectionDrag |
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> |
onOutsideSelectionMousePressed |
|
javafx.beans.property.ObjectProperty<java.util.function.Consumer<javafx.geometry.Point2D>> |
onSelectionDrag |
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> |
onSelectionDropped |
|
javafx.beans.property.ObjectProperty<java.util.function.IntFunction<? extends javafx.scene.Node>> |
paragraphGraphicFactory |
|
javafx.beans.property.ObjectProperty<javafx.scene.Node> |
placeholder |
|
javafx.beans.value.ObservableValue<java.lang.String> |
text |
|
org.reactfx.value.Val<java.lang.Double> |
totalHeightEstimate |
The estimated height of the entire document.
|
org.reactfx.value.Val<java.lang.Double> |
totalWidthEstimate |
The estimated width of the entire document.
|
javafx.beans.property.BooleanProperty |
useInitialStyleForInsertion |
|
javafx.beans.property.BooleanProperty |
wrapText |
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
anchor, caretBounds, caretColumn, caretPosition, currentParagraph, selectedText, selectionBounds, selection, showCaret
redoAvailable, undoAvailable
NavigationActions.SelectionPolicy
TwoDimensional.Bias, TwoDimensional.Position
Modifier and Type | Field | Description |
---|---|---|
static javafx.scene.control.IndexRange |
EMPTY_RANGE |
Index range [0, 0).
|
Constructor | Description |
---|---|
GenericStyledArea(PS initialParagraphStyle,
java.util.function.BiConsumer<javafx.scene.text.TextFlow,PS> applyParagraphStyle,
S initialTextStyle,
EditableStyledDocument<PS,SEG,S> document,
TextOps<SEG,S> segmentOps,
boolean preserveStyle,
java.util.function.Function<StyledSegment<SEG,S>,javafx.scene.Node> nodeFactory) |
Creates an area with flexibility in all of its options.
|
GenericStyledArea(PS initialParagraphStyle,
java.util.function.BiConsumer<javafx.scene.text.TextFlow,PS> applyParagraphStyle,
S initialTextStyle,
EditableStyledDocument<PS,SEG,S> document,
TextOps<SEG,S> segmentOps,
java.util.function.Function<StyledSegment<SEG,S>,javafx.scene.Node> nodeFactory) |
The same as
GenericStyledArea(Object, BiConsumer, Object, TextOps, Function) except that
this constructor can be used to create another GenericStyledArea that renders and edits the same
EditableStyledDocument or when one wants to use a custom EditableStyledDocument implementation. |
GenericStyledArea(PS initialParagraphStyle,
java.util.function.BiConsumer<javafx.scene.text.TextFlow,PS> applyParagraphStyle,
S initialTextStyle,
TextOps<SEG,S> segmentOps,
boolean preserveStyle,
java.util.function.Function<StyledSegment<SEG,S>,javafx.scene.Node> nodeFactory) |
Same as
GenericStyledArea(Object, BiConsumer, Object, TextOps, Function) but also allows one
to specify whether the undo manager should be a plain or rich undo manager via preserveStyle . |
GenericStyledArea(PS initialParagraphStyle,
java.util.function.BiConsumer<javafx.scene.text.TextFlow,PS> applyParagraphStyle,
S initialTextStyle,
TextOps<SEG,S> segmentOps,
java.util.function.Function<StyledSegment<SEG,S>,javafx.scene.Node> nodeFactory) |
Creates a text area with empty text content.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
addCaret(CaretNode caret) |
|
boolean |
addSelection(Selection<PS,SEG,S> selection) |
|
java.util.Optional<java.lang.Integer> |
allParToVisibleParIndex(int allParIndex) |
Maps a paragraph index from
TextEditingArea.getParagraphs() into the index system of
ViewActions.getVisibleParagraphs() . |
javafx.beans.property.BooleanProperty |
autoScrollOnDragDesiredProperty() |
|
org.reactfx.SuspendableNo |
beingUpdatedProperty() |
True when an update to the area's
underling editable document is still occurring
or the viewport is being updated. |
protected void |
configurePlaceholder(javafx.scene.Node placeholder) |
|
javafx.beans.property.ObjectProperty<javafx.scene.control.ContextMenu> |
contextMenuObjectProperty() |
|
javafx.beans.property.DoubleProperty |
contextMenuXOffsetProperty() |
|
javafx.beans.property.DoubleProperty |
contextMenuYOffsetProperty() |
|
MultiChangeBuilder<PS,SEG,S> |
createMultiChange() |
Starts building a list of changes to be used to update multiple portions of the underlying document
in one call.
|
MultiChangeBuilder<PS,SEG,S> |
createMultiChange(int initialNumOfChanges) |
Same as
TextEditingArea.createMultiChange() but the number of changes are specified to be more memory efficient. |
void |
displaceCaret(int pos) |
|
void |
dispose() |
Disposes this area, preventing memory leaks.
|
javafx.beans.property.BooleanProperty |
editableProperty() |
|
org.reactfx.value.Var<java.lang.Double> |
estimatedScrollXProperty() |
The estimated scrollX value.
|
org.reactfx.value.Var<java.lang.Double> |
estimatedScrollYProperty() |
The estimated scrollY value.
|
int |
getAbsolutePosition(int paragraphIndex,
int columnIndex) |
Returns the absolute position (i.e.
|
java.util.function.BiConsumer<javafx.scene.text.TextFlow,PS> |
getApplyParagraphStyle() |
Gets the style applicator.
|
<T extends javafx.scene.Node & Caret> |
getCaretBoundsOnScreen(T caret) |
Using the paragraph index of the "all paragraph" index system, returns the bounds of a caret on the
given paragraph or
Optional.empty() if no caret is on that paragraph or the pragraph is not visible. |
CaretSelectionBind<PS,SEG,S> |
getCaretSelectionBind() |
Gets the area's main
CaretSelectionBind . |
java.util.Optional<javafx.geometry.Bounds> |
getCharacterBoundsOnScreen(int from,
int to) |
Gets the character bounds on screen
|
static java.util.List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> |
getClassCssMetaData() |
|
EditableStyledDocument<PS,SEG,S> |
getContent() |
The underlying document of this area that can be displayed by multiple
StyledTextArea s. |
javafx.scene.control.ContextMenu |
getContextMenu() |
Gets the
ContextMenu for the area, which is by default null. |
double |
getContextMenuXOffset() |
Gets the value of the property contextMenuXOffset.
|
double |
getContextMenuYOffset() |
Gets the value of the property contextMenuYOffset.
|
java.util.List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> |
getCssMetaData() |
|
int |
getCurrentLineEndInParargraph() |
|
int |
getCurrentLineStartInParargraph() |
|
StyledDocument<PS,SEG,S> |
getDocument() |
Rich-text content of this text-editing area.
|
PS |
getInitialParagraphStyle() |
Style used by default when no other style is provided.
|
S |
getInitialTextStyle() |
Style used by default when no other style is provided.
|
java.util.Locale |
getLocale() |
This is used to determine word and sentence breaks while navigating or selecting.
|
javafx.event.EventHandler<javafx.scene.input.MouseEvent> |
getOnInsideSelectionMousePressReleased() |
Gets the value of the property onInsideSelectionMousePressReleased.
|
javafx.event.EventHandler<javafx.scene.input.MouseEvent> |
getOnNewSelectionDragFinished() |
Gets the value of the property onNewSelectionDragFinished.
|
javafx.event.EventHandler<javafx.scene.input.MouseEvent> |
getOnOutsideSelectionMousePressed() |
Gets the value of the property onOutsideSelectionMousePressed.
|
javafx.event.EventHandler<javafx.scene.input.MouseEvent> |
getOnSelectionDropped() |
Gets the value of the property onSelectionDropped.
|
java.util.Optional<javafx.geometry.Bounds> |
getParagraphBoundsOnScreen(int paragraphIndex) |
Returns the bounds of the paragraph if it is visible or
Optional.empty() if it's not. |
javafx.scene.Node |
getParagraphGraphic(int parNdx) |
|
PS |
getParagraphInsertionStyle() |
|
int |
getParagraphLinesCount(int paragraphIndex) |
Gets the number of lines a paragraph spans when
ViewActions.isWrapText() is true, or otherwise returns 1. |
org.reactfx.collection.LiveList<Paragraph<PS,SEG,S>> |
getParagraphs() |
Unmodifiable observable list of paragraphs in this text area.
|
javafx.scene.control.IndexRange |
getParagraphSelection(Selection selection,
int paragraph) |
|
PS |
getParagraphStyleForInsertionAt(int pos) |
Returns
StyleActions.getInitialParagraphStyle() if StyleActions.getUseInitialStyleForInsertion() is true;
otherwise, returns the paragraph style at the given position. |
javafx.scene.Node |
getPlaceholder() |
Gets the value of the property placeholder.
|
TextOps<SEG,S> |
getSegOps() |
Returns the object used for operating over
segments and their styles |
S |
getStyleAtPosition(int position) |
Returns the style at the given position.
|
S |
getStyleAtPosition(int paragraph,
int position) |
Returns the style at the given position in the given paragraph.
|
java.util.Optional<org.reactfx.util.Tuple2<Codec<PS>,Codec<StyledSegment<SEG,S>>>> |
getStyleCodecs() |
Gets codecs to encode/decode style information to/from binary format.
|
S |
getStyleOfChar(int index) |
Returns the style of the character with the given index.
|
S |
getStyleOfChar(int paragraph,
int index) |
Returns the style of the character with the given index in the given
paragraph.
|
javafx.scene.control.IndexRange |
getStyleRangeAtPosition(int position) |
Returns the range of homogeneous style that includes the given position.
|
javafx.scene.control.IndexRange |
getStyleRangeAtPosition(int paragraph,
int position) |
Returns the range of homogeneous style that includes the given position
in the given paragraph.
|
StyleSpans<S> |
getStyleSpans(int paragraph) |
Returns styles of the whole paragraph.
|
StyleSpans<S> |
getStyleSpans(int from,
int to) |
Returns the styles in the given character range.
|
StyleSpans<S> |
getStyleSpans(int paragraph,
int from,
int to) |
Returns the styles in the given character range of the given paragraph.
|
java.lang.String |
getText(int paragraph) |
Returns text content of the given paragraph.
|
java.lang.String |
getText(int start,
int end) |
Returns text content of the given character range.
|
java.lang.String |
getText(javafx.scene.control.IndexRange range) |
Returns text content of the given character range.
|
S |
getTextInsertionStyle() |
|
S |
getTextStyleForInsertionAt(int pos) |
Returns
StyleActions.getInitialTextStyle() if StyleActions.getUseInitialStyleForInsertion() is true;
otherwise, returns the style at the given position. |
org.fxmisc.undo.UndoManager |
getUndoManager() |
Undo manager of this text area.
|
double |
getViewportHeight() |
Gets the height of the viewport and ignores the padding values added to the area.
|
javafx.geometry.Bounds |
getVisibleParagraphBoundsOnScreen(int visibleParagraphIndex) |
Returns the bounds of the paragraph if it is visible or
Optional.empty() if it's not. |
org.reactfx.collection.LiveList<Paragraph<PS,SEG,S>> |
getVisibleParagraphs() |
Gets the visible paragraphs, even the ones that are barely displayed.
|
CharacterHit |
hit(double x,
double y) |
Helpful for determining which letter is at point x, y:
|
boolean |
isAutoScrollOnDragDesired() |
Gets the value of the property autoScrollOnDragDesired.
|
protected boolean |
isContextMenuPresent() |
|
boolean |
isEditable() |
Gets the value of the property editable.
|
boolean |
isLineHighlighterOn() |
|
boolean |
isPreserveStyle() |
Indicates whether style should be preserved on undo/redo (and in the future copy/paste and text move).
|
boolean |
isWrapText() |
Gets the value of the property wrapText.
|
protected void |
layoutChildren() |
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
lengthProperty() |
|
void |
lineEnd(NavigationActions.SelectionPolicy policy) |
Move the caret to the end of either the line in a multi-line wrapped paragraph or the paragraph
in a single-line / non-wrapped paragraph
|
int |
lineIndex(int paragraphIndex,
int columnPosition) |
Returns 0 if the given paragraph displays its content across only one line, or returns the index
of the line on which the given column position appears if the paragraph spans multiple lines.
|
void |
lineStart(NavigationActions.SelectionPolicy policy) |
Move the caret to the start of either the line in a multi-line wrapped paragraph or the paragraph
in a single-line / non-wrapped paragraph
|
javafx.beans.property.ObjectProperty<java.time.Duration> |
mouseOverTextDelayProperty() |
|
org.reactfx.EventStream<java.util.List<PlainTextChange>> |
multiPlainChanges() |
|
org.reactfx.EventStream<java.util.List<RichTextChange<PS,SEG,S>>> |
multiRichChanges() |
|
void |
nextPage(NavigationActions.SelectionPolicy selectionPolicy) |
Moves caret to the next page (i.e.
|
TwoDimensional.Position |
offsetToPosition(int charOffset,
TwoDimensional.Bias bias) |
Creates a two dimensional position in some entity (e.g.
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> |
onInsideSelectionMousePressReleasedProperty() |
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> |
onNewSelectionDragFinishedProperty() |
|
javafx.beans.property.ObjectProperty<java.util.function.Consumer<javafx.geometry.Point2D>> |
onNewSelectionDragProperty() |
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> |
onOutsideSelectionMousePressedProperty() |
|
javafx.beans.property.ObjectProperty<java.util.function.Consumer<javafx.geometry.Point2D>> |
onSelectionDragProperty() |
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> |
onSelectionDroppedProperty() |
|
javafx.beans.property.ObjectProperty<java.util.function.IntFunction<? extends javafx.scene.Node>> |
paragraphGraphicFactoryProperty() |
|
javafx.beans.property.ObjectProperty<javafx.scene.Node> |
placeholderProperty() |
|
org.reactfx.EventStream<PlainTextChange> |
plainTextChanges() |
|
TwoDimensional.Position |
position(int row,
int col) |
Creates a two dimensional position in some entity (e.g.
|
void |
prevPage(NavigationActions.SelectionPolicy selectionPolicy) |
Moves caret to the previous page (i.e.
|
void |
recreateParagraphGraphic(int parNdx) |
|
boolean |
removeCaret(CaretNode caret) |
|
boolean |
removeSelection(Selection<PS,SEG,S> selection) |
|
void |
replace(int start,
int end,
StyledDocument<PS,SEG,S> replacement) |
Replaces a range of characters with the given rich-text document.
|
void |
replace(int start,
int end,
SEG seg,
S style) |
Replaces a range of characters with the given segment.
|
void |
replaceText(int start,
int end,
java.lang.String text) |
Replaces a range of characters with the given text.
|
void |
requestFollowCaret() |
If the caret is not visible within the area's view, the area will scroll so that caret
is visible in the next layout pass.
|
org.reactfx.EventStream<RichTextChange<PS,SEG,S>> |
richChanges() |
|
void |
scrollBy(javafx.geometry.Point2D deltas) |
|
void |
scrollXBy(double deltaX) |
|
void |
scrollXToPixel(double pixel) |
|
void |
scrollYBy(double deltaY) |
|
void |
scrollYToPixel(double pixel) |
|
void |
setAutoScrollOnDragDesired(boolean val) |
Sets the value of the property autoScrollOnDragDesired.
|
void |
setContextMenu(javafx.scene.control.ContextMenu menu) |
|
void |
setContextMenuXOffset(double offset) |
Sets the value of the property contextMenuXOffset.
|
void |
setContextMenuYOffset(double offset) |
Sets the value of the property contextMenuYOffset.
|
void |
setEditable(boolean value) |
Sets the value of the property editable.
|
void |
setLineHighlighterFill(javafx.scene.paint.Paint highlight) |
The default fill is "highlighter" yellow.
|
void |
setLineHighlighterOn(boolean show) |
Highlights the line that the main caret is on.
Line highlighting automatically follows the caret. |
void |
setLocale(java.util.Locale editorLocale) |
|
void |
setOnInsideSelectionMousePressReleased(javafx.event.EventHandler<javafx.scene.input.MouseEvent> handler) |
Sets the value of the property onInsideSelectionMousePressReleased.
|
void |
setOnNewSelectionDragFinished(javafx.event.EventHandler<javafx.scene.input.MouseEvent> handler) |
Sets the value of the property onNewSelectionDragFinished.
|
void |
setOnOutsideSelectionMousePressed(javafx.event.EventHandler<javafx.scene.input.MouseEvent> handler) |
Sets the value of the property onOutsideSelectionMousePressed.
|
void |
setOnSelectionDropped(javafx.event.EventHandler<javafx.scene.input.MouseEvent> handler) |
Sets the value of the property onSelectionDropped.
|
void |
setParagraphInsertionStyle(PS paraStyle) |
If you want to preset the style to be used.
|
void |
setParagraphStyle(int paragraph,
PS paragraphStyle) |
Sets style for the whole paragraph.
|
void |
setPlaceholder(javafx.scene.Node value) |
Sets the value of the property placeholder.
|
void |
setStyle(int paragraph,
int from,
int to,
S style) |
Sets style for the given range relative in the given paragraph.
|
void |
setStyle(int from,
int to,
S style) |
Sets style for the given character range.
|
void |
setStyle(int paragraph,
S style) |
Sets style for the whole paragraph.
|
void |
setStyleCodecs(Codec<PS> paragraphStyleCodec,
Codec<StyledSegment<SEG,S>> styledSegCodec) |
|
void |
setStyleSpans(int paragraph,
int from,
StyleSpans<? extends S> styleSpans) |
Set multiple style ranges of a paragraph at once.
|
void |
setStyleSpans(int from,
StyleSpans<? extends S> styleSpans) |
Set multiple style ranges at once.
|
void |
setTextInsertionStyle(S txtStyle) |
If you want to preset the style to be used for inserted text.
|
void |
setUndoManager(org.fxmisc.undo.UndoManager undoManager) |
Closes the current area's undo manager before setting it to the given one.
|
void |
setWrapText(boolean value) |
Sets the value of the property wrapText.
|
void |
showParagraphAtBottom(int paragraphIndex) |
Lays out the viewport so that the paragraph is the last line (bottom) displayed in the viewport.
|
void |
showParagraphAtTop(int paragraphIndex) |
Lays out the viewport so that the paragraph is the first line (top) displayed in the viewport.
|
void |
showParagraphInViewport(int paragraphIndex) |
Shows the paragraph somewhere in the viewport.
|
void |
showParagraphRegion(int paragraphIndex,
javafx.geometry.Bounds region) |
Lays out the viewport so that the given bounds (according to the paragraph's coordinate system) within
the given paragraph is visible in the viewport.
|
StyledDocument<PS,SEG,S> |
subDocument(int paragraphIndex) |
Returns rich-text content of the given paragraph.
|
StyledDocument<PS,SEG,S> |
subDocument(int start,
int end) |
Returns rich-text content of the given character range.
|
javafx.beans.value.ObservableValue<java.lang.String> |
textProperty() |
|
org.reactfx.value.Val<java.lang.Double> |
totalHeightEstimateProperty() |
The estimated height of the entire document.
|
org.reactfx.value.Val<java.lang.Double> |
totalWidthEstimateProperty() |
The estimated width of the entire document.
|
javafx.beans.property.BooleanProperty |
useInitialStyleForInsertionProperty() |
|
org.reactfx.EventStream<?> |
viewportDirtyEvents() |
Returns an
EventStream that emits a null value every time the viewport becomes dirty (e.g. |
int |
visibleParToAllParIndex(int visibleParIndex) |
Maps a paragraph index from
ViewActions.getVisibleParagraphs() into the index system of
TextEditingArea.getParagraphs() . |
javafx.beans.property.BooleanProperty |
wrapTextProperty() |
copy, cut, paste
append, append, appendText, clear, deleteNextChar, deletePreviousChar, deleteText, deleteText, deleteText, insert, insert, insert, insertText, insertText, moveSelectedText, replace, replaceSelection, replaceSelection, replaceText
deselect, end, moveTo, moveTo, moveTo, moveTo, nextChar, paragraphEnd, paragraphStart, previousChar, selectAll, selectParagraph, selectWord, start, wordBreaksBackwards, wordBreaksForwards
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
clearParagraphStyle, clearStyle, clearStyle, clearStyle, getStyleSpans, getStyleSpans, getUseInitialStyleForInsertion, setUseInitialStyleForInsertion
anchorProperty, caretBoundsProperty, caretColumnProperty, caretPositionProperty, currentParagraphProperty, getAnchor, getCaretBounds, getCaretColumn, getCaretPosition, getCurrentParagraph, getLength, getParagraph, getParagraphLength, getParagraphSelection, getSelectedText, getSelection, getSelectionBounds, getShowCaret, getText, getText, isBeingUpdated, replace, replace, replace, replace, replaceText, replaceText, selectedTextProperty, selectionBoundsProperty, selectionProperty, selectRange, selectRange, setShowCaret, showCaretProperty, subDocument, subDocument
isRedoAvailable, isUndoAvailable, redo, redoAvailableProperty, undo, undoAvailableProperty
firstVisibleParToAllParIndex, getMouseOverTextDelay, getOnNewSelectionDrag, getOnSelectionDrag, getParagraphGraphicFactory, hideContextMenu, lastVisibleParToAllParIndex, selectLine, setMouseOverTextDelay, setOnNewSelectionDrag, setOnSelectionDrag, setParagraphGraphicFactory
public final javafx.beans.property.BooleanProperty editableProperty
editableProperty
in interface ViewActions<PS,SEG,S>
isEditable()
,
setEditable(boolean)
public final javafx.beans.property.BooleanProperty wrapTextProperty
wrapTextProperty
in interface ViewActions<PS,SEG,S>
isWrapText()
,
setWrapText(boolean)
public javafx.beans.property.ObjectProperty<java.time.Duration> mouseOverTextDelayProperty
mouseOverTextDelayProperty
in interface ViewActions<PS,SEG,S>
public javafx.beans.property.ObjectProperty<java.util.function.IntFunction<? extends javafx.scene.Node>> paragraphGraphicFactoryProperty
paragraphGraphicFactoryProperty
in interface ViewActions<PS,SEG,S>
public final javafx.beans.property.ObjectProperty<javafx.scene.Node> placeholderProperty
getPlaceholder()
,
setPlaceholder(Node)
public final javafx.beans.property.ObjectProperty<javafx.scene.control.ContextMenu> contextMenuObjectProperty
contextMenuObjectProperty
in interface ViewActions<PS,SEG,S>
public final javafx.beans.property.DoubleProperty contextMenuXOffsetProperty
contextMenuXOffsetProperty
in interface ViewActions<PS,SEG,S>
getContextMenuXOffset()
,
setContextMenuXOffset(double)
public final javafx.beans.property.DoubleProperty contextMenuYOffsetProperty
contextMenuYOffsetProperty
in interface ViewActions<PS,SEG,S>
getContextMenuYOffset()
,
setContextMenuYOffset(double)
public javafx.beans.property.BooleanProperty useInitialStyleForInsertionProperty
useInitialStyleForInsertionProperty
in interface StyleActions<PS,SEG>
public org.reactfx.value.Var<java.lang.Double> estimatedScrollXProperty
estimatedScrollXProperty
in interface ViewActions<PS,SEG,S>
estimatedScrollXProperty
in interface org.fxmisc.flowless.Virtualized
public org.reactfx.value.Var<java.lang.Double> estimatedScrollYProperty
estimatedScrollYProperty
in interface ViewActions<PS,SEG,S>
estimatedScrollYProperty
in interface org.fxmisc.flowless.Virtualized
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> onOutsideSelectionMousePressedProperty
onOutsideSelectionMousePressedProperty
in interface ViewActions<PS,SEG,S>
getOnOutsideSelectionMousePressed()
,
setOnOutsideSelectionMousePressed(EventHandler)
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> onInsideSelectionMousePressReleasedProperty
onInsideSelectionMousePressReleasedProperty
in interface ViewActions<PS,SEG,S>
getOnInsideSelectionMousePressReleased()
,
setOnInsideSelectionMousePressReleased(EventHandler)
public final javafx.beans.property.ObjectProperty<java.util.function.Consumer<javafx.geometry.Point2D>> onNewSelectionDragProperty
onNewSelectionDragProperty
in interface ViewActions<PS,SEG,S>
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> onNewSelectionDragFinishedProperty
onNewSelectionDragFinishedProperty
in interface ViewActions<PS,SEG,S>
getOnNewSelectionDragFinished()
,
setOnNewSelectionDragFinished(EventHandler)
public final javafx.beans.property.ObjectProperty<java.util.function.Consumer<javafx.geometry.Point2D>> onSelectionDragProperty
onSelectionDragProperty
in interface ViewActions<PS,SEG,S>
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> onSelectionDroppedProperty
onSelectionDroppedProperty
in interface ViewActions<PS,SEG,S>
getOnSelectionDropped()
,
setOnSelectionDropped(EventHandler)
public final javafx.beans.property.BooleanProperty autoScrollOnDragDesiredProperty
autoScrollOnDragDesiredProperty
in interface ViewActions<PS,SEG,S>
isAutoScrollOnDragDesired()
,
setAutoScrollOnDragDesired(boolean)
public final javafx.beans.value.ObservableValue<java.lang.String> textProperty
textProperty
in interface TextEditingArea<PS,SEG,S>
public final javafx.beans.value.ObservableValue<java.lang.Integer> lengthProperty
lengthProperty
in interface TextEditingArea<PS,SEG,S>
public final org.reactfx.SuspendableNo beingUpdatedProperty
beingUpdatedProperty
in interface TextEditingArea<PS,SEG,S>
public org.reactfx.value.Val<java.lang.Double> totalWidthEstimateProperty
totalWidthEstimateProperty
in interface ViewActions<PS,SEG,S>
totalWidthEstimateProperty
in interface org.fxmisc.flowless.Virtualized
public org.reactfx.value.Val<java.lang.Double> totalHeightEstimateProperty
totalHeightEstimateProperty
in interface ViewActions<PS,SEG,S>
totalHeightEstimateProperty
in interface org.fxmisc.flowless.Virtualized
public static final javafx.scene.control.IndexRange EMPTY_RANGE
public GenericStyledArea(PS initialParagraphStyle, java.util.function.BiConsumer<javafx.scene.text.TextFlow,PS> applyParagraphStyle, S initialTextStyle, TextOps<SEG,S> segmentOps, java.util.function.Function<StyledSegment<SEG,S>,javafx.scene.Node> nodeFactory)
initialParagraphStyle
- style to use in places where no other style is
specified (yet).applyParagraphStyle
- function that, given a TextFlow
node and
a style, applies the style to the paragraph node. This function is
used by the default skin to apply style to paragraph nodes.initialTextStyle
- style to use in places where no other style is
specified (yet).segmentOps
- The operations which are defined on the text segment objects.nodeFactory
- A function which is used to create the JavaFX scene nodes for a
particular segment.public GenericStyledArea(PS initialParagraphStyle, java.util.function.BiConsumer<javafx.scene.text.TextFlow,PS> applyParagraphStyle, S initialTextStyle, TextOps<SEG,S> segmentOps, boolean preserveStyle, java.util.function.Function<StyledSegment<SEG,S>,javafx.scene.Node> nodeFactory)
GenericStyledArea(Object, BiConsumer, Object, TextOps, Function)
but also allows one
to specify whether the undo manager should be a plain or rich undo manager via preserveStyle
.initialParagraphStyle
- style to use in places where no other style is specified (yet).applyParagraphStyle
- function that, given a TextFlow
node and
a style, applies the style to the paragraph node. This function is
used by the default skin to apply style to paragraph nodes.initialTextStyle
- style to use in places where no other style is specified (yet).segmentOps
- The operations which are defined on the text segment objects.preserveStyle
- whether to use an undo manager that can undo/redo RichTextChange
s or
PlainTextChange
snodeFactory
- A function which is used to create the JavaFX scene node for a particular segment.public GenericStyledArea(PS initialParagraphStyle, java.util.function.BiConsumer<javafx.scene.text.TextFlow,PS> applyParagraphStyle, S initialTextStyle, EditableStyledDocument<PS,SEG,S> document, TextOps<SEG,S> segmentOps, java.util.function.Function<StyledSegment<SEG,S>,javafx.scene.Node> nodeFactory)
GenericStyledArea(Object, BiConsumer, Object, TextOps, Function)
except that
this constructor can be used to create another GenericStyledArea
that renders and edits the same
EditableStyledDocument
or when one wants to use a custom EditableStyledDocument
implementation.public GenericStyledArea(PS initialParagraphStyle, java.util.function.BiConsumer<javafx.scene.text.TextFlow,PS> applyParagraphStyle, S initialTextStyle, EditableStyledDocument<PS,SEG,S> document, TextOps<SEG,S> segmentOps, boolean preserveStyle, java.util.function.Function<StyledSegment<SEG,S>,javafx.scene.Node> nodeFactory)
initialParagraphStyle
- style to use in places where no other style is specified (yet).applyParagraphStyle
- function that, given a TextFlow
node and
a style, applies the style to the paragraph node. This function is
used by the default skin to apply style to paragraph nodes.initialTextStyle
- style to use in places where no other style is specified (yet).document
- the document to render and editsegmentOps
- The operations which are defined on the text segment objects.preserveStyle
- whether to use an undo manager that can undo/redo RichTextChange
s or
PlainTextChange
snodeFactory
- A function which is used to create the JavaFX scene node for a particular segment.public final javafx.beans.property.BooleanProperty editableProperty()
editableProperty
in interface ViewActions<PS,SEG,S>
isEditable()
,
setEditable(boolean)
public void setEditable(boolean value)
setEditable
in interface ViewActions<PS,SEG,S>
public boolean isEditable()
isEditable
in interface ViewActions<PS,SEG,S>
public final javafx.beans.property.BooleanProperty wrapTextProperty()
wrapTextProperty
in interface ViewActions<PS,SEG,S>
isWrapText()
,
setWrapText(boolean)
public void setWrapText(boolean value)
setWrapText
in interface ViewActions<PS,SEG,S>
public boolean isWrapText()
isWrapText
in interface ViewActions<PS,SEG,S>
public org.fxmisc.undo.UndoManager getUndoManager()
UndoActions
getUndoManager
in interface UndoActions
public void setUndoManager(org.fxmisc.undo.UndoManager undoManager)
UndoActions
UndoManager
, see the convenient factory methods in UndoUtils
.setUndoManager
in interface UndoActions
undoManager
- may be null in which case a no op undo manager will be set.public java.util.Locale getLocale()
getLocale
in interface TextEditingArea<PS,SEG,S>
public void setLocale(java.util.Locale editorLocale)
public javafx.beans.property.ObjectProperty<java.time.Duration> mouseOverTextDelayProperty()
mouseOverTextDelayProperty
in interface ViewActions<PS,SEG,S>
public javafx.beans.property.ObjectProperty<java.util.function.IntFunction<? extends javafx.scene.Node>> paragraphGraphicFactoryProperty()
paragraphGraphicFactoryProperty
in interface ViewActions<PS,SEG,S>
public void recreateParagraphGraphic(int parNdx)
public javafx.scene.Node getParagraphGraphic(int parNdx)
public final javafx.beans.property.ObjectProperty<javafx.scene.Node> placeholderProperty()
getPlaceholder()
,
setPlaceholder(Node)
public final void setPlaceholder(javafx.scene.Node value)
public final javafx.scene.Node getPlaceholder()
public final javafx.beans.property.ObjectProperty<javafx.scene.control.ContextMenu> contextMenuObjectProperty()
contextMenuObjectProperty
in interface ViewActions<PS,SEG,S>
public void setContextMenu(javafx.scene.control.ContextMenu menu)
setContextMenu
in interface ViewActions<PS,SEG,S>
public javafx.scene.control.ContextMenu getContextMenu()
ViewActions
ContextMenu
for the area, which is by default null.getContextMenu
in interface ViewActions<PS,SEG,S>
protected final boolean isContextMenuPresent()
public final javafx.beans.property.DoubleProperty contextMenuXOffsetProperty()
contextMenuXOffsetProperty
in interface ViewActions<PS,SEG,S>
getContextMenuXOffset()
,
setContextMenuXOffset(double)
public void setContextMenuXOffset(double offset)
setContextMenuXOffset
in interface ViewActions<PS,SEG,S>
public double getContextMenuXOffset()
getContextMenuXOffset
in interface ViewActions<PS,SEG,S>
public final javafx.beans.property.DoubleProperty contextMenuYOffsetProperty()
contextMenuYOffsetProperty
in interface ViewActions<PS,SEG,S>
getContextMenuYOffset()
,
setContextMenuYOffset(double)
public void setContextMenuYOffset(double offset)
setContextMenuYOffset
in interface ViewActions<PS,SEG,S>
public double getContextMenuYOffset()
getContextMenuYOffset
in interface ViewActions<PS,SEG,S>
public javafx.beans.property.BooleanProperty useInitialStyleForInsertionProperty()
useInitialStyleForInsertionProperty
in interface StyleActions<PS,SEG>
public void setStyleCodecs(Codec<PS> paragraphStyleCodec, Codec<StyledSegment<SEG,S>> styledSegCodec)
setStyleCodecs
in interface ClipboardActions<PS,SEG,S>
public java.util.Optional<org.reactfx.util.Tuple2<Codec<PS>,Codec<StyledSegment<SEG,S>>>> getStyleCodecs()
ClipboardActions
getStyleCodecs
in interface ClipboardActions<PS,SEG,S>
public org.reactfx.value.Var<java.lang.Double> estimatedScrollXProperty()
ViewActions
estimatedScrollXProperty
in interface ViewActions<PS,SEG,S>
estimatedScrollXProperty
in interface org.fxmisc.flowless.Virtualized
public org.reactfx.value.Var<java.lang.Double> estimatedScrollYProperty()
ViewActions
estimatedScrollYProperty
in interface ViewActions<PS,SEG,S>
estimatedScrollYProperty
in interface org.fxmisc.flowless.Virtualized
public final boolean addCaret(CaretNode caret)
public final boolean removeCaret(CaretNode caret)
public final javafx.event.EventHandler<javafx.scene.input.MouseEvent> getOnOutsideSelectionMousePressed()
getOnOutsideSelectionMousePressed
in interface ViewActions<PS,SEG,S>
public final void setOnOutsideSelectionMousePressed(javafx.event.EventHandler<javafx.scene.input.MouseEvent> handler)
setOnOutsideSelectionMousePressed
in interface ViewActions<PS,SEG,S>
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> onOutsideSelectionMousePressedProperty()
onOutsideSelectionMousePressedProperty
in interface ViewActions<PS,SEG,S>
getOnOutsideSelectionMousePressed()
,
setOnOutsideSelectionMousePressed(EventHandler)
public final javafx.event.EventHandler<javafx.scene.input.MouseEvent> getOnInsideSelectionMousePressReleased()
getOnInsideSelectionMousePressReleased
in interface ViewActions<PS,SEG,S>
public final void setOnInsideSelectionMousePressReleased(javafx.event.EventHandler<javafx.scene.input.MouseEvent> handler)
setOnInsideSelectionMousePressReleased
in interface ViewActions<PS,SEG,S>
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> onInsideSelectionMousePressReleasedProperty()
onInsideSelectionMousePressReleasedProperty
in interface ViewActions<PS,SEG,S>
getOnInsideSelectionMousePressReleased()
,
setOnInsideSelectionMousePressReleased(EventHandler)
public final javafx.beans.property.ObjectProperty<java.util.function.Consumer<javafx.geometry.Point2D>> onNewSelectionDragProperty()
onNewSelectionDragProperty
in interface ViewActions<PS,SEG,S>
public final javafx.event.EventHandler<javafx.scene.input.MouseEvent> getOnNewSelectionDragFinished()
getOnNewSelectionDragFinished
in interface ViewActions<PS,SEG,S>
public final void setOnNewSelectionDragFinished(javafx.event.EventHandler<javafx.scene.input.MouseEvent> handler)
setOnNewSelectionDragFinished
in interface ViewActions<PS,SEG,S>
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> onNewSelectionDragFinishedProperty()
onNewSelectionDragFinishedProperty
in interface ViewActions<PS,SEG,S>
getOnNewSelectionDragFinished()
,
setOnNewSelectionDragFinished(EventHandler)
public final javafx.beans.property.ObjectProperty<java.util.function.Consumer<javafx.geometry.Point2D>> onSelectionDragProperty()
onSelectionDragProperty
in interface ViewActions<PS,SEG,S>
public final javafx.event.EventHandler<javafx.scene.input.MouseEvent> getOnSelectionDropped()
getOnSelectionDropped
in interface ViewActions<PS,SEG,S>
public final void setOnSelectionDropped(javafx.event.EventHandler<javafx.scene.input.MouseEvent> handler)
setOnSelectionDropped
in interface ViewActions<PS,SEG,S>
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.scene.input.MouseEvent>> onSelectionDroppedProperty()
onSelectionDroppedProperty
in interface ViewActions<PS,SEG,S>
getOnSelectionDropped()
,
setOnSelectionDropped(EventHandler)
public final javafx.beans.property.BooleanProperty autoScrollOnDragDesiredProperty()
autoScrollOnDragDesiredProperty
in interface ViewActions<PS,SEG,S>
isAutoScrollOnDragDesired()
,
setAutoScrollOnDragDesired(boolean)
public void setAutoScrollOnDragDesired(boolean val)
setAutoScrollOnDragDesired
in interface ViewActions<PS,SEG,S>
public boolean isAutoScrollOnDragDesired()
isAutoScrollOnDragDesired
in interface ViewActions<PS,SEG,S>
public final javafx.beans.value.ObservableValue<java.lang.String> textProperty()
textProperty
in interface TextEditingArea<PS,SEG,S>
public final StyledDocument<PS,SEG,S> getDocument()
TextEditingArea
getDocument
in interface TextEditingArea<PS,SEG,S>
public final CaretSelectionBind<PS,SEG,S> getCaretSelectionBind()
TextEditingArea
CaretSelectionBind
.getCaretSelectionBind
in interface TextEditingArea<PS,SEG,S>
public final javafx.beans.value.ObservableValue<java.lang.Integer> lengthProperty()
lengthProperty
in interface TextEditingArea<PS,SEG,S>
public org.reactfx.collection.LiveList<Paragraph<PS,SEG,S>> getParagraphs()
TextEditingArea
getParagraphs
in interface TextEditingArea<PS,SEG,S>
public final org.reactfx.collection.LiveList<Paragraph<PS,SEG,S>> getVisibleParagraphs()
ViewActions
getVisibleParagraphs
in interface ViewActions<PS,SEG,S>
public final org.reactfx.SuspendableNo beingUpdatedProperty()
TextEditingArea
underling editable document
is still occurring
or the viewport is being updated.beingUpdatedProperty
in interface TextEditingArea<PS,SEG,S>
public org.reactfx.value.Val<java.lang.Double> totalWidthEstimateProperty()
ViewActions
totalWidthEstimateProperty
in interface ViewActions<PS,SEG,S>
totalWidthEstimateProperty
in interface org.fxmisc.flowless.Virtualized
public org.reactfx.value.Val<java.lang.Double> totalHeightEstimateProperty()
ViewActions
totalHeightEstimateProperty
in interface ViewActions<PS,SEG,S>
totalHeightEstimateProperty
in interface org.fxmisc.flowless.Virtualized
public org.reactfx.EventStream<java.util.List<RichTextChange<PS,SEG,S>>> multiRichChanges()
TextEditingArea
multiRichChanges
in interface TextEditingArea<PS,SEG,S>
public org.reactfx.EventStream<java.util.List<PlainTextChange>> multiPlainChanges()
TextEditingArea
multiPlainChanges
in interface TextEditingArea<PS,SEG,S>
public final org.reactfx.EventStream<PlainTextChange> plainTextChanges()
TextEditingArea
plainTextChanges
in interface TextEditingArea<PS,SEG,S>
public final org.reactfx.EventStream<RichTextChange<PS,SEG,S>> richChanges()
TextEditingArea
richChanges
in interface TextEditingArea<PS,SEG,S>
public final org.reactfx.EventStream<?> viewportDirtyEvents()
ViewActions
EventStream
that emits a null
value every time the viewport becomes dirty (e.g.
the viewport's width, height, scaleX, scaleY, estimatedScrollX, or estimatedScrollY values change)viewportDirtyEvents
in interface ViewActions<PS,SEG,S>
public final EditableStyledDocument<PS,SEG,S> getContent()
TextEditingArea
StyledTextArea
s.getContent
in interface TextEditingArea<PS,SEG,S>
public final S getInitialTextStyle()
StyleActions
getInitialTextStyle
in interface StyleActions<PS,SEG>
public final PS getInitialParagraphStyle()
StyleActions
getInitialParagraphStyle
in interface StyleActions<PS,SEG>
public final java.util.function.BiConsumer<javafx.scene.text.TextFlow,PS> getApplyParagraphStyle()
ViewActions
getApplyParagraphStyle
in interface ViewActions<PS,SEG,S>
public final boolean isPreserveStyle()
StyleActions
isPreserveStyle
in interface StyleActions<PS,SEG>
public final TextOps<SEG,S> getSegOps()
TextEditingArea
segments
and their stylesgetSegOps
in interface ClipboardActions<PS,SEG,S>
getSegOps
in interface TextEditingArea<PS,SEG,S>
protected void configurePlaceholder(javafx.scene.Node placeholder)
public final double getViewportHeight()
ViewActions
getViewportHeight
in interface ViewActions<PS,SEG,S>
public final java.util.Optional<java.lang.Integer> allParToVisibleParIndex(int allParIndex)
ViewActions
TextEditingArea.getParagraphs()
into the index system of
ViewActions.getVisibleParagraphs()
.allParToVisibleParIndex
in interface ViewActions<PS,SEG,S>
public final int visibleParToAllParIndex(int visibleParIndex)
ViewActions
ViewActions.getVisibleParagraphs()
into the index system of
TextEditingArea.getParagraphs()
.visibleParToAllParIndex
in interface ViewActions<PS,SEG,S>
public CharacterHit hit(double x, double y)
ViewActions
StyledTextArea area = // creation code
area.addEventHandler(MouseEvent.MOUSE_PRESSED, (MouseEvent e) -> {
CharacterHit hit = area.hit(e.getX(), e.getY());
int characterPosition = hit.getInsertionIndex();
// move the caret to that character's position
area.moveTo(characterPosition, SelectionPolicy.CLEAR);
}
hit
in interface ViewActions<PS,SEG,S>
public final int lineIndex(int paragraphIndex, int columnPosition)
ViewActions
lineIndex
in interface ViewActions<PS,SEG,S>
public int getParagraphLinesCount(int paragraphIndex)
ViewActions
ViewActions.isWrapText()
is true, or otherwise returns 1.
CAUTION: the underlying TextFlow does not immediately account for changes in the stage's width when the
paragraph in question is a multi-line paragraph and text wrap is on
. After calling
Window.setWidth(double)
, it may take anywhere between 150-300 milliseconds for TextFlow
to account for this and return the correct line count for the given paragraph. Otherwise, it may return a
skewed number, such as the total number of characters on the line.getParagraphLinesCount
in interface ViewActions<PS,SEG,S>
public java.util.Optional<javafx.geometry.Bounds> getCharacterBoundsOnScreen(int from, int to)
ViewActions
getCharacterBoundsOnScreen
in interface ViewActions<PS,SEG,S>
from
- the start positionto
- the end positionOptional.empty()
if line is not visible or the range is only a newline character.public final java.lang.String getText(int start, int end)
TextEditingArea
getText
in interface TextEditingArea<PS,SEG,S>
public java.lang.String getText(int paragraph)
TextEditingArea
getText
in interface TextEditingArea<PS,SEG,S>
public java.lang.String getText(javafx.scene.control.IndexRange range)
TextEditingArea
getText
in interface TextEditingArea<PS,SEG,S>
public StyledDocument<PS,SEG,S> subDocument(int start, int end)
TextEditingArea
subDocument
in interface TextEditingArea<PS,SEG,S>
public StyledDocument<PS,SEG,S> subDocument(int paragraphIndex)
TextEditingArea
subDocument
in interface TextEditingArea<PS,SEG,S>
public javafx.scene.control.IndexRange getParagraphSelection(Selection selection, int paragraph)
getParagraphSelection
in interface TextEditingArea<PS,SEG,S>
public S getStyleOfChar(int index)
StyleActions
index
points to a line terminator character,
the last style used in the paragraph terminated by that
line terminator is returned.getStyleOfChar
in interface StyleActions<PS,SEG>
public S getStyleAtPosition(int position)
StyleActions
position
, except when
position
points to a paragraph boundary, in which case it
is the style at the beginning of the latter paragraph.
In other words, most of the time getStyleAtPosition(p)
is equivalent to getStyleOfChar(p-1)
, except when p
points to a paragraph boundary, in which case it is equivalent to
getStyleOfChar(p)
.
getStyleAtPosition
in interface StyleActions<PS,SEG>
public javafx.scene.control.IndexRange getStyleRangeAtPosition(int position)
StyleActions
position
points to a boundary between two styled ranges, then
the range preceding position
is returned. If position
points to a boundary between two paragraphs, then the first styled range
of the latter paragraph is returned.getStyleRangeAtPosition
in interface StyleActions<PS,SEG>
public StyleSpans<S> getStyleSpans(int from, int to)
StyleActions
getStyleSpans
in interface StyleActions<PS,SEG>
public S getStyleOfChar(int paragraph, int index)
StyleActions
index
is beyond the end of the paragraph, the
style at the end of line is returned. If index
is negative, it
is the same as if it was 0.getStyleOfChar
in interface StyleActions<PS,SEG>
public S getStyleAtPosition(int paragraph, int position)
StyleActions
getStyleOfChar(paragraph, position-1)
.getStyleAtPosition
in interface StyleActions<PS,SEG>
public javafx.scene.control.IndexRange getStyleRangeAtPosition(int paragraph, int position)
StyleActions
position
points to a boundary between
two styled ranges, then the range preceding position
is returned.getStyleRangeAtPosition
in interface StyleActions<PS,SEG>
public StyleSpans<S> getStyleSpans(int paragraph)
StyleActions
getStyleSpans
in interface StyleActions<PS,SEG>
public StyleSpans<S> getStyleSpans(int paragraph, int from, int to)
StyleActions
getStyleSpans
in interface StyleActions<PS,SEG>
public int getAbsolutePosition(int paragraphIndex, int columnIndex)
TextEditingArea
For example, given a text with only one line "text"
and the columnIndex value of 1
, "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
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)
getAbsolutePosition
in interface TextEditingArea<PS,SEG,S>
paragraphIndex
- The index of the paragraph from which to start.columnIndex
- 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)public TwoDimensional.Position position(int row, int col)
TwoDimensional
major
value is the index within the outer list) and the minor
value is either the index within the inner list or some amount of length in a list of objects that have length.position
in interface TwoDimensional
public TwoDimensional.Position offsetToPosition(int charOffset, TwoDimensional.Bias bias)
TwoDimensional
offset
value is an absolute position in that entity.offsetToPosition
in interface TwoDimensional
public javafx.geometry.Bounds getVisibleParagraphBoundsOnScreen(int visibleParagraphIndex)
ViewActions
Optional.empty()
if it's not.
The returned bounds object will always be within the bounds of the area. In other words, it takes
scrolling into account. Note: the bound's width will always equal the area's width, not necessarily
the paragraph's real width (if it's short and doesn't take up all of the area's provided horizontal space
or if it's long and spans outside of the area's width).getVisibleParagraphBoundsOnScreen
in interface ViewActions<PS,SEG,S>
visibleParagraphIndex
- the index in area's list of visible paragraphs.public java.util.Optional<javafx.geometry.Bounds> getParagraphBoundsOnScreen(int paragraphIndex)
ViewActions
Optional.empty()
if it's not.
The returned bounds object will always be within the bounds of the area. In other words, it takes
scrolling into account. Note: the bound's width will always equal the area's width, not necessarily
the paragraph's real width (if it's short and doesn't take up all of the area's provided horizontal space
or if it's long and spans outside of the area's width).getParagraphBoundsOnScreen
in interface ViewActions<PS,SEG,S>
paragraphIndex
- the index in area's list of paragraphs (visible and invisible).public final <T extends javafx.scene.Node & Caret> java.util.Optional<javafx.geometry.Bounds> getCaretBoundsOnScreen(T caret)
ViewActions
Optional.empty()
if no caret is on that paragraph or the pragraph is not visible.getCaretBoundsOnScreen
in interface ViewActions<PS,SEG,S>
public void scrollXToPixel(double pixel)
scrollXToPixel
in interface org.fxmisc.flowless.Virtualized
public void scrollYToPixel(double pixel)
scrollYToPixel
in interface org.fxmisc.flowless.Virtualized
public void scrollXBy(double deltaX)
scrollXBy
in interface org.fxmisc.flowless.Virtualized
public void scrollYBy(double deltaY)
scrollYBy
in interface org.fxmisc.flowless.Virtualized
public void scrollBy(javafx.geometry.Point2D deltas)
scrollBy
in interface org.fxmisc.flowless.Virtualized
public void showParagraphInViewport(int paragraphIndex)
ViewActions
showParagraphInViewport
in interface ViewActions<PS,SEG,S>
public void showParagraphAtTop(int paragraphIndex)
ViewActions
showParagraphAtTop(3)
would be no different than showParagraphAtTop(1)
.showParagraphAtTop
in interface ViewActions<PS,SEG,S>
public void showParagraphAtBottom(int paragraphIndex)
ViewActions
showParagraphAtBottom(1)
would be no different than calling
showParagraphAtBottom(7)
.showParagraphAtBottom
in interface ViewActions<PS,SEG,S>
public void showParagraphRegion(int paragraphIndex, javafx.geometry.Bounds region)
ViewActions
showParagraphRegion
in interface ViewActions<PS,SEG,S>
public void requestFollowCaret()
ViewActions
requestFollowCaret
in interface ViewActions<PS,SEG,S>
public void lineStart(NavigationActions.SelectionPolicy policy)
ViewActions
lineStart
in interface ViewActions<PS,SEG,S>
policy
- use NavigationActions.SelectionPolicy.CLEAR
when no selection is desired an
NavigationActions.SelectionPolicy.ADJUST
when a selection from starting point
to the place to where the caret is moved is desired.public void lineEnd(NavigationActions.SelectionPolicy policy)
ViewActions
lineEnd
in interface ViewActions<PS,SEG,S>
policy
- use NavigationActions.SelectionPolicy.CLEAR
when no selection is desired an
NavigationActions.SelectionPolicy.ADJUST
when a selection from starting point
to the place to where the caret is moved is desired.public int getCurrentLineStartInParargraph()
public int getCurrentLineEndInParargraph()
public void setLineHighlighterFill(javafx.scene.paint.Paint highlight)
.styled-text-area .line-highlighter { -fx-fill: lime; }
public boolean isLineHighlighterOn()
public void setLineHighlighterOn(boolean show)
public void prevPage(NavigationActions.SelectionPolicy selectionPolicy)
ViewActions
prevPage
in interface ViewActions<PS,SEG,S>
selectionPolicy
- use NavigationActions.SelectionPolicy.CLEAR
when no selection is desired and
NavigationActions.SelectionPolicy.ADJUST
when a selection from starting point
to the place to where the caret is moved is desired.public void nextPage(NavigationActions.SelectionPolicy selectionPolicy)
ViewActions
nextPage
in interface ViewActions<PS,SEG,S>
selectionPolicy
- use NavigationActions.SelectionPolicy.CLEAR
when no selection is desired and
NavigationActions.SelectionPolicy.ADJUST
when a selection from starting point
to the place to where the caret is moved is desired.public void displaceCaret(int pos)
TextEditingArea
anchor
or the selection
.
Do not confuse this method with NavigationActions.moveTo(int)
, which is the normal way of moving the
caret. This method can be used to achieve the special case of positioning the caret outside or inside the
selection, as opposed to always being at the boundary. Use with care.displaceCaret
in interface TextEditingArea<PS,SEG,S>
public void setStyle(int from, int to, S style)
StyleActions
setStyle
in interface StyleActions<PS,SEG>
public void setStyle(int paragraph, S style)
StyleActions
setStyle
in interface StyleActions<PS,SEG>
public void setStyle(int paragraph, int from, int to, S style)
StyleActions
setStyle
in interface StyleActions<PS,SEG>
public void setStyleSpans(int from, StyleSpans<? extends S> styleSpans)
StyleActions
for(StyleSpan<S>
span: styleSpans) {
setStyle(from, from + span.getLength(), span.getStyle());
from += span.getLength();
}
but the actual implementation in SimpleEditableStyledDocument
is
more efficient.setStyleSpans
in interface StyleActions<PS,SEG>
public void setStyleSpans(int paragraph, int from, StyleSpans<? extends S> styleSpans)
StyleActions
for(StyleSpan<S>
span: styleSpans) {
setStyle(paragraph, from, from + span.getLength(), span.getStyle());
from += span.getLength();
}
but the actual implementation in SimpleEditableStyledDocument
is
more efficient.setStyleSpans
in interface StyleActions<PS,SEG>
public void setParagraphStyle(int paragraph, PS paragraphStyle)
StyleActions
setParagraphStyle
in interface StyleActions<PS,SEG>
public final void setTextInsertionStyle(S txtStyle)
public final S getTextInsertionStyle()
public final S getTextStyleForInsertionAt(int pos)
StyleActions
StyleActions.getInitialTextStyle()
if StyleActions.getUseInitialStyleForInsertion()
is true;
otherwise, returns the style at the given position.getTextStyleForInsertionAt
in interface StyleActions<PS,SEG>
public final void setParagraphInsertionStyle(PS paraStyle)
public final PS getParagraphInsertionStyle()
public final PS getParagraphStyleForInsertionAt(int pos)
StyleActions
StyleActions.getInitialParagraphStyle()
if StyleActions.getUseInitialStyleForInsertion()
is true;
otherwise, returns the paragraph style at the given position.getParagraphStyleForInsertionAt
in interface StyleActions<PS,SEG>
public void replaceText(int start, int end, java.lang.String text)
TextEditingArea
0 <= start <= end <= getLength()
.replaceText
in interface TextEditingArea<PS,SEG,S>
start
- Start index of the range to replace, inclusive.end
- End index of the range to replace, exclusive.text
- The text to put in place of the deleted range.
It must not be null.public void replace(int start, int end, SEG seg, S style)
TextEditingArea
0 <= start <= end <= getLength()
.replace
in interface TextEditingArea<PS,SEG,S>
start
- Start index of the range to replace, inclusive.end
- End index of the range to replace, exclusive.seg
- The seg to put in place of the deleted range.
It must not be null.public void replace(int start, int end, StyledDocument<PS,SEG,S> replacement)
TextEditingArea
replace
in interface TextEditingArea<PS,SEG,S>
public MultiChangeBuilder<PS,SEG,S> createMultiChange()
TextEditingArea
MultiChangeBuilder.commit()
. If the number of
changes are known at compile time, use TextEditingArea.createMultiChange(int)
for better memory efficiency.createMultiChange
in interface TextEditingArea<PS,SEG,S>
public MultiChangeBuilder<PS,SEG,S> createMultiChange(int initialNumOfChanges)
TextEditingArea
TextEditingArea.createMultiChange()
but the number of changes are specified to be more memory efficient.createMultiChange
in interface TextEditingArea<PS,SEG,S>
public void dispose()
TextEditingArea
dispose
in interface TextEditingArea<PS,SEG,S>
protected void layoutChildren()
layoutChildren
in class javafx.scene.Parent
public java.util.List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getCssMetaData()
getCssMetaData
in class javafx.scene.layout.Region
public static java.util.List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getClassCssMetaData()