Skip to main content

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
ParameterType
twITextWhizzHolder
Returns

SelectionHandler

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

ITextRange

Implementation of

ISelectionHandler.getSelectionRange

resetSelection()
resetSelection(position?): void;

Resets the selection of text and sets the anchor to a new position.

Parameters
ParameterTypeDescription
position?IPositionInTextnew 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
ParameterTypeDescription
startPointIPointstarting point.
endPointIPointending point.
Returns

void

Implementation of

ISelectionHandler.setSelectionByPoints

setSelectionByPositions()
setSelectionByPositions(startPosition, endPosition): void;

Sets the selection of text by starting and ending positions.

Parameters
ParameterTypeDescription
startPositionIPositionInTextstarting position.
endPositionIPositionInTextending position.
Returns

void

Implementation of

ISelectionHandler.setSelectionByPositions

setSelectionByRange()
setSelectionByRange(selection): void;

Sets the selection of text by a range.

Parameters
ParameterTypeDescription
selectionITextRangestart 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
ParameterTypeDescription
positionIPositionInTextnew position in the text.
Returns

void

Implementation of

ISelectionHandler.setSelectionToPosition

Was this page helpful?