public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException
{
RendererUtils.checkParamValidity(facesContext, component, HtmlTree.class);
ResponseWriter writer = facesContext.getResponseWriter();
HtmlTree tree = (HtmlTree) component;
HtmlRendererUtils.writePrettyLineSeparator(facesContext);
writer.startElement(HTML.TABLE_ELEM, component);
HtmlRendererUtils.renderHTMLAttributes(writer, tree, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
writer.writeAttribute(HTML.BORDER_ATTR, ZERO, null);
writer.writeAttribute(HTML.CELLSPACING_ATTR, ZERO, null);
writer.writeAttribute(HTML.CELLPADDING_ATTR, ZERO, null);
int maxLevel = tree.getRootNode().getMaxChildLevel();
// Create initial children list from root node facet
ArrayList childNodes = new ArrayList(1);
childNodes.add(tree.getRootNode());
// Render header.
renderFacet(facesContext, writer, component, true, maxLevel);
// Render children.
renderChildren(facesContext, writer, tree, childNodes, maxLevel, tree.getIconProvider(), component);
// Render footer.
renderFacet(facesContext, writer, component, false, maxLevel);
writer.endElement(HTML.TABLE_ELEM);
}