TreePageViewModel
struct · ferroui-diagnostics · v0.5.0
struct TreePageViewModel
The page of a tree of the developer tools (the logical or the visual tree): the root nodes, the selected node and the details of its control, and the commands of the context menu of the tree.
Members
newwith_weak_main_viewclipboard_copy_requestedmain_viewproperties_filtersetters_filternodesset_nodesnodes_sourcenodes_source_refindex_path_ofselected_row_indexselected_nodeset_selected_nodedetailsdisposefind_nodeselect_controlcopy_selectorcopy_selector_from_template_parentexpand_recursivelycollapse_childrencapture_node_screenshotbring_into_viewfocusupdate_properties_view
new
fn new(main_view: &Rc<MainViewModel>, nodes: Vec<Rc<TreeNode>>, pinned_properties: Rc<RefCell<HashSet<String>>>) -> Rc<Self>
TreePageViewModel(MainViewModel mainView, TreeNode[] nodes, ISet<string> pinnedProperties).
The main view model owns its pages, so a page refers to it weakly.
pinned_properties is the set of the pinned properties that the
pages share.
with_weak_main_view
fn with_weak_main_view(main_view: Weak<MainViewModel>, nodes: Vec<Rc<TreeNode>>, pinned_properties: Rc<RefCell<HashSet<String>>>) -> Rc<Self>
The constructor with the main view model given by a weak reference, which may be empty: a page without a main view shows the implemented interfaces and takes no screenshots.
clipboard_copy_requested
fn clipboard_copy_requested(self: &Self, handler: impl Fn(&str) -> () + 'static) -> Rc<dyn IDisposable>
ClipboardCopyRequested: raised with a selector to copy to the
clipboard. Disposing the returned handle removes the handler.
main_view
fn main_view(self: &Self) -> Option<Rc<MainViewModel>>
The main view model; None once it is gone.
properties_filter
fn properties_filter(self: &Self) -> Rc<FilterViewModel>
setters_filter
fn setters_filter(self: &Self) -> Rc<FilterViewModel>
nodes
fn nodes(self: &Self) -> FerroList<Rc<TreeNode>>
The root nodes of the tree.
set_nodes
fn set_nodes(self: &Self, value: Vec<Rc<TreeNode>>)
protected set of Nodes.
nodes_source
fn nodes_source(self: &Self) -> Rc<HierarchicalTreeDataGridSource<TreeNode>>
The source of the TreeDataGrid of the page: the rows of the nodes.
nodes_source_ref
fn nodes_source_ref(self: &Self) -> TreeDataGridSourceRef
The source of the TreeDataGrid of the page, as the grid takes it.
index_path_of
fn index_path_of(self: &Self, node: &Rc<TreeNode>) -> Option<IndexPath>
The index path of the row of a node in the source: the index of each of its ancestors
among the children of its parent, from the root node down to the node; None when the
node is not in the trees of the page.
selected_row_index
fn selected_row_index(self: &Self) -> i32
The index of the row of the selected node among the rows the TreeDataGrid shows; -1
when no node is selected or its row is not shown.
selected_node
fn selected_node(self: &Self) -> Option<Rc<TreeNode>>
set_selected_node
fn set_selected_node(self: &Self, value: Option<Rc<TreeNode>>)
Selects a node, and shows the details of its object.
details
fn details(self: &Self) -> Option<Rc<ControlDetailsViewModel>>
The details of the object of the selected node.
dispose
fn dispose(self: &Self)
Dispose(): disposes the nodes and the details.
find_node
fn find_node(self: &Self, control: &Ref<Control>) -> Option<Rc<TreeNode>>
The node of control, searched in the trees of the root nodes.
select_control
fn select_control(self: &Self, control: &Ref<Control>)
Selects the node of control, or of its nearest visual ancestor that
has one, and expands its ancestors.
copy_selector
fn copy_selector(self: &Self)
Requests the copy of the selector of the selected control.
copy_selector_from_template_parent
fn copy_selector_from_template_parent(self: &Self)
Requests the copy of the selector of the selected control from the outermost templated parent, through the templates.
expand_recursively
fn expand_recursively(self: &Self)
Expands the selected node, its ancestors and all its descendants.
collapse_children
fn collapse_children(self: &Self)
Collapses the selected node and all its descendants.
capture_node_screenshot
fn capture_node_screenshot(self: &Self)
Takes a screenshot of the selected control.
bring_into_view
fn bring_into_view(self: &Self)
Brings the selected control into view.
focus
fn focus(self: &Self)
Focuses the selected control.
update_properties_view
fn update_properties_view(self: &Self)
Updates the properties of the details with the current setting of the main view (shown with the implemented interfaces when there is no main view).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyAnyValueClassDefaultsErasedDestructorIntoEitherTreeModelPartialEqINotifyPropertyChangedMarkupTyped
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.