int imageWidth = nodeView.tree.getImageWidth();
int paddingLeft = imageWidth * nodeView.depth;
// Render the child nodes.
ProvidesKey<C> providesKey = nodeInfo.getProvidesKey();
TreeViewModel model = nodeView.tree.getTreeViewModel();
for (C value : values) {
Object key = providesKey.getKey(value);
boolean isOpen = savedViews.containsKey(key);
// Outer div contains image, value, and children (when open).
sb.append("<div>");
// The selection pads the content based on the depth.
sb.append("<div style='padding-left:");
sb.append(paddingLeft);
sb.append("px;' class='").append(itemStyle);
if (isOpen) {
sb.append(" ").append(openStyle);
}
if (isRootNode) {
sb.append(" ").append(topStyle);
}
if (selectionModel != null && selectionModel.isSelected(value)) {
sb.append(" ").append(selectedStyle);
}
sb.append("'>");
// Inner div contains image and value.
sb.append("<div onclick='' style='position:relative;padding-left:");
sb.append(imageWidth);
sb.append("px;' class='").append(itemImageValueStyle);
if (isRootNode) {
sb.append(" ").append(topImageValueStyle);
}
sb.append("'>");
// Add the open/close icon.
if (isOpen) {
sb.append(openImage);
} else if (model.isLeaf(value)) {
sb.append(LEAF_IMAGE);
} else {
sb.append(closedImage);
}