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
| Parameter | Type |
|---|---|
clipboard | IClipboard |
inputTextValidator | IInputTextValidator |
fontRegistry | IFontRegistry |
renderer | ITextEditorRenderer |
Returns
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
canUndo
Get Signature
get canUndo(): boolean;
Indicates if the action can be undone.
Returns
boolean
Indicates if the action can be undone.
Implementation of
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
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
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
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
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
styleChanged
Get Signature
get styleChanged(): EventObject<void>;
Character or paragraph style change event.
Returns
EventObject<void>
Character or paragraph style change event.
Implementation of
textLimits
Get Signature
get textLimits(): ITextLimits;
Get current text limits.
Returns
Get current text limits.
Implementation of
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
Get current text data: characters count, paragraphs count, current paragraph characters count.
Implementation of
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
enterEditMode()
enterEditMode(point): void;
Enters the editing mode.
Parameters
| Parameter | Type | Description |
|---|---|---|
point | IPoint | cursor point. |
Returns
void
Implementation of
executeCommand()
executeCommand(commandType, initData?): void;
Executes a command of the specified type.
Parameters
| Parameter | Type | Description |
|---|---|---|
commandType | CommandType | type of command. |
initData? | any | data required to initialize the command. |
Returns
void
Implementation of
exitEditMode()
exitEditMode(): void;
Exits editing mode.
Returns
void
Implementation of
getFormattedText()
getFormattedText(): Promise<string>;
Returns formatted text.
Returns
Promise<string>
Implementation of
getInlineStyle()
getInlineStyle(): ICharStyle;
Returns the character style for the current cursor position or the starting position of the selected text.
Returns
Implementation of
getParagraphStyle()
getParagraphStyle(): IParagraphStyle;
Returns the paragraph style for the current cursor position or the first paragraph of the selected text.
Returns
Implementation of
getTextModel()
getTextModel(): Text;
Returns the text model.
Returns
Implementation of
initialize()
initialize(
tw,
itemData,
listStyleSheetManager): void;
Initializes the text editor.
Parameters
| Parameter | Type | Description |
|---|---|---|
tw | ITextEngineWrapper | text engine. |
itemData | TextEditorInitData | text item data. |
listStyleSheetManager | IListStyleSheetManager | style 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
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
processKeyEvent()
processKeyEvent(e): Promise<boolean>;
Handles keyboard input events.
Parameters
| Parameter | Type | Description |
|---|---|---|
e | IKeyboardEvent | keyboard event. |
Returns
Promise<boolean>
true if changes were made, false otherwise.
Implementation of
processMouseEvent()
processMouseEvent(e): boolean;
Handles mouse input events.
Parameters
| Parameter | Type | Description |
|---|---|---|
e | IMouseEvent | mouse event. |
Returns
boolean
Implementation of
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
redraw()
redraw(): boolean;
Returns
boolean
Implementation of
setFontRegistry()
setFontRegistry(fontRegistry): void;
Parameters
| Parameter | Type |
|---|---|
fontRegistry | IFontRegistry |
Returns
void
Implementation of
setInlineStyle()
setInlineStyle(style): Promise<void>;
Sets the character style for the current cursor position or selected text.
Parameters
| Parameter | Type | Description |
|---|---|---|
style | ICharStyle | expected character style. |
Returns
Promise<void>
Remarks
only properties specified in the expected style are set.
Implementation of
setParagraphStyle()
setParagraphStyle(style): Promise<void>;
Sets the paragraph style for the current cursor position or selected text.
Parameters
| Parameter | Type | Description |
|---|---|---|
style | IParagraphStyle | expected paragraph style. |
Returns
Promise<void>
Remarks
only properties specified in the expected style are set.
Implementation of
undo()
undo(): void;
Undoes an action.
Returns
void
Implementation of
TextEditorInitData
Constructors
Constructor
new TextEditorInitData(): TextEditorInitData;
Returns
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;