Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TreeModel

Hierarchy

Index

Properties

Readonly onChanged

onChanged: Event<void>

Emit when the tree is changed.

Readonly onDidChangeBusy

onDidChangeBusy: Event<TreeNode>

Emits when the busy state of the given node is changed.

Readonly onExpansionChanged

onExpansionChanged: Event<Readonly<ExpandableTreeNode>>

Emit when the node is expanded or collapsed.

Readonly onNodeRefreshed

onNodeRefreshed: Event<Readonly<CompositeTreeNode> & WaitUntilEvent>

Emit when the children of the given node are refreshed.

Readonly onOpenNode

onOpenNode: Event<Readonly<TreeNode>>

Event when a node should be opened.

Readonly onSelectionChanged

onSelectionChanged: Event<readonly Readonly<SelectableTreeNode>[]>

Emitted when the selection has changed in the tree.

root

root: undefined | TreeNode

A root node of this tree. Undefined if there is no root node. Setting a root node refreshes the tree.

Readonly selectedNodes

selectedNodes: readonly Readonly<SelectableTreeNode>[]

The tree selection, representing the selected nodes from the tree. If nothing is selected, the result will be empty.

Methods

addSelection

  • Registers the given selection into the tree selection service. If the selection state changes after adding the selectionOrTreeNode argument, a selection changed event will be fired. If the argument is a tree node, a it will be treated as a tree selection with the default selection type.

    Parameters

    Returns void

canNavigateBackward

  • canNavigateBackward(): boolean

canNavigateForward

  • canNavigateForward(): boolean

collapseAll

  • Collapses recursively. If the node argument is undefined, then collapses the currently selected tree node. If multiple tree nodes are selected, collapses the most recently selected tree node.

    Parameters

    Returns Promise<boolean>

collapseNode

  • Collapses the given node. If the node argument is undefined, then collapses the currently selected tree node. If multiple tree nodes are selected, collapses the most recently selected tree node.

    Parameters

    Returns Promise<boolean>

dispose

  • dispose(): void

expandNode

getNextSelectableNode

getNode

  • getNode(id: undefined | string): undefined | TreeNode

getPrevSelectableNode

markAsBusy

navigateBackward

  • navigateBackward(): Promise<void>

navigateForward

  • navigateForward(): Promise<void>

navigateTo

  • navigateTo(nodeOrId: undefined | string | Readonly<TreeNode>): Promise<undefined | TreeNode>
  • Navigates to the given node if it is defined. This method accepts both the tree node and its ID as an argument. Navigation sets a node as a root node and expand it. Resolves to the node if the navigation was successful. Otherwise, resolves to undefined.

    Parameters

    • nodeOrId: undefined | string | Readonly<TreeNode>

    Returns Promise<undefined | TreeNode>

openNode

  • openNode(node?: Readonly<TreeNode>): void

refresh

restoreState

  • restoreState(state: object): void

selectNextNode

selectNode

selectParent

  • selectParent(): void

selectPrevNode

selectRange

storeState

  • storeState(): object

toggleNode

toggleNodeExpansion

  • Toggles the expansion state of the given node. If not give, then it toggles the expansion state of the currently selected node. If multiple nodes are selected, then the most recently selected tree node's expansion state will be toggled.

    Parameters

    Returns Promise<void>

validateNode