Version: Unity 6.0 (6000.0)
LanguageEnglish
  • C#

BaseTreeView

class in UnityEngine.UIElements

/

Inherits from:UIElements.BaseVerticalCollectionView

/

Implemented in:UnityEngine.UIElementsModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Base class for a tree view, a vertically scrollable area that links to, and displays, a list of items organized in a tree.

Static Properties

Description
itemContentContainerUssClassName The USS class name for TreeView item container elements.
itemIndentUssClassName The USS class name for TreeView indent element.
itemToggleUssClassName The USS class name for TreeView item toggle elements.
itemUssClassName The USS class name for TreeView item elements.
ussClassName The USS class name for TreeView elements.

Properties

Description
autoExpand When true, items are automatically expanded when added to the TreeView.
itemsSource Access to the itemsSource. For a TreeView, the source contains the items wrappers.
viewController The view controller for this view, cast as a BaseTreeViewController.

Constructors

Description
BaseTreeView Creates a TreeView with all default properties.

Public Methods

Description
AddItem Adds an item to the existing tree.
AddToSelectionById Adds an item to the current selection by id.
CollapseAll Collapses all TreeView items, including children.
CollapseItem Collapses the specified TreeView item.
ExpandAll Expands all TreeView items, including children.
ExpandItem Expands the specified TreeView item.
ExpandRootItems Expands all root TreeView items.
GetChildrenIdsForIndex Gets children identifiers for the specified TreeView item.
GetIdForIndex Gets the specified TreeView item's identifier.
GetItemDataForId Gets data for the specified TreeView item id.
GetItemDataForIndex Gets data for the specified TreeView item index.
GetParentIdForIndex Gets the specified TreeView item's parent identifier.
GetRootIds Gets the root item identifiers.
GetSelectedItems Gets tree data for the selected item indices.
GetTreeCount Gets the TreeView's total number of items.
IsExpanded Returns true if the specified TreeView item is expanded, false otherwise.
RemoveFromSelectionById Removes an item from the current selection by id.
SetRootItems Sets the root items to use with the default tree view controller.
SetSelectionById Sets the currently selected item by id.
SetSelectionByIdWithoutNotify Sets a collection of selected items by id, without triggering a selection change callback.
SetViewController Assigns the view controller for this view and registers all events required for it to function properly.
TryRemoveItem Removes an item of the tree if it can find it.

Events

Description
itemExpandedChanged Raised when an item is expanded or collapsed.

Inherited Members

Static Properties

Description
borderUssClassName The USS class name for BaseVerticalCollectionView elements with a border.
dragHoverBarUssClassName The USS class name of the drag hover bar.
dragHoverMarkerUssClassName The USS class name of the drag hover circular marker used to indicate depth.
itemAlternativeBackgroundUssClassName The USS class name for odd rows in the BaseVerticalCollectionView.
itemDragHoverUssClassName The USS class name applied to an item element on drag hover.
itemSelectedVariantUssClassName The USS class name of selected item elements in the BaseVerticalCollectionView.