ISelectionHandler
Interfaces
ISelectionHandler
Handler for performing simple operations with text selection.
Properties
selectionChangeEvent
selectionChangeEvent: EventObject<ITextRange>;
Text selection change event.
Remarks
reports the currently selected text.
Methods
getSelectionRange()
getSelectionRange(): ITextRange;
Returns the currently selected text range.
Returns
resetSelection()
resetSelection(position?): void;
Resets the selection of text and sets the anchor to a new position.
Parameters
| Parameter | Type | Description |
|---|---|---|
position? | IPositionInText | new position in the text. |
Returns
void
Remarks
if position is null then anchor is set to null.
setSelectionByPoints()
setSelectionByPoints(startPoint, endPoint): void;
Sets the selection of text by starting and ending points.
Parameters
| Parameter | Type | Description |
|---|---|---|
startPoint | IPoint | starting point. |
endPoint | IPoint | ending point. |
Returns
void
setSelectionByPositions()
setSelectionByPositions(startPosition, endPosition): void;
Sets the selection of text by starting and ending positions.
Parameters
| Parameter | Type | Description |
|---|---|---|
startPosition | IPositionInText | starting position. |
endPosition | IPositionInText | ending position. |
Returns
void
setSelectionByRange()
setSelectionByRange(selection): void;
Sets the selection of text by a range.
Parameters
| Parameter | Type | Description |
|---|---|---|
selection | ITextRange | start position in text. |
Returns
void
setSelectionToPosition()
setSelectionToPosition(position): void;
Sets the selection of text to a position relative to the anchor.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | IPositionInText | new position in the text. |
Returns
void