Top Inners Fields Constructors Methods
org.fxmisc.richtext

pack-priv final Class CaretSelectionBindImpl<PS, SEG, S>

extends Object
implements CaretSelectionBind<PS, SEG, S>
Class Inheritance
All Implemented Interfaces
org.fxmisc.richtext.CaretSelectionBind, org.fxmisc.richtext.Caret, org.fxmisc.richtext.Selection
Imports
javafx.beans.value.ObservableValue, javafx.geometry.Bounds, javafx.scene.control.IndexRange, javafx.util.Duration, org.fxmisc.richtext.model.StyledDocument, org.reactfx.Subscription, .Suspendable, .SuspendableNo, org.reactfx.util.Tuple3, .Tuples, org.reactfx.value.SuspendableVal, .Val, .Var, java.text.BreakIterator, java.util.Optional, .OptionalInt, java.util.function.Function

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final Val<Integer>
private final Val<Integer>
private final Val<Integer>
private final SuspendableNo
private final CaretNode
private final Selection<PS, SEG, S>
private final Var<CaretSelectionBindImpl<PS, SEG, S>.BooleanEvent>
private final SuspendableVal<CaretSelectionBindImpl<PS, SEG, S>.BooleanEvent>
private Subscription

Constructor Summary

AccessConstructor and Description
pack-priv
CaretSelectionBindImpl(String caretName, String selectionName, GenericStyledArea<PS, SEG, S> area)

pack-priv
CaretSelectionBindImpl(String caretName, String selectionName, GenericStyledArea<PS, SEG, S> area, IndexRange startingRange)

pack-priv
CaretSelectionBindImpl(Function<SuspendableNo, ? extends CaretNode> createCaret, Function<SuspendableNo, Selection<PS, SEG, S>> createSelection)

Method Summary

Modifier and TypeMethod and Description
public ObservableValue<Integer>
private boolean
public ObservableValue<Integer>
public ObservableValue<Integer>
public final ObservableValue<Boolean>
public ObservableValue<Duration>
private int
calculatePositionViaBreakingBackwards(int numOfBreaks, BreakIterator breakIterator, int position)

Assumes that getArea().getLength != 0 is true and BreakIterator#setText(String) has been called

private int
calculatePositionViaBreakingForwards(int numOfBreaks, BreakIterator breakIterator, int position)

Assumes that getArea().getLength != 0 is true and BreakIterator#setText(String) has been called

public ObservableValue<Optional<Bounds>>
caretBoundsProperty()

Implements org.fxmisc.richtext.Caret.caretBoundsProperty.

The selectionBoundsProperty of the caret in the Screen's coordinate system or Optional#empty() if caret is not visible in the viewport.

public void
clearTargetOffset()

Implements org.fxmisc.richtext.Caret.clearTargetOffset.

Clears the caret's x offset

public ObservableValue<Integer>
columnPositionProperty()

Implements org.fxmisc.richtext.Caret.columnPositionProperty.

The column position of the caret on its given line

public void
configureSelectionPath(SelectionPath path)

Implements org.fxmisc.richtext.Selection.configureSelectionPath.

Configures a SelectionPath that will be used to render a portion or all of this selection on a single paragraph.

public void
deselect()

Implements org.fxmisc.richtext.CaretSelectionBind.deselect.

Clears the selection while keeping the caret position the same.

public void
displaceCaret(int position)

Implements org.fxmisc.richtext.CaretSelectionBind.displaceCaret.

Displaces the caret from the selection by positioning only the caret to the new location without also affecting the selection's getAnchorPosition() anchor} or the getRange() selection}.

public void
displaceSelection(int startPosition, int endPosition)

Implements org.fxmisc.richtext.CaretSelectionBind.displaceSelection.

Displaces the caret from the selection by positioning only the selection to the new location without also affecting the caret's position.

public void
dispose()

Implements org.fxmisc.richtext.Selection.dispose, org.fxmisc.richtext.Caret.dispose.

Disposes the selection and prevents memory leaks

private void
doSelect(int startPosition, int endPosition, boolean anchorIsStart)

private void
doUpdate(Runnable updater)

public ObservableValue<Integer>
public ObservableValue<Integer>
public ObservableValue<Integer>
public int
public int
public int
public GenericStyledArea<PS, SEG, S>
getArea()

Implements org.fxmisc.richtext.Selection.getArea, org.fxmisc.richtext.Caret.getArea.

Gets the area with which this selection is associated

private int
public Duration
public Optional<Bounds>
public String
getCaretName()

Implements org.fxmisc.richtext.Caret.getCaretName.

Gets the name of this caret.

public int
public int
public int
public int
public int
public OptionalInt
public int
public int
public int
public IndexRange
public final StyledDocument<PS, SEG, S>
public String
public Optional<Bounds>
public String
getSelectionName()

Implements org.fxmisc.richtext.Selection.getSelectionName.

Gets the name of this selection.

public Caret.CaretVisibility
public int
public int
public int
public ParagraphBox.CaretOffsetX
getTargetOffset()

Implements org.fxmisc.richtext.Caret.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.

public CaretNode
public Selection<PS, SEG, S>
public final boolean
public boolean
public ObservableValue<Integer>
lengthProperty()

Implements org.fxmisc.richtext.Selection.lengthProperty.

The length of the selection

public ObservableValue<OptionalInt>
lineIndexProperty()

Implements org.fxmisc.richtext.Caret.lineIndexProperty.

The line index of a multi-line paragraph that contains this caret

public void
moveBreaksBackwards(int numOfBreaks, BreakIterator breakIterator)

Implements org.fxmisc.richtext.CaretSelectionBind.moveBreaksBackwards.

Moves the caret backwards by the number of breaks and clears any selection

public void
moveBreaksForwards(int numOfBreaks, BreakIterator breakIterator)

Implements org.fxmisc.richtext.CaretSelectionBind.moveBreaksForwards.

Moves the caret forwards by the number of breaks and clears any selection

public void
moveTo(int pos, NavigationActions.SelectionPolicy selectionPolicy)

Overrides default org.fxmisc.richtext.CaretSelectionBind.moveTo.

Moves the caret to the position indicated by pos.

public void
moveTo(int paragraphIndex, int columnIndex, NavigationActions.SelectionPolicy selectionPolicy)

Implements org.fxmisc.richtext.CaretSelectionBind.moveTo.

Moves the caret to the position returned from TextEditingArea#getAbsolutePosition(int, int).

public void
public void
public void
moveToNextChar(NavigationActions.SelectionPolicy selectionPolicy)

Implements org.fxmisc.richtext.CaretSelectionBind.moveToNextChar.

Moves the caret forward one char in the text.

public void
public void
public void
moveToPrevChar(NavigationActions.SelectionPolicy selectionPolicy)

Implements org.fxmisc.richtext.CaretSelectionBind.moveToPrevChar.

Moves the caret backward one char in the text.

public ObservableValue<Integer>
paragraphIndexProperty()

Implements org.fxmisc.richtext.Caret.paragraphIndexProperty.

The paragraph index that contains this caret

public ObservableValue<Integer>
paragraphSpanProperty()

Implements org.fxmisc.richtext.Selection.paragraphSpanProperty.

The number of paragraphs the selection spans

public ObservableValue<Integer>
positionProperty()

Implements org.fxmisc.richtext.Caret.positionProperty.

The position of the caret within the text

public ObservableValue<IndexRange>
rangeProperty()

Implements org.fxmisc.richtext.Selection.rangeProperty.

The start and end positions in the area as an IndexRange.

public void
selectAll()

Implements org.fxmisc.richtext.CaretSelectionBind.selectAll.

Selects everything in the area and moves the caret to either the start of the new selection if the anchor was equal to the original start or the end if the anchor was equal to the original end

public final ObservableValue<StyledDocument<PS, SEG, S>>
public ObservableValue<String>
public ObservableValue<Optional<Bounds>>
selectionBoundsProperty()

Implements org.fxmisc.richtext.Selection.selectionBoundsProperty.

The selectionBoundsProperty of the selection in the Screen's coordinate system if something is selected and visible in the viewport, or Optional#empty() if selection is not visible in the viewport.

public void
selectParagraph(int paragraphIndex)

Implements org.fxmisc.richtext.CaretSelectionBind.selectParagraph.

Selects the given paragraph and moves the caret to either the start of the new selection if the anchor was equal to the original start or the end if the anchor was equal to the original end

public void
selectRange(int startPosition, int endPosition)

Implements org.fxmisc.richtext.CaretSelectionBind.selectRange.

Selects the given range and moves the caret to either the start of the new selection if the anchor was equal to the original start or the end if the anchor was equal to the original end

public void
selectRange(int startParagraphIndex, int startColPosition, int endParagraphIndex, int endColPosition)

Implements org.fxmisc.richtext.CaretSelectionBind.selectRange.

Selects the given range and moves the caret to either the start of the new selection if the anchor was equal to the original start or the end if the anchor was equal to the original end

Caution

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

public void
selectRangeExpl(int anchorParagraph, int anchorColumn, int caretParagraph, int caretColumn)

Implements org.fxmisc.richtext.CaretSelectionBind.selectRangeExpl.

Positions the anchor and caretPosition explicitly, effectively creating a selection.

public void
selectRangeExpl(int anchorPosition, int caretPosition)

Implements org.fxmisc.richtext.CaretSelectionBind.selectRangeExpl.

Positions the anchor and caretPosition explicitly, effectively creating a selection.

public void
selectWord(int wordPositionInArea)

Implements org.fxmisc.richtext.CaretSelectionBind.selectWord.

Selects the closest word to the given position in the area and moves the caret to either the start of the new selection if the anchor was equal to the original start or the end if the anchor was equal to the original end

public void
public void
public Var<Caret.CaretVisibility>
showCaretProperty()

Implements org.fxmisc.richtext.Caret.showCaretProperty.

Whether to display the caret or not.

public ObservableValue<Integer>
public ObservableValue<Integer>
public ObservableValue<Integer>
private int
textPosition(int paragraphIndex, int columnPosition)

public void
public void
public void
public void
public void
updateEndTo(int paragraphIndex, int columnPosition)

Implements org.fxmisc.richtext.CaretSelectionBind.updateEndTo.

public void
public void
public void
public void
public void
updateStartTo(int paragraphIndex, int columnPosition)

Implements org.fxmisc.richtext.CaretSelectionBind.updateStartTo.

public ObservableValue<Boolean>
visibleProperty()

Implements org.fxmisc.richtext.Caret.visibleProperty.

Whether the caret is being shown in the viewport

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait