Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TreeView<T>

Represents a Tree view

Type Parameters

  • T

Hierarchy

Index

Properties

badge: undefined | ViewBadge

The badge to display for this TreeView. To remove the badge, set to undefined.

description?: string

An optional human-readable subheading that will be rendered next to the main title. Setting the description to null, undefined, or empty string will remove the message from the view.

message?: string

An optional human-readable message that will be rendered in the view. Setting the message to null, undefined, or empty string will remove the message from the view.

onDidChangeSelection: Event<TreeViewSelectionChangeEvent<T>>

Event that is fired when the selection has changed

onDidChangeVisibility: Event<TreeViewVisibilityChangeEvent>

Event that is fired when visibility has changed

onDidCollapseElement: Event<TreeViewExpansionEvent<T>>

Event that is fired when an element is collapsed

onDidExpandElement: Event<TreeViewExpansionEvent<T>>

Event that is fired when an element is expanded

selection: readonly T[]

Currently selected elements.

title?: string

The tree view title is initially taken from the extension package.json Changes to the title property will be properly reflected in the UI in the title of the view.

visible: boolean

true if the tree view is visible otherwise false.

Methods

  • dispose(): void
  • reveal(element: T, options?: { expand?: number | boolean; focus?: boolean; select?: boolean }): Thenable<void>
  • Reveal an element. By default revealed element is selected.

    In order to not to select, set the option select to false.

    NOTE: TreeDataProvider is required to implement getParent method to access this API.

    Parameters

    • element: T
    • Optional options: { expand?: number | boolean; focus?: boolean; select?: boolean }
      • Optional expand?: number | boolean
      • Optional focus?: boolean
      • Optional select?: boolean

    Returns Thenable<void>