Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


BaseTreeView

Base class for a tree view, a vertically scrollable area that links to, and displays, a list of items organized in a tree.
Read time 10 minutesLast updated 5 days ago

Definition

public abstract class BaseTreeView : BaseVerticalCollectionView, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IBindable, ISerializationCallbackReceiver

Remarks

For the difference between IDs and indices, refer to BaseVerticalCollectionView.

Static Fields

Value

Description

itemContentContainerUssClassNameThe USS class name for TreeView item container elements.
itemIndentUssClassNameThe USS class name for TreeView indent element.
itemToggleUssClassNameThe USS class name for TreeView item toggle elements.
itemUssClassNameThe USS class name for TreeView item elements.
ussClassNameThe USS class name for TreeView elements.

Constructors

Constructor

Description

BaseTreeView()Creates a TreeView with all default properties.
BaseTreeView(System.Int32)Creates a TreeView with specified factory methods using the fixed height virtualization method.

Properties

Property

Description

autoExpandWhen true, items are automatically expanded when added to the TreeView.
itemsSourceAccess to the itemsSource. For a TreeView, the source contains the items wrappers.
viewControllerThe view controller for this view, cast as a BaseTreeViewController.

Methods

Method

Description

AddItemAdds an item to the existing tree.
AddToSelectionByIdAdds an item to the current selection by id.
CollapseAllCollapses all TreeView items, including children.
CollapseItemCollapses the specified TreeView item.
ExpandAllExpands all TreeView items, including children.
ExpandItemExpands the specified TreeView item.
ExpandRootItemsExpands all root TreeView items.
GetChildrenIdsForIndexGets children identifiers for the specified TreeView item.
GetIdForIndexGets the specified TreeView item's identifier.
GetItemDataForIdGets data for the specified TreeView item id.
GetItemDataForIndexGets data for the specified TreeView item index.
GetParentIdForIndexGets the specified TreeView item's parent identifier.
GetRootIdsGets the root item identifiers.
GetSelectedItemsGets tree data for the selected item indices.
GetTreeCountGets the TreeView's total number of items.
IsExpandedReturns true if the specified TreeView item is expanded, false otherwise.
RemoveFromSelectionByIdRemoves an item from the current selection by id.
SetRootItemsSets the root items to use with the default tree view controller.
SetSelectionByIdSets a collection of selected items by ids.
SetSelectionByIdWithoutNotifySets a collection of selected items by id, without triggering a selection change callback.
SetViewControllerAssigns the view controller for this view and registers all events required for it to function properly.
TryRemoveItemRemoves an item of the tree if it can find it.

Events

Member

Description

itemExpandedChangedRaised when an item is expanded or collapsed.

Inheritance

Inherited Members