d the tree model, by default the root node is not rendered. // This can be changed by calling setRootNodeDisplayed(true); TreeNode root = new TreeNode("c:"); TreeNode dev = new TreeNode("dev", "1", root); new TreeNode("java.pdf", "2", dev); new TreeNode("ruby.pdf", "3", dev); TreeNode programFiles = new TreeNode("program files", "4", root); TreeNode adobe = new TreeNode("Adobe", "5", programFiles); // This node is a directory not a file, so setChildrenSupported to true. adobe.setChildrenSupported(true); TreeNode download = new TreeNode("downloads", "6", root); TreeNode web = new TreeNode("web", "7", download); new TreeNode("html.pdf", "8", web); new TreeNode("css.html", "9", web); TreeNode databases = new TreeNode("databases", "10", download); new TreeNode("mysql.html", "11", databases); new TreeNode("oracle.pdf", "12", databases); new TreeNode("postgres", "13", databases); tree.setRootNode(root); return tree; } }
CSS and JavaScript resources
In addition to
Tree's resources, the CheckboxTree control makes use of the following resources (which Click automatically deploys to the application directory,
/click/tree):
- click/tree/checkbox-tree.js
To import these Tree files simply reference the variables
$headElements and
$jsElements in the page template.
@see Tree