Top Description Fields Constructors Methods
jfx.incubator.scene.control.richtext

public final Class SingleSelectionModel

extends Object
implements SelectionModel
Class Inheritance
All Implemented Interfaces
jfx.incubator.scene.control.richtext.SelectionModel
Imports
javafx.beans.property.ReadOnlyObjectWrapper, .ReadOnlyProperty, javafx.beans.value.ChangeListener, jfx.incubator.scene.control.richtext.model.StyledTextModel

This SelectionModel supports a single selection segment.
Since
24

Field Summary

Modifier and TypeField and Description
private final ChangeListener<TextPos>
private Marker
private final ReadOnlyObjectWrapper<TextPos>
private final ChangeListener<TextPos>
private Marker
private final ReadOnlyObjectWrapper<TextPos>
private StyledTextModel
private final ReadOnlyObjectWrapper<SelectionSegment>

Constructor Summary

AccessConstructor and Description
public
SingleSelectionModel()

The constructor.

Method Summary

Modifier and TypeMethod and Description
public ReadOnlyProperty<TextPos>
public ReadOnlyProperty<TextPos>
public void
public void
extendSelection(StyledTextModel
the model, must be non-null
model
,
TextPos
the new caret position, must be non-null
pos
)

Implements jfx.incubator.scene.control.richtext.SelectionModel.extendSelection.

Extends selection to the specified position.

public SelectionSegment
private boolean
public ReadOnlyProperty<SelectionSegment>
public void
setSelection(StyledTextModel
the model, must be non-null
model
,
TextPos
the anchor position, must be non-null
anchor
,
TextPos
the caret position, must be non-null
caret
)

Implements jfx.incubator.scene.control.richtext.SelectionModel.setSelection.

Replaced existing selection, if any, with the new one.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

anchorListenerback to summary
private final ChangeListener<TextPos> anchorListener
anchorMarkerback to summary
private Marker anchorMarker
anchorPositionback to summary
private final ReadOnlyObjectWrapper<TextPos> anchorPosition
caretListenerback to summary
private final ChangeListener<TextPos> caretListener
caretMarkerback to summary
private Marker caretMarker
caretPositionback to summary
private final ReadOnlyObjectWrapper<TextPos> caretPosition
modelback to summary
private StyledTextModel model
segmentback to summary
private final ReadOnlyObjectWrapper<SelectionSegment> segment

Constructor Detail

SingleSelectionModelback to summary
public SingleSelectionModel()

The constructor.

Method Detail

anchorPositionPropertyback to summary
public ReadOnlyProperty<TextPos> anchorPositionProperty()

Implements jfx.incubator.scene.control.richtext.SelectionModel.anchorPositionProperty.

Doc from jfx.incubator.scene.control.richtext.SelectionModel.anchorPositionProperty.

Anchor position property. The value can be null, indicating no selection. When the anchor position is null, the selectionProperty and the caretPositionProperty are also null.

Note

selectionProperty(), anchorPositionProperty(), and caretPositionProperty() are logically connected. When a change occurs, the anchor position is updated first, followed by the caret position, followed by the selection segment.

Returns:ReadOnlyProperty<TextPos>

the anchor position property

Annotations
@Override
caretPositionPropertyback to summary
public ReadOnlyProperty<TextPos> caretPositionProperty()

Implements jfx.incubator.scene.control.richtext.SelectionModel.caretPositionProperty.

Doc from jfx.incubator.scene.control.richtext.SelectionModel.caretPositionProperty.

Caret position property. The value can be null, indicating no selection. When the caret position is null, the selectionProperty and the anchorPositionProperty are also null.

Note

selectionProperty(), anchorPositionProperty(), and caretPositionProperty() are logically connected. When a change occurs, the anchor position is updated first, followed by the caret position, followed by the selection segment.

Returns:ReadOnlyProperty<TextPos>

the caret position property

Annotations
@Override
clearback to summary
public void clear()

Implements jfx.incubator.scene.control.richtext.SelectionModel.clear.

Doc from jfx.incubator.scene.control.richtext.SelectionModel.clear.

Clears the selection. This sets selectionProperty, anchorPositionProperty, and caretPositionProperty to null.

Annotations
@Override
extendSelectionback to summary
public void extendSelection(StyledTextModel model, TextPos pos)

Implements jfx.incubator.scene.control.richtext.SelectionModel.extendSelection.

Doc from jfx.incubator.scene.control.richtext.SelectionModel.extendSelection.

Extends selection to the specified position. Internally, the position will be normalized to be within the document boundaries. This method will issue a setSelection(model, pos, pos) call if the model instance is different from that passed before.

While this method will accept the text position outside of the document range, the actual values of anchorPositionProperty, and caretPositionProperty must always remain within the valid range for the document.

Parameters
model:StyledTextModel

the model, must be non-null

pos:TextPos

the new caret position, must be non-null

Annotations
@Override
getSelectionback to summary
public SelectionSegment getSelection()

Implements jfx.incubator.scene.control.richtext.SelectionModel.getSelection.

Doc from jfx.incubator.scene.control.richtext.SelectionModel.getSelection.

Returns the current selection. The value can be null, indicating no selection. When the selection segment is null, the anchorPositionProperty and the caretPositionProperty are also null.

Returns:SelectionSegment

current selection, or null

Annotations
@Override
isFlippingModelback to summary
private boolean isFlippingModel(StyledTextModel m)
selectionPropertyback to summary
public ReadOnlyProperty<SelectionSegment> selectionProperty()

Implements jfx.incubator.scene.control.richtext.SelectionModel.selectionProperty.

Doc from jfx.incubator.scene.control.richtext.SelectionModel.selectionProperty.

Selection property. The value can be null, indicating no selection. When the selection segment is null, the anchorPositionProperty and the caretPositionProperty are also null.

Returns:ReadOnlyProperty<SelectionSegment>

the selection property

Annotations
@Override
setSelectionback to summary
public void setSelection(StyledTextModel model, TextPos anchor, TextPos caret)

Implements jfx.incubator.scene.control.richtext.SelectionModel.setSelection.

Doc from jfx.incubator.scene.control.richtext.SelectionModel.setSelection.

Replaced existing selection, if any, with the new one. While this method will accept the text positions outside of the document range, the actual values of anchorPositionProperty, and caretPositionProperty must always remain within the valid range for the document.

Parameters
model:StyledTextModel

the model, must be non-null

anchor:TextPos

the anchor position, must be non-null

caret:TextPos

the caret position, must be non-null

Annotations
@Override
setSelectionSegmentback to summary
private void setSelectionSegment(StyledTextModel model, SelectionSegment sel)