Class: Editor

Annotations.FreeTextAnnotation. Editor

A class that represents controls used for editing contents of a freetext annotation

new Editor()

Methods


format(format, value)

Format text at the current selection. If the current selection has length of 0, then the format will be set active.
Parameters:
Name Type Description
format Annotations.FreeTextAnnotation.Editor.Format
value Annotations.FreeTextAnnotation.Editor.FormatValue

getFormat(index, length)

Gets the format of the text in the given range.
Parameters:
Name Type Description
index number the start index of the range
length number the length of the range
Returns:
Returns the format of the given range
Type
object

getSelection()

Gets the current selection range in the editor.
Returns:
Returns the current selection range
Type
CoreControls.EditBoxManager.Range

hasFocus()

Checks if the editor is being focused.
Returns:
Whether the editor is focused
Type
boolean

setSelection(index, length)

Sets the current selection in the editor.
Parameters:
Name Type Description
index number the start index of the range
length number the length of the selection range

Type Definitions


Format

The available formats of an editor instance
Type:
  • 'color' | 'bold' | 'italic' | 'underline' | 'strike'

FormatValue

The value of a format. The value should be a hex color string(e.g. #FF00FF) for the `color` format, and boolean for the rest of formats.
Type:
  • string | boolean