/** * Build children objects for the requested node type. If the node is an attribute then do * nothing. Listeners will be added to the root item but not the children. This is to prevent odd * mixups if the children have listeners but have not yet had their children built. The viewable * tree would get very mixed up then * * @param root The root object to add children for */ private void buildChildren(ToolGroupTreeNode root) { ToolGroupChild toolItem = root.getToolObject(); if (toolItem instanceof ToolGroup) { ToolGroup tg = (ToolGroup) toolItem; List<ToolGroupChild> kids = tg.getChildren(); for (int i = 0; i < kids.size(); i++) { ToolGroupChild child = kids.get(i); ToolGroupTreeNode kid = new ToolGroupTreeNode(child, root); root.insert(kid, i); } } }