TreeDataProvider
A TreeDataProvider
interface should be implemented by objects that provide data to a TreeView.
The elements provided as data objects by a TreeDataProvider
may be any valid JavaScript object.
interface TreeDataProvider {
getChildren(element);
getParent(element);
getTreeItem(element);
}
Methods
getChildren(element)
Returns an array of children for an element (or a Promise
that resolves to it). The element
will be null
for the root of the tree.
getParent(element)
Returns the parent of an element. This is an optional method used for the TreeView
reveal()
API.
getTreeItem(element)
Returns the TreeItem representation of an element.