HierarchyView
UI element control that displays a Hierarchy.
Read time 9 minutesLast updated 10 days ago
Definition
- Type: Class
- Namespace: Unity.Hierarchy
- Assembly: UnityEngine.HierarchyModule
- Inherits from: VisualElement
- Implements: IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IDisposable
public sealed class HierarchyView : VisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IDisposable
Constructors
Constructor | Description |
|---|---|
| HierarchyView() | Creates a new instance of the HierarchyView. |
Properties
Property | Description |
|---|---|
| Filter | Gets or sets the filter used to display the Hierarchy. |
| Filtering | Whether the HierarchyView is currently filtering nodes. |
| Flattened | Gets the underlying HierarchyFlattened of this HierarchyView. |
| Source | Gets the source hierarchy used to populate the HierarchyView. Use HierarchyView.SetSourceHierarchy to change it. |
| StyleContainer | Gets the VisualElement used as the container for the styles and stylesheets of the HierarchyView. |
| UpdateNeeded | Whether the HierarchyView requires an update. |
| UpdateProgress | The current progress of the hierarchy view update. |
| Updating | Whether the HierarchyView is currently updating. |
| ViewModel | Gets the underlying HierarchyViewModel of this HierarchyView. |
Methods
Method | Description |
|---|---|
| Collapse | Collapses the specified nodes. |
| CollapseAll | Collapses all HierarchyNodes in the Hierarchy. |
| CollapseRecursive | Collapses the specified nodes and all their ancestors or descendants recursively. |
| Deselect | Clears the selection state of the specified nodes. |
| DeselectAll | Clears the current selection, making all nodes unselected. |
| DeselectRecursive | Clears the selection state of the specified nodes and all their ancestors or descendants recursively. |
| Dispose | Releases the resources used by the HierarchyView. |
| Expand | Expands the specified nodes. |
| ExpandAll | Expands all HierarchyNodes in the Hierarchy. |
| ExpandRecursive | Expands the specified nodes and all their ancestors or descendants recursively. |
| Frame | Frames the specified nodes, expanding their ancestors and scrolling to the first node. |
| GetState | Gets the current viewstate of the HierarchyView. |
| Hide | Hides the specified nodes. |
| HideAll | Hides all HierarchyNodes in the Hierarchy. |
| HideRecursive | Hides the specified nodes and all their ancestors or descendants recursively. |
| IsCollapsed | Determines if the specified node is collapsed. |
| IsExpanded | Determines if the specified node is expanded. |
| IsHidden | Determines if the specified node is hidden. |
| IsSelected | Determines if the specified node is selected. |
| IsSelectedOrAnyAncestorSelected | Determines if the specified node, or any of its ancestors, is selected. |
| IsShown | Determines if the specified node is shown. |
| Select | Selects the specified HierarchyNodes. |
| SelectAll | Selects all nodes in the hierarchy. |
| SelectRecursive | Selects the specified nodes and all their ancestors or descendants recursively. |
| SetColumnDescriptors | Creates a set of columns from a list of columns and cell descriptors. If a HierarchyViewState is passed, all the columns default order, width and visibility will be overridden by the viewState. |
| SetColumns | Creates columns according to a list of columns specification and a potential HierarchyViewState. |
| SetSelection | Sets the current selection to the specified nodes, making all other nodes unselected. |
| SetSourceHierarchy | Sets the source hierarchy used to populate the HierarchyView. |
| SetState | Updates the HierarchyView with a new ViewState. |
| Show | Shows the specified nodes. |
| ShowAll | Shows all HierarchyNodes in the Hierarchy. |
| ShowRecursive | Shows the specified nodes and all their ancestors or descendants recursively. |
| ToggleSelected | Toggles the selection state of the specified nodes. |
| ToggleSelectedRecursive | Toggles the selection state of the specified nodes and all their ancestors or descendants recursively. |
| ToggleSelection | Toggles the selection state of the current selection. |
| Update | Updates the HierarchyView displayed content. |
| UpdateIncremental | Incrementally updates the HierarchyView displayed content. |
| UpdateIncrementalTimed | Incrementally updates the HierarchyView displayed content until the time limit is reached. |
Events
Member | Description |
|---|---|
| BindViewItem | Raised when a HierarchyViewItem is bound to a HierarchyView, allowing customization of the view item. |
| FlagsChanged | Raised when flags on HierarchyNode instances are changed. |
| GetTooltip | Customize the tooltip displayed when the mouse hovers the node name label. |
| PopulateContextMenu | Raised when a right click is handled on a HierarchyNode or on the background of the view. |
| SourceHierarchyChanged | Raised when the source hierarchy changes. |
| SourceHierarchyChanging | Raised when the source hierarchy is about to change. |
| UnbindViewItem | Raised when a HierarchyViewItem is unbound from a HierarchyView, allowing cleanup of the view item. |
Delegates
Delegate | Description |
|---|---|
| HierarchyView.BindViewItemEventHandler | Delegate type used to handle the HierarchyView.BindViewItem event. |
| HierarchyView.FlagsChangedEventHandler | Delegate type used to handle the HierarchyView.FlagsChanged event. |
| HierarchyView.GetTooltipEventHandler | Delegate type used to handle the event of getting a tooltip for a HierarchyViewItem. |
| HierarchyView.PopulateContextMenuEventHandler | Delegate type used to handle HierarchyView.PopulateContextMenu event. |
| HierarchyView.SourceHierarchyChangedEventHandler | Delegate type used to handle HierarchyView.SourceHierarchyChanged event. |
| HierarchyView.SourceHierarchyChangingEventHandler | Delegate type used to handle HierarchyView.SourceHierarchyChanging event. |
| HierarchyView.UnbindViewItemEventHandler | Delegate type used to handle the HierarchyView.UnbindViewItem event. |