for(int i=0; i < tt.getChildren().size(); i++) {
UIComponent kid = (UIComponent) tt.getChildren().get(i);
if(kid instanceof Column && kid.isRendered()) {
Column column = (Column) kid;
String styleClass = column.getStyleClass() == null ? TreeTable.COLUMN_CONTENT_WRAPPER : TreeTable.COLUMN_CONTENT_WRAPPER + " " + column.getStyleClass();
String style = column.getStyle();
writer.startElement("td", null);
writer.startElement("div", null);
writer.writeAttribute("class", styleClass, null);
//icon
if(i == 0) {
String padding = "padding-left:" + (depth * 15) + "px";
style = style == null ? padding : style + ";" + padding;
writer.writeAttribute("style", style, null);
writer.startElement("span", null);
writer.writeAttribute("class", icon, null);
if(treeNode.getChildCount() == 0) {
writer.writeAttribute("style", "visibility:hidden", null);
}
writer.endElement("span");
}
else if(style != null) {
writer.writeAttribute("style", style, null);
}
//content
column.encodeAll(context);
writer.endElement("div");
writer.endElement("td");
}