Class SelectionSegment
java.lang.Object
jfx.incubator.scene.control.richtext.SelectionSegment
Text selection segment, comprised of the selection anchor and the caret positions.
The main purpose of this class is to enable tracking of selection changes as a single entity.
- Since:
- 24
-
Constructor Summary
ConstructorsConstructorDescriptionSelectionSegment
(TextPos anchor, TextPos caret) Constructs the selection segment. -
Method Summary
Modifier and TypeMethodDescriptionfinal TextPos
Returns the selection anchor position.final TextPos
getCaret()
Returns the caret position.getMax()
Returns the position which is closer to the end of the document.final TextPos
getMin()
Returns the position which is closer to the start of the document.boolean
Returns true if the anchor and the caret are at the same position.
-
Constructor Details
-
SelectionSegment
-
-
Method Details
-
getAnchor
Returns the selection anchor position.- Returns:
- the anchor position
-
getCaret
-
getMin
Returns the position which is closer to the start of the document.- Returns:
- the text position
-
getMax
Returns the position which is closer to the end of the document.- Returns:
- the text position
-
isCollapsed
public boolean isCollapsed()Returns true if the anchor and the caret are at the same position.- Returns:
- true if the anchor and the caret are at the same position
-