Document

Methods
6
Fields
None

Methods

MethodReturnsDescription
getLength()numberThe length in UTF-16 units.
getText(offset: number, length: number)stringlength units from offset; raises BadLocationException outside the text.
insertString(offset: number, str: string?, attributes: any?)()Inserts str at offset (the attributes are ignored: plain text).
remove(offset: number, length: number)()Removes length units at offset.
addDocumentListener(any)()insertUpdate, removeUpdate, changedUpdate, the last added first.
addUndoableEditListener(any)()A function of the event, a table with undoableEditHappened, or an UndoManager.

Returned by

MethodReturnsDescription
JTextComponent.getDocumentDocumentThe component's Document, the same one each call.

Method details

getText

getText: (Document, offset: number, length: number) -> string

length units from offset; raises BadLocationException outside the text.

insertString

insertString: (Document, offset: number, str: string?, attributes: any?) -> ()

Inserts str at offset (the attributes are ignored: plain text).

remove

remove: (Document, offset: number, length: number) -> ()

Removes length units at offset.