SelectionHandler
Classes
SelectionHandler
Handler for performing simple operations with text selection.
Remarks
the TextWhizz is used as a text engine.
Implements
Constructors
Constructor
new SelectionHandler(tw): SelectionHandler;
Parameters
| Parameter | Type |
|---|---|
tw | ITextWhizzHolder |
Returns
Accessors
selectionChangeEvent
Get Signature
get selectionChangeEvent(): EventObject<ITextRange>;
Text selection change event.
Remarks
reports the currently selected text.
Returns
EventObject<ITextRange>
Text selection change event.
Remarks
reports the currently selected text.
Implementation of
ISelectionHandler.selectionChangeEvent
Methods
getSelectionRange()
getSelectionRange(): ITextRange;
Returns the currently selected text range.
Returns
Implementation of
ISelectionHandler.getSelectionRange
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.
Implementation of
ISelectionHandler.resetSelection
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
Implementation of
ISelectionHandler.setSelectionByPoints
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
Implementation of
ISelectionHandler.setSelectionByPositions
setSelectionByRange()
setSelectionByRange(selection): void;
Sets the selection of text by a range.
Parameters
| Parameter | Type | Description |
|---|---|---|
selection | ITextRange | start position in text. |
Returns
void
Implementation of
ISelectionHandler.setSelectionByRange
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