Interface TextSelection.TextSelectionSupport
- Enclosing class:
TextSelection
Component#getTextSelectionSupport() method to provide
text selection support on that component.-
Method Summary
Modifier and TypeMethodDescriptiongetTextForSpan(TextSelection sel, TextSelection.Span span) Returns the text for a given span.getTextSelectionForBounds(TextSelection sel, Rectangle bounds) Gets the spans that should be selected for the given bounds.booleanChecks if text selection is enabled for this component.booleanChecks if this component can be used to trigger a text selection.triggerSelectionAt(TextSelection sel, int x, int y) Trigger a text selection at a given point.
-
Method Details
-
getTextSelectionForBounds
Gets the spans that should be selected for the given bounds.
Parameters
-
sel: The TextSelection instance. -
bounds: The bounds to check. Relative to#getSelectionRoot()
Returns
Spans of text that should be selected.
-
-
isTextSelectionEnabled
Checks if text selection is enabled for this component.
Parameters
sel: The TextSelection instance.
Returns
True if text selection is enabled.
-
isTextSelectionTriggerEnabled
Checks if this component can be used to trigger a text selection. On mobile devices text selection is triggered with a long press over a component.
Parameters
sel: The TextSelection instance.
Returns
True if text selection can be triggered on this component.
-
triggerSelectionAt
Trigger a text selection at a given point.
Parameters
-
sel: The TextSelection instance -
x: The x coordinate of the event. Relative to#getSelectionRoot() -
y: The y coordinate of the event. Relative to#getSelectionRoot()
Returns
The span that should be selected by a long press at this point.
-
-
getTextForSpan
Returns the text for a given span.
Parameters
-
sel: The TextSelection instance. -
span: The span describing the range of text that should be returned.
Returns
The text that is contained.
-
-