TreeControl Items property editor
Use the TreeControl Items property editor to populate a TreeControl with string objects.
To display this property editor, double-click the items property in the Inspector when a TreeControl component is selected in the Component Tree. The cursor is positioned in the edit field for the root node of the tree.
Populate the TreeControl as follows:
- To create the root node of the tree, press the Add Child button, enter the string value for the root, and press Enter.
- To add a child node to the root, select the root node, then click the Add Child button. Enter the string vaue for the child node, then press Enter.
- To add more nodes to the tree, select the node to which you want to add a child, click the Add Child button, and enter the string value.
- To change a node string value, double-click the node and edit the string value.
- To remove a node from the TreeControl, select the node and click the Remove button.
- When you finish populating the tree, press OK to close the property editor.
You can add objects to the TreeControl that are not string items. However, this must be done programmatically. For example, if you created a class you wanted to add, you would do something similar to the following in the code:
GraphLocation root = tree.setRoot(new MyClass1("root boy"));
tree.addChild(root, new MyClass1("Child girl"));
Add Child
Adds nodes to the tree. If the node is the first added to the tree, it is the "root node." All subsequently added nodes are "child nodes."
Remove
Removes the currently selected node from the tree. If you remove a node with children, all child nodes as well as the selected node are removed.