TreeNode
Every item on our Tree is a TreeNode, and you can use the default one or create your own custom tree node if needed.
To create a Default Tree Node
Once it created it will be at level 0 with no children and no parent.
Maybe in some cases you want to create a custom TreeNode, all you need is to create a class that extend it and add your own functions and variables, please check the log example for practical example.
public class CustomTreeNode extends TreeNode {
public CustomTreeNode(Object value, int layoutId) {
super(message, layoutId);
}
}
TreeNode has many method to set and get values
To add new child
Change the value
Get the current value
Get the node parent
To make the node expanded or collapsed
Check if it expanded
Check if it selected or not
Get the node level