Skip to main content

NewTextEditor

Classes​

NewTextEditor​

In-place text editor.

Remarks​

A text editor works with a text engine only through a text manager.

Implements​

Constructors​

Constructor​
new NewTextEditor(
clipboard,
inputTextValidator,
fontRegistry,
renderer): NewTextEditor;
Parameters​
ParameterType
clipboardIClipboard
inputTextValidatorIInputTextValidator
fontRegistryIFontRegistry
rendererITextEditorRenderer
Returns​

NewTextEditor

Accessors​

canRedo​
Get Signature​
get canRedo(): boolean;

Indicates if the action can be redone.

Returns​

boolean

Indicates if the action can be redone.

Implementation of​

ITextEditor.canRedo

canUndo​
Get Signature​
get canUndo(): boolean;

Indicates if the action can be undone.

Returns​

boolean

Indicates if the action can be undone.

Implementation of​

ITextEditor.canUndo

disableDrawBaseline​
Get Signature​
get disableDrawBaseline(): boolean;
Returns​

boolean

Implementation of​

ITextEditor.disableDrawBaseline

editorInitialized​
Get Signature​
get editorInitialized(): EventObject<void>;

Editor initialization event.

Returns​

EventObject<void>

Editor initialization event.

Implementation of​

ITextEditor.editorInitialized

frameChanged​
Get Signature​
get frameChanged(): EventObject<RectangleF>;

Text frame change event.

Remarks​

Reports the currently text frame.

Returns​

EventObject<RectangleF>

Text frame change event.

Remarks​

Reports the currently text frame.

Implementation of​

ITextEditor.frameChanged

highlightInEditingModeEnabled​
Get Signature​
get highlightInEditingModeEnabled(): boolean;

Indicates if the editor has to be highlighted when in editing mode.

Returns​

boolean

Indicates if the editor has to be highlighted when in editing mode.

Implementation of​

ITextEditor.highlightInEditingModeEnabled

invalidCharEntered​
Get Signature​
get invalidCharEntered(): EventObject<void>;

Invalid character input event.

Returns​

EventObject<void>

Invalid character input event.

Implementation of​

ITextEditor.invalidCharEntered

isActive​
Get Signature​
get isActive(): boolean;

Indicates if the editor is in editing mode.

Returns​

boolean

Indicates if the editor is in editing mode.

Implementation of​

ITextEditor.isActive

isReady​
Get Signature​
get isReady(): boolean;

Indicates if the editor is initialized and ready to work.

Returns​

boolean

Indicates if the editor is initialized and ready to work.

Implementation of​

ITextEditor.isReady

redrawActiveTextInEditMode​
Get Signature​
get redrawActiveTextInEditMode(): boolean;

Indicates if the editor needs to redraw ActiveText when it is edited.

Returns​

boolean

Indicates if the editor needs to redraw ActiveText when it is edited.

Implementation of​

ITextEditor.redrawActiveTextInEditMode

renderer​
Get Signature​
get renderer(): ITextEditorRenderer;

Returns a text editor renderer.

Returns​

ITextEditorRenderer

styleChanged​
Get Signature​
get styleChanged(): EventObject<void>;

Character or paragraph style change event.

Returns​

EventObject<void>

Character or paragraph style change event.

Implementation of​

ITextEditor.styleChanged

textLimits​
Get Signature​
get textLimits(): ITextLimits;

Get current text limits.

Returns​

ITextLimits

Get current text limits.

Implementation of​

ITextEditor.textLimits

textLimitsViolationEvent​
Get Signature​
get textLimitsViolationEvent(): EventObject<ILimitsViolationEventData>;
Returns​

EventObject<ILimitsViolationEventData>

Implementation of​

ITextEditor.textLimitsViolationEvent

textMetrics​
Get Signature​
get textMetrics(): ITextMetrics;

Get current text data: characters count, paragraphs count, current paragraph characters count.

Returns​

ITextMetrics

Get current text data: characters count, paragraphs count, current paragraph characters count.

Implementation of​

ITextEditor.textMetrics

textMetricsChangedEvent​
Get Signature​
get textMetricsChangedEvent(): EventObject<ITextMetrics>;
Returns​

EventObject<ITextMetrics>

Implementation of​

ITextEditor.textMetricsChangedEvent

Methods​

dispose()​
dispose(): void;

Disposes text editor when its no longer needed.

Returns​

void

Implementation of​

ITextEditor.dispose

enterEditMode()​
enterEditMode(point): void;

Enters the editing mode.

Parameters​
ParameterTypeDescription
pointIPointcursor point.
Returns​

void

Implementation of​

ITextEditor.enterEditMode

executeCommand()​
executeCommand(commandType, initData?): void;

Executes a command of the specified type.

Parameters​
ParameterTypeDescription
commandTypeCommandTypetype of command.
initData?anydata required to initialize the command.
Returns​

void

Implementation of​

ITextEditor.executeCommand

exitEditMode()​
exitEditMode(): void;

Exits editing mode.

Returns​

void

Implementation of​

ITextEditor.exitEditMode

getFormattedText()​
getFormattedText(): Promise<string>;

Returns formatted text.

Returns​

Promise<string>

Implementation of​

ITextEditor.getFormattedText

getInlineStyle()​
getInlineStyle(): ICharStyle;

Returns the character style for the current cursor position or the starting position of the selected text.

Returns​

ICharStyle

Implementation of​

ITextEditor.getInlineStyle

getParagraphStyle()​
getParagraphStyle(): IParagraphStyle;

Returns the paragraph style for the current cursor position or the first paragraph of the selected text.

Returns​

IParagraphStyle

Implementation of​

ITextEditor.getParagraphStyle

getTextModel()​
getTextModel(): Text;

Returns the text model.

Returns​

Text

Implementation of​

ITextEditor.getTextModel

initialize()​
initialize(
tw,
itemData,
listStyleSheetManager): void;

Initializes the text editor.

Parameters​
ParameterTypeDescription
twITextEngineWrappertext engine.
itemDataTextEditorInitDatatext item data.
listStyleSheetManagerIListStyleSheetManagerstyle manager for lists.
Returns​

void

isApplyingListsEnabled()​
isApplyingListsEnabled(): boolean;

Indicates if applying lists is allowed.

Returns​

boolean

Implementation of​

ITextEditor.isApplyingListsEnabled

isBulletedList()​
isBulletedList(): boolean;

Indicates if the current paragraph or selected paragraphs are bulleted list.

Returns​

boolean

Implementation of​

ITextEditor.isBulletedList

isIndentationEnabled()​
isIndentationEnabled(): boolean;

Indicates if indentation is allowed.

Returns​

boolean

Implementation of​

ITextEditor.isIndentationEnabled

isIndentationHidden()​
isIndentationHidden(): boolean;

Indicates if indentation is applyable.

Returns​

boolean

Implementation of​

ITextEditor.isIndentationHidden

isNumberedList()​
isNumberedList(): boolean;

Indicates if the current paragraph or selected paragraphs are numbered list.

Returns​

boolean

Implementation of​

ITextEditor.isNumberedList

processKeyEvent()​
processKeyEvent(e): Promise<boolean>;

Handles keyboard input events.

Parameters​
ParameterTypeDescription
eIKeyboardEventkeyboard event.
Returns​

Promise<boolean>

true if changes were made, false otherwise.

Implementation of​

ITextEditor.processKeyEvent

processMouseEvent()​
processMouseEvent(e): boolean;

Handles mouse input events.

Parameters​
ParameterTypeDescription
eIMouseEventmouse event.
Returns​

boolean

Implementation of​

ITextEditor.processMouseEvent

processZoomChangedEvent()​
processZoomChangedEvent(): Promise<boolean>;

Handles canvas zoom changed event.

Returns​

Promise<boolean>

true if event was processed, false if the text editor is not ready yet.

Implementation of​

ITextEditor.processZoomChangedEvent

redo()​
redo(): void;

Redoes an action.

Returns​

void

Implementation of​

ITextEditor.redo

redraw()​
redraw(): boolean;
Returns​

boolean

Implementation of​

ITextEditor.redraw

setFontRegistry()​
setFontRegistry(fontRegistry): void;
Parameters​
ParameterType
fontRegistryIFontRegistry
Returns​

void

Implementation of​

ITextEditor.setFontRegistry

setInlineStyle()​
setInlineStyle(style): Promise<void>;

Sets the character style for the current cursor position or selected text.

Parameters​
ParameterTypeDescription
styleICharStyleexpected character style.
Returns​

Promise<void>

Remarks​

only properties specified in the expected style are set.

Implementation of​

ITextEditor.setInlineStyle

setParagraphStyle()​
setParagraphStyle(style): Promise<void>;

Sets the paragraph style for the current cursor position or selected text.

Parameters​
ParameterTypeDescription
styleIParagraphStyleexpected paragraph style.
Returns​

Promise<void>

Remarks​

only properties specified in the expected style are set.

Implementation of​

ITextEditor.setParagraphStyle

undo()​
undo(): void;

Undoes an action.

Returns​

void

Implementation of​

ITextEditor.undo


TextEditorInitData​

Constructors​

Constructor​
new TextEditorInitData(): TextEditorInitData;
Returns​

TextEditorInitData

Properties​

isBoundedText​
isBoundedText: boolean;
isEmptyTextPlaceholder​
isEmptyTextPlaceholder: boolean;
isNewLineEnabled​
isNewLineEnabled: boolean;
isTextFormattingEnabled​
isTextFormattingEnabled: boolean;
limits?​
optional limits?: ITextLimits;
overflowStrategy?​
optional overflowStrategy?: OverflowStrategy;
previewScale​
previewScale: number;
rectangle​
rectangle: RectangleF;
textVerticalAlignment​
textVerticalAlignment: TextVerticalAlignment;
Was this page helpful?