MenuTree tree = (MenuTree) source;
// unique ID used for DOM component identification
String compPrefix = renderer.getComponentPrefix(tree);
INode selNode = tree.getSelectedNode();
TreeNode root = tree.getTreeModel().getRootNode();
if (root == null) return; // tree is completely empty
if (tree.isExpandServerOnly()) {
// render only the expanded path using no javascript
List selPath = new ArrayList(5);
INode cur = selNode;
if (cur == null) cur = root;
// if no selection, select the first node to
// expand the children
// add all elems from selected path to reversed list -> first elem is
// selected nodeid of the root node
while (cur != null) {
selPath.add(0, cur);
cur = cur.getParent();
}
target.append("\n<div class=\"b_tree\">");
target.append("<ul class=\"b_tree_l0\">");
renderLevel(target, 0, root, selPath, ubu, renderer.getGlobalSettings().getAjaxFlags(), compPrefix, tree.markingTreeNode);
target.append("</ul>");