class documentation

class ACMEResourceTree(TextualTree):

Constructor: ACMEResourceTree(*args, **kwargs)

View In Hierarchy

The Resources tree conmponent view for the ACME text UI.

Method __init__ Initialize the view.
Method on_show Handle the show event.
Method on_tree_node_expanded Handle the expanded event.
Method on_tree_node_highlighted Handle the highlighted event.
Method on_tree_node_hover Handle the hover event.
Method refreshCurrentNode Refresh the current node.
Method refreshCurrentParrentNode Refresh the parent node of the current node.
Method refreshNode Refresh a node.
Class Variable dispatcher Injected Dispatcher instance.
Instance Variable auto_expand Whether to auto expand the tree. Inherited from TextualTree.
Instance Variable parentContainer The parent container of the tree view.
Method _buildNodeChildren Build the children of a node.
Method _retrieve_resource_children Retrieve the children of a resource and return a sorted list of tuples.
Method _update_content Update the resource view.
Method _update_tree Update the tree view.
Method _update_type_section Update the resource view with a type section.
Class Variable _virtualResourcesParameter Dictionary of virtual resources and their parameters.
Instance Variable _app The application.
def __init__(self, *args: Any, **kwargs: Any):

Initialize the view.

Parameters
*args:AnyArguments.
**kwargs:AnyKeyword arguments.
def on_show(self):

Handle the show event.

def on_tree_node_expanded(self, node: TextualTree.NodeSelected):

Handle the expanded event.

Parameters
node:TextualTree.NodeSelectedThe expanded node.
def on_tree_node_highlighted(self, node: TextualTree.NodeHighlighted):

Handle the highlighted event.

Parameters
node:TextualTree.NodeHighlightedThe highlighted node.
def on_tree_node_hover(self, event: events.MouseMove):

Handle the hover event.

Parameters
event:events.MouseMoveThe hover event.
def refreshCurrentNode(self):

Refresh the current node.

def refreshCurrentParrentNode(self):

Refresh the parent node of the current node.

def refreshNode(self, node: TreeNode):

Refresh a node.

Parameters
node:TreeNodeThe node to refresh.
dispatcher: Dispatcher =

Injected Dispatcher instance.

auto_expand: bool =

Whether to auto expand the tree. Inherited from TextualTree.

parentContainer =

The parent container of the tree view.

def _buildNodeChildren(self, node: TreeNode):

Build the children of a node.

Parameters
node:TreeNodeThe node to build the children for.
def _retrieve_resource_children(self, ri: str) -> list[tuple[Resource, bool]]:

Retrieve the children of a resource and return a sorted list of tuples.

Each tuple contains a resource and a boolean indicating if the resource has children itself.

Sort order is: virtual and instance resources first, then by type and name.

Parameters
ri:strThe resource id of the parent resource.
Returns
list[tuple[Resource, bool]]A sorted list of tuples (resource, hasChildren).
def _update_content(self, ri: str):

Update the resource view.

Parameters
ri:strThe resource id of the content.
def _update_tree(self):

Update the tree view.

def _update_type_section(self, label: str):

Update the resource view with a type section.

Parameters
label:strThe label of the type section.
_virtualResourcesParameter =

Dictionary of virtual resources and their parameters.

_app =

The application.