pub struct TreeViewState<NodeIdType>{ /* private fields */ }Expand description
Represents the state of the tree view.
This holds which node is selected and the open/close state of the directories.
Implementations§
Source§impl<NodeIdType> TreeViewState<NodeIdType>
impl<NodeIdType> TreeViewState<NodeIdType>
Sourcepub fn load(ui: &mut Ui, id: Id) -> Option<TreeViewState<NodeIdType>>
pub fn load(ui: &mut Ui, id: Id) -> Option<TreeViewState<NodeIdType>>
Load a TreeViewState from memory.
Sourcepub fn store(self, ui: &mut Ui, id: Id)
pub fn store(self, ui: &mut Ui, id: Id)
Store this TreeViewState to memory.
Source§impl<NodeIdType> TreeViewState<NodeIdType>where
NodeIdType: NodeId,
impl<NodeIdType> TreeViewState<NodeIdType>where
NodeIdType: NodeId,
Sourcepub fn set_selected(&mut self, selected: Vec<NodeIdType>)
pub fn set_selected(&mut self, selected: Vec<NodeIdType>)
Set which nodes are selected in the tree
Sourcepub fn set_one_selected(&mut self, selected: NodeIdType)
pub fn set_one_selected(&mut self, selected: NodeIdType)
Set a single node to be selected.
Sourcepub fn expand_parents_of(&mut self, _id: &NodeIdType)
pub fn expand_parents_of(&mut self, _id: &NodeIdType)
Expand all parent nodes of the node with the given id.
Sourcepub fn expand_node(&mut self, _id: &NodeIdType)
pub fn expand_node(&mut self, _id: &NodeIdType)
Expand the node and all its parent nodes. Effectively this makes the node visible in the tree.
Sourcepub fn set_openness(&mut self, id: NodeIdType, open: bool)
pub fn set_openness(&mut self, id: NodeIdType, open: bool)
Set the openness state of a node.
Sourcepub fn is_open(&self, id: &NodeIdType) -> Option<bool>
pub fn is_open(&self, id: &NodeIdType) -> Option<bool>
Get the open state of the node.
If this node is unknown to the tree view this will return None.
If the node is known to the tree view but still uses its default value
this method will also return None.
Sourcepub fn parent_id_of(&self, _id: &NodeIdType) -> Option<&NodeIdType>
👎Deprecated: The TreeViewState no longer carries this information. Refer to your own data source
pub fn parent_id_of(&self, _id: &NodeIdType) -> Option<&NodeIdType>
The TreeViewState no longer carries this information. Refer to your own data source
Get the parent id of a node.
Trait Implementations§
Source§impl<NodeIdType> Clone for TreeViewState<NodeIdType>
impl<NodeIdType> Clone for TreeViewState<NodeIdType>
Source§fn clone(&self) -> TreeViewState<NodeIdType>
fn clone(&self) -> TreeViewState<NodeIdType>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more