Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TreeModel

Hierarchy

Index

Properties

onChanged: Event<void>

Emit when the tree is changed.

onDidChangeBusy: Event<TreeNode>

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

onExpansionChanged: Event<Readonly<ExpandableTreeNode>>

Emit when the node is expanded or collapsed.

onNodeRefreshed: Event<Readonly<CompositeTreeNode> & WaitUntilEvent>

Emit when the children of the given node are refreshed.

onOpenNode: Event<Readonly<TreeNode>>

Event when a node should be opened.

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

Emitted when the selection has changed in the tree.

root: undefined | TreeNode

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

selectedNodes: readonly Readonly<SelectableTreeNode>[]

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

Methods

  • 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(): boolean
  • canNavigateForward(): boolean
  • clearSelection(): void
  • 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>

  • 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(): void
  • getNode(id: undefined | string): undefined | TreeNode
  • navigateBackward(): Promise<void>
  • navigateForward(): Promise<void>
  • 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(node?: Readonly<TreeNode>): void
  • restoreState(state: object): void
  • selectParent(): void
  • storeState(): object
  • 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>