CaretSelectionBind<PS,SEG,S>
CaretNode
public interface Caret
"Position" refers to the place in-between characters. In other words, every "|"
in
"|t|e|x|t|"
is a valid position. There are two kinds of positions used here:
getPosition()
, which refers to a position somewhere in the entire area's content.
It's bounds are 0 <= x <= area.getLength()
.
getColumnPosition()
, which refers to a position somewhere in the current paragraph.
It's bounds are 0 <= x <= area.getParagraphLength(index)
.
"Line" refers either to a single paragraph when the area does not wrap
its text
or to a line on a multi-line paragraph when the area does wrap its text.
Type | Property | Description |
---|---|---|
javafx.beans.value.ObservableValue<java.lang.Boolean> |
beingUpdated |
|
javafx.beans.value.ObservableValue<javafx.util.Duration> |
blinkRate |
|
javafx.beans.value.ObservableValue<java.util.Optional<javafx.geometry.Bounds>> |
caretBounds |
The selectionBoundsProperty of the caret in the Screen's coordinate system or
Optional.empty() if caret is not visible
in the viewport. |
javafx.beans.value.ObservableValue<java.lang.Integer> |
columnPosition |
The column position of the caret on its given line
|
javafx.beans.value.ObservableValue<java.util.OptionalInt> |
lineIndex |
The line index of a multi-line paragraph that contains this caret
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
paragraphIndex |
The paragraph index that contains this caret
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
position |
The position of the caret within the text
|
org.reactfx.value.Var<Caret.CaretVisibility> |
showCaret |
Whether to display the caret or not.
|
javafx.beans.value.ObservableValue<java.lang.Boolean> |
visible |
Whether the caret is being shown in the viewport
|
Modifier and Type | Interface | Description |
---|---|---|
static class |
Caret.CaretVisibility |
Determines whether the caret is visible.
|
Modifier and Type | Method | Description |
---|---|---|
javafx.beans.value.ObservableValue<java.lang.Boolean> |
beingUpdatedProperty() |
|
javafx.beans.value.ObservableValue<javafx.util.Duration> |
blinkRateProperty() |
|
javafx.beans.value.ObservableValue<java.util.Optional<javafx.geometry.Bounds>> |
caretBoundsProperty() |
The selectionBoundsProperty of the caret in the Screen's coordinate system or
Optional.empty() if caret is not visible
in the viewport. |
void |
clearTargetOffset() |
Clears the caret's x offset
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
columnPositionProperty() |
The column position of the caret on its given line
|
void |
dispose() |
Disposes the caret and prevents memory leaks
|
GenericStyledArea<?,?,?> |
getArea() |
Gets the area with which this caret is associated.
|
javafx.util.Duration |
getBlinkRate() |
Gets the value of the property blinkRate.
|
java.util.Optional<javafx.geometry.Bounds> |
getCaretBounds() |
Gets the value of the property caretBounds.
|
java.lang.String |
getCaretName() |
Gets the name of this caret.
|
int |
getColumnPosition() |
Gets the value of the property columnPosition.
|
java.util.OptionalInt |
getLineIndex() |
Gets the value of the property lineIndex.
|
int |
getParagraphIndex() |
Gets the value of the property paragraphIndex.
|
int |
getPosition() |
Gets the value of the property position.
|
Caret.CaretVisibility |
getShowCaret() |
Gets the value of the property showCaret.
|
org.fxmisc.richtext.ParagraphBox.CaretOffsetX |
getTargetOffset() |
Stores the caret's current column position, so that moving the caret vertically will keep it close to its
original offset in a line.
|
boolean |
isBeingUpdated() |
|
boolean |
isVisible() |
|
javafx.beans.value.ObservableValue<java.util.OptionalInt> |
lineIndexProperty() |
The line index of a multi-line paragraph that contains this caret
|
void |
moveBreaksBackwards(int numOfBreaks,
java.text.BreakIterator breakIterator) |
Moves the caret backwards by the number of breaks.
|
void |
moveBreaksForwards(int numOfBreaks,
java.text.BreakIterator breakIterator) |
Moves the caret forwards by the number of breaks.
|
default void |
moveSentenceBreaksBackwards(int numOfSentenceBreaks) |
|
default void |
moveSentenceBreaksForwards(int numOfSentenceBreaks) |
|
void |
moveTo(int position) |
Moves the caret to the given position in the area.
|
void |
moveTo(int paragraphIndex,
int columnPosition) |
Moves the caret to the given position in the area.
|
void |
moveToAreaEnd() |
Moves the caret to the end of the area.
|
default void |
moveToAreaStart() |
Moves the caret to the beginning of the area.
|
void |
moveToNextChar() |
Moves the caret forward one char in the text.
|
void |
moveToParEnd() |
Moves the caret to the end of the current paragraph.
|
void |
moveToParStart() |
Moves the caret to the beginning of the current paragraph.
|
void |
moveToPrevChar() |
Moves the caret backward one char in the text.
|
default void |
moveWordBreaksBackwards(int numOfWordBreaks) |
|
default void |
moveWordBreaksForwards(int numOfWordBreaks) |
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
paragraphIndexProperty() |
The paragraph index that contains this caret
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
positionProperty() |
The position of the caret within the text
|
void |
setBlinkRate(javafx.util.Duration blinkRate) |
Sets the value of the property blinkRate.
|
void |
setShowCaret(Caret.CaretVisibility value) |
Sets the value of the property showCaret.
|
org.reactfx.value.Var<Caret.CaretVisibility> |
showCaretProperty() |
Whether to display the caret or not.
|
javafx.beans.value.ObservableValue<java.lang.Boolean> |
visibleProperty() |
Whether the caret is being shown in the viewport
|
javafx.beans.value.ObservableValue<java.lang.Integer> positionProperty
getPosition()
javafx.beans.value.ObservableValue<java.lang.Integer> paragraphIndexProperty
getParagraphIndex()
javafx.beans.value.ObservableValue<java.util.OptionalInt> lineIndexProperty
getLineIndex()
javafx.beans.value.ObservableValue<java.lang.Integer> columnPositionProperty
getColumnPosition()
org.reactfx.value.Var<Caret.CaretVisibility> showCaretProperty
Caret.CaretVisibility.AUTO
.javafx.beans.value.ObservableValue<java.lang.Boolean> visibleProperty
javafx.beans.value.ObservableValue<javafx.util.Duration> blinkRateProperty
getBlinkRate()
,
setBlinkRate(Duration)
javafx.beans.value.ObservableValue<java.util.Optional<javafx.geometry.Bounds>> caretBoundsProperty
Optional.empty()
if caret is not visible
in the viewport.getCaretBounds()
javafx.beans.value.ObservableValue<java.lang.Boolean> beingUpdatedProperty
javafx.beans.value.ObservableValue<java.lang.Integer> positionProperty()
getPosition()
int getPosition()
javafx.beans.value.ObservableValue<java.lang.Integer> paragraphIndexProperty()
getParagraphIndex()
int getParagraphIndex()
javafx.beans.value.ObservableValue<java.util.OptionalInt> lineIndexProperty()
getLineIndex()
java.util.OptionalInt getLineIndex()
javafx.beans.value.ObservableValue<java.lang.Integer> columnPositionProperty()
getColumnPosition()
int getColumnPosition()
org.reactfx.value.Var<Caret.CaretVisibility> showCaretProperty()
Caret.CaretVisibility.AUTO
.Caret.CaretVisibility getShowCaret()
Caret.CaretVisibility.AUTO
.void setShowCaret(Caret.CaretVisibility value)
Caret.CaretVisibility.AUTO
.javafx.beans.value.ObservableValue<java.lang.Boolean> visibleProperty()
boolean isVisible()
javafx.beans.value.ObservableValue<javafx.util.Duration> blinkRateProperty()
getBlinkRate()
,
setBlinkRate(Duration)
javafx.util.Duration getBlinkRate()
void setBlinkRate(javafx.util.Duration blinkRate)
javafx.beans.value.ObservableValue<java.util.Optional<javafx.geometry.Bounds>> caretBoundsProperty()
Optional.empty()
if caret is not visible
in the viewport.getCaretBounds()
java.util.Optional<javafx.geometry.Bounds> getCaretBounds()
Optional.empty()
if caret is not visible
in the viewport.void clearTargetOffset()
org.fxmisc.richtext.ParagraphBox.CaretOffsetX getTargetOffset()
boolean isBeingUpdated()
javafx.beans.value.ObservableValue<java.lang.Boolean> beingUpdatedProperty()
void moveTo(int paragraphIndex, int columnPosition)
CaretSelectionBind
,
it displaces the caret from the selection by positioning only the caret to the new location without
also affecting the CaretSelectionBind.getAnchorPosition()
bounded selection's anchor} or the
Selection.getRange()
selection}.
Caution: see TextEditingArea.getAbsolutePosition(int, int)
to
know how the column index argument can affect the returned position.
void moveTo(int position)
CaretSelectionBind
,
it displaces the caret from the selection by positioning only the caret to the new location without
also affecting the CaretSelectionBind.getAnchorPosition()
bounded selection's anchor} or the
Selection.getRange()
selection}.
void moveToParStart()
void moveToParEnd()
default void moveToAreaStart()
void moveToAreaEnd()
void moveToPrevChar()
void moveToNextChar()
void moveBreaksForwards(int numOfBreaks, java.text.BreakIterator breakIterator)
default void moveWordBreaksForwards(int numOfWordBreaks)
default void moveSentenceBreaksForwards(int numOfSentenceBreaks)
void moveBreaksBackwards(int numOfBreaks, java.text.BreakIterator breakIterator)
default void moveWordBreaksBackwards(int numOfWordBreaks)
default void moveSentenceBreaksBackwards(int numOfSentenceBreaks)
void dispose()
GenericStyledArea<?,?,?> getArea()
java.lang.String getCaretName()