int columnClassesCount = columnClassesArray.length;
int columnClassIndex = 0;
for (Iterator it = children.iterator(); it.hasNext();)
{
HtmlTreeNode child = (HtmlTreeNode) it.next();
if (!child.isRendered())
{
continue;
}
HtmlRendererUtils.writePrettyLineSeparator(facesContext);
writer.startElement(HTML.TR_ELEM, component);
if (rowClassIndex < rowClassesCount)
{
writer.writeAttribute(HTML.CLASS_ATTR, rowClassesArray[rowClassIndex], null);
}
if (rowClassesCount > 0)
{
rowClassIndex++;
rowClassIndex = rowClassIndex % rowClassesCount;
}
if (null != tree.getVar())
{
facesContext.getExternalContext().getSessionMap().put(tree.getVar(),
((TreeNode) child.getUserObject()).getUserObject());
}
List componentChildren = tree.getChildren();
if ((null != componentChildren) && (componentChildren.size() > 0))
{
for (int j = 0, size = tree.getChildCount(); j < size; j++)
{
UIComponent componentChild = (UIComponent) componentChildren.get(j);
if ((componentChild.getFamily().equals(UIColumn.COMPONENT_FAMILY))
&& ((UIColumn) componentChild).isRendered())
{
writer.startElement(HTML.TD_ELEM, tree);
if (columnClassIndex < columnClassesCount)
{
writer.writeAttribute(HTML.CLASS_ATTR, columnClassesArray[columnClassIndex], null);
}
if (columnClassesCount > 0)
{
columnClassIndex++;
columnClassIndex = columnClassIndex % columnClassesCount;
}
RendererUtils.renderChild(facesContext, componentChild);
writer.endElement(HTML.TD_ELEM);
}
else if ((componentChild.getFamily().equals(HtmlTreeColumn.COMPONENT_FAMILY))
&& ((HtmlTreeColumn) componentChild).isRendered())
{
renderTreeColumnChild(facesContext, writer, componentChild, tree, child, maxLevel, iconProvider);
}
}
}
else
{
renderTreeColumnChild(facesContext, writer, null, tree, child, maxLevel, iconProvider);
}
writer.endElement(HTML.TR_ELEM);
if (child.getChildCount() > 0)
{
renderChildren(facesContext, writer, tree, child.getChildren(), maxLevel, iconProvider, rowClassIndex, component);
if (rowClassesCount > 0)
{
rowClassIndex += (child.getChildCount() % rowClassesCount);
rowClassIndex = rowClassIndex % rowClassesCount;
}
}
}
}