Skip to main content

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

ITextRange

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.

setSelectionByPoints()
setSelectionByPoints(startPoint, endPoint): void;

Sets the selection of text by starting and ending points.

Parameters
ParameterTypeDescription
startPointIPointstarting point.
endPointIPointending point.
Returns

void

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

Sets the selection of text by starting and ending positions.

Parameters
ParameterTypeDescription
startPositionIPositionInTextstarting position.
endPositionIPositionInTextending position.
Returns

void

setSelectionByRange()
setSelectionByRange(selection): void;

Sets the selection of text by a range.

Parameters
ParameterTypeDescription
selectionITextRangestart position in text.
Returns

void

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

Was this page helpful?