Class: Word
Defined in: | lib/Types/TextTypes.coffee |
Inherits: | types.ListManager |
Overview
Handles a Text-like data structures with support for insertText/deleteText at a word-position.
Instance Method Summary
- # (void) insertText(position, content) Inserts a string into the word
- # (void) deleteText(position, length) Deletes a part of the word.
- # (void) replaceText(text) Replace the content of this word with another one.
- # (void) val() @returns [Json] A Json object.
- # (void) setReplaceManager(op) In most cases you would embed a Word in a Replaceable, wich is handled by the ReplaceManager in order to provide replace functionality.
- # (void) _encode() Encode this operation in such a way that it can be parsed by remote peers.
Constructor Details
#
(void)
constructor(uid, beginning, end, prev, next, origin)
Instance Method Details
#
(void)
insertText(position, content)
Inserts a string into the word
#
(void)
deleteText(position, length)
Deletes a part of the word.
#
(void)
replaceText(text)
Replace the content of this word with another one. Concurrent replacements are not merged! Only one of the replacements will be used.
Can only be used if the ReplaceManager was set!
#
(void)
val()
@returns [Json] A Json object.
#
(void)
setReplaceManager(op)
In most cases you would embed a Word in a Replaceable, wich is handled by the ReplaceManager in order to provide replace functionality.
#
(void)
_encode()
Encode this operation in such a way that it can be parsed by remote peers.