Prototype for TextDocument.Selection objects. Is a kind of Document.Selection.
You can create a selection of a whole text document content this way (in this case, the content of the left side):
var selection = new TextDocument.Selection (my_doc.contents.left);
You can create a partial selection of a text document content this way:
var selection = new TextDocument.Selection (my_doc.contents.left, LinearRange (start, length));
content.
TextDocument.Content
object. Content to be selected.
range.
LinearRange
object. Range of content to be selected. If the value for this
parameter is omitted, the whole content is selected.
TextDocument object.
ECMerge 2.1
TextDocument.Selection object defines a portion of text within a given content (and as such a given side/role for the comparison). Selections are used in several places to edit and retrieve text.
Property | Description |
range | LinearRange object. Range of text contained by the selection. |
none specific.
Obtaining the text of the current selection in current view:
var sel =
current_frame.coordinator.current_view.clone_selection();
alert ( "The text in the selection is:" +
current_frame.coordinator.document.content[current_frame.coordinator.current_view.role].get_text(sel)
);
Document.Selection object, TextDocument.Content object, TextDocument.View object.