Theia API Documentation v1.65.0
    Preparing search index...

    The tree - an abstract data type.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _viewMode: "tree" | "list" = 'list'
    expansionService: TreeExpansionService
    focusService: TreeFocusService
    logger: ILogger
    navigationService: TreeNavigationService
    onChangedEmitter: Emitter<void>
    onOpenNodeEmitter: Emitter<TreeNode>
    provider: undefined | ScmProvider
    scmService: ScmService
    selectionService: TreeSelectionService
    toDisposeOnRepositoryChange: DisposableCollection = ...
    tree: Tree
    treeSearch: TreeSearch

    Accessors

    • get onChanged(): Event<void>

      Emit when the tree is changed.

      Returns Event<void>

    • get onDidChangeBusy(): Event<TreeNode>

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

      Returns Event<TreeNode>

    • get onDidUpdate(): Event<TreeNode[]>

      An update to the tree node occurred, but the tree structure remains unchanged

      Returns Event<TreeNode[]>

    • get onExpansionChanged(): Event<Readonly<ExpandableTreeNode>>

      Emit when the node is expanded or collapsed.

      Returns Event<Readonly<ExpandableTreeNode>>

    • get onOpenNode(): Event<TreeNode>

      Event when a node should be opened.

      Returns Event<TreeNode>

    • get onSelectionChanged(): Event<readonly Readonly<SelectableTreeNode>[]>

      Emitted when the selection has changed in the tree.

      Returns Event<readonly Readonly<SelectableTreeNode>[]>

    • get root(): undefined | TreeNode

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

      Returns undefined | TreeNode

    • set root(root: undefined | TreeNode): void

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

      Parameters

      Returns void

    • get selectedNodes(): readonly Readonly<SelectableTreeNode>[]

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

      Returns readonly Readonly<SelectableTreeNode>[]

    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

    • Tests whether it is possible to navigate backward.

      Returns boolean

    • Tests whether it is possible to navigate forward.

      Returns boolean

    • Clears all selected nodes

      Returns 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 this object.

      Returns void

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

      Parameters

      Returns Promise<undefined | ExpandableTreeNode>

    • Normally the group would always be expected to be found. However if the tree is restored in restoreState then the tree may be rendered before the groups have been created in the provider. The provider's groups property will be empty in such a situation. We want to render the tree (as that is the point of restoreState, we can render the tree in the saved state before the provider has provided status). We therefore must be prepared to render the tree without having the ScmResourceGroup or ScmResource objects.

      Parameters

      • groupId: string

      Returns undefined | ScmResourceGroup

    • Returns void

    • Returns the next tree node, regardless of its selection or visibility state.

      Parameters

      Returns undefined | TreeNode

    • Return a node for the given identifier or undefined if such does not exist.

      Parameters

      • id: undefined | string

      Returns undefined | TreeNode

    • Returns the previous tree node, regardless of its selection or visibility state.

      Parameters

      Returns undefined | TreeNode

    • Marks the give node as busy after a specified number of milliseconds. A token source of the given token should be canceled to unmark.

      Parameters

      Returns Promise<void>

    • Parameters

      Returns void

    • Navigates backward.

      Returns Promise<void>

    • Navigates forward.

      Returns Promise<void>

    • 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

      Returns Promise<undefined | TreeNode>

    • Opens the given node or the currently selected on if the argument is undefined. If multiple nodes are selected, open the most recently selected node.

      Parameters

      Returns void

    • Selects the next tree node, regardless of its selection or visibility state.

      Returns void

    • Selects the next node relatively to the currently selected one. This method takes the expansion state of the tree into consideration.

      Parameters

      Returns void

    • Selects the given tree node. Has no effect when the node does not exist in the tree. Discards any previous selection state.

      Parameters

      Returns void

    • Selects the parent node relatively to the selected taking into account node expansion.

      Returns void

    • Selects the previous tree node, regardless of its selection or visibility state.

      Returns void

    • Selects the previous node relatively to the currently selected one. This method takes the expansion state of the tree into consideration.

      Parameters

      Returns void

    • Selects a range of tree nodes. The target of the selection range is the argument, the from tree node is the previous selected node. If no node was selected previously, invoking this method does nothing.

      Parameters

      Returns void

    • Selects the given node if it was not yet selected, or unselects it if it was. Keeps the previous selection state and updates it with the current toggle selection.

      Parameters

      Returns void

    • 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>

    • Return a valid node in this tree matching to the given; otherwise undefined.

      Parameters

      Returns undefined | TreeNode