OutlineEditor
Maps an
Outline
into an editable text buffer.
The outline editor maintains the hoisted item, folded items, filter path, and selected items. It uses this state to determine which items are displayed and selected in the text buffer.
Finding Outline Editors
-
.getOutlineEditors() -
Retrieves all open
OutlineEditors.Return Values Returns an ArrayofOutlineEditors. -
.getOutlineEditorsForOutline(outline) -
Return
Arrayof allOutlineEditors associated with the givenOutline.Argument Description outlineEdited Outline.
Outline
-
::outline -
Outlinethat is edited.
State
-
::hoistedItem -
Root of all items displayed in the text buffer.
-
::focusedItem -
Focused item in the text buffer. Similar to
::hoistedItem, but the hoisted item is never displayed in the text buffer, while::focusedItemis displayed (and temporarily expanded) to show any children. -
::itemPathFilter -
Item path formatted
String. When set only matching items display in the text buffer.
Folding Items
-
::fold() -
Toggle folding status of current selection.
-
::isExpanded(item) -
Return true of the given item is expanded.
Argument Description itemItemto check. -
::isFiltered(item) -
Return true of the given item has some of its children visible and others hidden.
Argument Description itemItemto check. -
::isCollapsed(item) -
Return true of the given item is collapsed.
Argument Description itemItemto check. -
::setExpanded(items) -
Expand the given item(s).
Argument Description itemsItemorArrayof items to expand. -
::setCollapsed(items) -
Collapse the given item(s).
Argument Description itemsItemorArrayof items to collapse.
Displayed Items
-
::displayedItems -
::firstDisplayedItem -
First displayed
Itemin editor (readonly). -
::lastDisplayedItem -
Last displayed
Itemin editor (readonly). -
::isDisplayed(item) -
Determine if an
Itemis displayed in the editor’s text buffer. A displayed item isn’t neccessarily visible because it might be scrolled off screen. Displayed means that its body text is present and editable in the buffer.Argument Description itemItemto test.Return Values Returns Booleanindicating if item is displayed. -
::forceDisplayed(item, showAncestors?) -
Force the given
Itemto display in the editor’s text buffer, expanding ancestors, removing filters, and unhoisting items as needed.Argument Description itemItemto make displayed.showAncestors?Booleandefaults to false. -
::forceHidden(item, hideDescendants?) -
Remove the given
Item(s) from display in the editor’s text buffer, leaving all other items in place.Argument Description itemItem(s) to hide.hideDescendants?Booleandefaults to false. -
::getNextDisplayedItem(item) -
Argument Description itemItemReturn Values Returns next displayed Itemrelative to given item. -
::getPreviousDisplayedItem(item) -
Argument Description itemItemReturn Values Returns previous displayed Itemrelative to given item.
Text Buffer
-
::textLength -
Read-only text buffer
Numberlength. -
::getItemOffsetForLocation(location) -
Translate from a text buffer location to an
Itemoffset.Argument Description locationText buffer character Numberlocation.Return Values Returns Objectwithitemandoffsetproperties. -
::getLocationForItemOffset(item, offset) -
Translate from item offset to the nearest valid text buffer location.
Argument Description itemItemto lookup.offsetNumberoffset into the items text.Return Values Returns text buffer character offset Number. -
::getTextInRange(location, length) -
Get text in the given range.
Argument Description locationNumbercharacter location.lengthNumbercharacter range length. -
::replaceRangeWithString(location, length, string) -
Replace the given range with a string.
Argument Description locationNumbercharacter location.lengthNumbercharacter range length.stringStringto insert. -
::replaceRangeWithItems(location, length, items) -
Replace the given range with a items.
Argument Description locationNumbercharacter location.lengthNumbercharacter range length.itemsArrayofItems to insert.
Selection
-
::selection -
Read-only
Selectionsnapshot. -
::moveSelectionToRange(focusLocation, anchorLocation?) -
Set selection by character locations in text buffer.
Argument Description focusLocationSelection focus character Numberlocation.anchorLocation?Selection anchor character Numberlocation. -
::moveSelectionToItems(headItem, headOffset?, anchorItem?, anchorOffset?) -
Set selection by
Item.Argument Description headItemSelection head ItemheadOffset?Selection head offset index. Or undefinedwhen selecting at item level.anchorItem?Selection anchor ItemanchorOffset?Selection anchor offset index. Or undefinedwhen selecting at item level.
Scrolling
-
::scrollBy(xDelta, yDelta) -
Adjust
::scrollPointby the given delta.Argument Description xDeltaNumberscroll point x delta.yDeltaNumberscroll point y delta. -
::scrollRangeToVisible(location, length) -
Scroll the given range to visible in the text buffer.
Argument Description locationNumbercharacter location.lengthNumbercharacter range length. -
::getRectForRange(location, length) -
Get rectangle for the given character range.
Argument Description locationNumbercharacter location.lengthNumbercharacter range length.Return Values Returns Objectwithx,y,width, andheightkeys. -
::getCharacterIndexForPoint(x, y) -
Get character index for the given point.
Argument Description xNumberx position.yNumbery position.Return Values Returns Numbercharacter index.
Item Serialization
-
::serializeRange(location, length, options) -
Get item serialization from the given range.
Argument Description locationNumbercharacter location.lengthNumbercharacter range length.optionsSerialization options as defined in ItemSerializer.