HoopsViewTreeElement

class wvc.HoopsViewTreeElement()

Provides a tree view for displaying and managing saved views and view configurations.

This component displays a hierarchical tree of saved views including standard views, annotation views, and combined state views. It supports lazy loading for better performance with large view sets and provides selection and navigation capabilities.

Constructors

wvc.HoopsViewTreeElement.constructor()
HoopsViewTreeElement(): HoopsViewTreeElement

Returns: HoopsViewTreeElement

Properties

wvc.HoopsViewTreeElement.styles

static

styles: CSSResult[]

Array of styles to apply to the element. The styles should be defined using the ? tag function, via constructible stylesheets, or imported from native CSS module scripts.

Note on Content Security Policy:

Element styles are implemented with <style> tags when the browser doesn’t support adopted StyleSheets. To use such <style> tags with the style-src CSP directive, the style-src value must either include ‘unsafe-inline’ or nonce-<base64-value> with <base64-value> replaced be a server-generated nonce.

To provide a nonce to use on generated <style> elements, set window.litNonce to a server-generated nonce in your page’s HTML, before loading application code:

<script>
  // Generated and unique per request:
  window.litNonce = 'a1b2c3d4';
</script>

Accessors

wvc.HoopsViewTreeElement.model()
get model(): (undefined | IModel)

The IModel interface that represents the Model.

This is a syntactic sugar to access HoopsViewTree.viewAdapter.model. If the ViewAdapter is not set it returns an undefined.

Reassigning the model will trigger an update.

Trying to set the model while the viewAdapter is not set would result in an error being thrown.

This should not happen in a normal use case since the viewAdapter is added to the view tree at initialization.

Returns: (undefined | IModel)

The current model instance or undefined
set model(model: (undefined | IModel)): void

Sets the model instance for view data. Setting a new model will refresh the tree view.

Parameters

model: (undefined | IModel)

The model instance to set

Returns: void

wvc.HoopsViewTreeElement.selected()
get selected(): number[]

Gets the currently selected view nodes.

Returns: number[]

Array of selected node IDs
set selected(value: number[]): void

Sets the currently selected view nodes.

Parameters

value: number[]

Array of node IDs to select

Returns: void

wvc.HoopsViewTreeElement.treeElement()
get treeElement(): (undefined | Tree)

Gets the internal tree component element. Provides access to the underlying tree functionality.

Returns: (undefined | Tree)

The tree element instance or undefined if not initialized
wvc.HoopsViewTreeElement.viewAdapter()
get viewAdapter(): (undefined | ViewAdapter)

Gets the view adapter that manages tree data and operations.

Returns: (undefined | ViewAdapter)

The current view adapter or undefined
set viewAdapter(value: ViewAdapter): void

Sets the view adapter that manages tree data and operations. The adapter handles communication between the tree component and the model.

Parameters

value: ViewAdapter

The view adapter to set

Returns: void

Methods

wvc.HoopsViewTreeElement.getNodeData()
getNodeData(nodeId: number): T

Retrieves custom data associated with a view node.

Parameters

nodeId: number

The ID of the node to get data from

Returns: T

The custom data stored for the node
wvc.HoopsViewTreeElement.selectNodes()
selectNodes(nodeIds: number[], selected: boolean): void

Selects or deselects view nodes in the tree.

Parameters

nodeIds: number[]

Array of node IDs to select or deselect

selected: boolean

Whether to select (true) or deselect (false) the nodes

Returns: void

wvc.HoopsViewTreeElement.setNodeData()
setNodeData(nodeId: number, data: unknown): void

Sets custom data for a view node, replacing any existing data.

Parameters

nodeId: number

The ID of the node to store data for

data: unknown

The data to store with the node

Returns: void

wvc.HoopsViewTreeElement.updateNodeData()
updateNodeData(nodeId: number, data: unknown): void

Merges custom data into a view node’s existing data. Arrays are concatenated, objects are merged, other types replace existing data.

Parameters

nodeId: number

The ID of the node to update data for

data: unknown

The data to merge with existing node data

Returns: void