public interface ITextRangeProvider
Modifier and Type | Method and Description |
---|---|
void |
AddToSelection()
Adds the text range to the collection of selected text ranges in a control that supports multiple, disjoint spans of selected text.
|
ITextRangeProvider |
Clone()
Returns a new ITextRangeProvider identical to the original ITextRangeProvider and inheriting all properties of the original.
|
boolean |
Compare(ITextRangeProvider other)
Retrieves a value that specifies whether this text range has the same endpoints as another text range.
|
int |
CompareEndpoints(TextPatternRangeEndpoint endpoint,
ITextRangeProvider targetRange,
TextPatternRangeEndpoint targetEndpoint)
Returns a value that specifies whether two text ranges have identical endpoints.
|
void |
ExpandToEnclosingUnit(TextUnit unit)
Normalizes the text range by the specified text unit.
|
ITextRangeProvider |
FindText(java.lang.String text,
boolean backward,
boolean ignoreCase)
Returns a text range subset that contains the specified text.
|
javafx.geometry.Bounds[] |
GetBoundingRectangles() |
IUIAElement[] |
GetChildren()
Retrieves a collection of all elements that are both contained (either partially or completely) within the specified text range, and are child elements of the enclosing element for the specified text range.
|
IUIAElement |
GetEnclosingElement()
Returns the innermost element that encloses the specified text range.
|
java.lang.String |
GetText(int maxLength)
Retrieves the plain text of the range.
|
default void |
initialize(ITextAttributeSupport context) |
int |
Move(TextUnit unit,
int count)
Moves the text range forward or backward by the specified number of text units.
|
void |
MoveEndpointByRange(TextPatternRangeEndpoint endpoint,
ITextRangeProvider targetRange,
TextPatternRangeEndpoint targetEndpoint)
Moves one endpoint of the current text range to the specified endpoint of a second text range.
|
int |
MoveEndpointByUnit(TextPatternRangeEndpoint endpoint,
TextUnit unit,
int count)
The endpoint is moved forward or backward, as specified, to the next available unit boundary.
|
void |
RemoveFromSelection()
Removes the text range from the collection of selected text ranges in a control that supports multiple, disjoint spans of selected text.
|
void |
ScrollIntoView(boolean alignToTop)
Causes the text control to scroll vertically until the text range is visible in the viewport.
|
void |
Select()
Selects the span of text that corresponds to this text range, and removes any previous selection.
|
default void initialize(ITextAttributeSupport context)
void AddToSelection()
ITextRangeProvider Clone()
boolean Compare(ITextRangeProvider other)
other
- The text range to compare with this one.int CompareEndpoints(TextPatternRangeEndpoint endpoint, ITextRangeProvider targetRange, TextPatternRangeEndpoint targetEndpoint)
Returns a negative value if the caller's endpoint occurs earlier in the text than the target endpoint. Returns zero if the caller's endpoint is at the same location as the target endpoint. Returns a positive value if the caller's endpoint occurs later in the text than the target endpoint.
endpoint
- the endpointtargetRange
- The text range to be compared.targetEndpoint
- the target endpointvoid ExpandToEnclosingUnit(TextUnit unit)
unit
- The type of text units, such as character, word, paragraph, and so on.ITextRangeProvider FindText(java.lang.String text, boolean backward, boolean ignoreCase)
text
- The text string to search for.backward
- TRUE if the last occurring text range should be returned instead of the first; otherwise FALSE.ignoreCase
- TRUE if case should be ignored; otherwise FALSE.javafx.geometry.Bounds[] GetBoundingRectangles()
IUIAElement[] GetChildren()
IUIAElement GetEnclosingElement()
Note: The enclosing element can span more than just the specified ITextRangeProvider.
If no enclosing element is found, the ITextProvider parent of the ITextRangeProvider is returned.java.lang.String GetText(int maxLength)
maxLength
- The maximum length of the string to return. Use -1 if no limit is required.int Move(TextUnit unit, int count)
unit
- the unitcount
- The number of text units to move. A positive value moves the text range forward.
A negative value moves the text range backward. Zero has no effect.void MoveEndpointByRange(TextPatternRangeEndpoint endpoint, ITextRangeProvider targetRange, TextPatternRangeEndpoint targetEndpoint)
If the endpoint being moved crosses the other endpoint of the same text range, that other endpoint is moved also, resulting in a degenerate (empty) range and ensuring the correct ordering of the endpoints (that is, the start is always less than or equal to the end).
endpoint
- the endpointtargetRange
- A second text range from the same text provider as the current text range.targetEndpoint
- the target endpointint MoveEndpointByUnit(TextPatternRangeEndpoint endpoint, TextUnit unit, int count)
The endpoint is moved forward or backward, as specified, to the next available unit boundary. If the original endpoint was at the boundary of the specified text unit, the endpoint is moved to the next available text unit boundary, as shown in the following illustration.
ITextRangeProvider::MoveEndpointByUnit deprecates up to the next supported text unit if the given text unit is not supported by the control.
The order, from smallest unit to largest, is listed here.
TextUnit::Format
TextUnit::Format
as a unit value positions the boundary of a text range to expand or move the range based on shared text attributes (format) of the text within the range. However, using the format text unit should not move or expand a text range across the boundary of an embedded object, such as an image or hyperlink. For more info, see UI Automation Text Units or Text and TextRange Control Patterns.endpoint
- the endpointunit
- the unitcount
- The number of units to move. A positive value moves the endpoint forward. A negative value moves backward. A value of 0 has no effect.void RemoveFromSelection()
void ScrollIntoView(boolean alignToTop)
ITextRangeProvider::ScrollIntoView respects both hidden and visible text. If the text range is hidden, the text control will scroll only if the hidden text has an anchor in the viewport.
alignToTop
- TRUE if the text control should be scrolled so the text range is flush with the top of the viewport; FALSE if it should be flush with the bottom of the viewport.void Select()