}
}
// Render the child nodes.
ProvidesKey<C> keyProvider = nodeInfo.getProvidesKey();
TreeViewModel model = nodeView.tree.getTreeViewModel();
for (int i = start; i < end; i++) {
C value = values.get(i - start);
Object key = keyProvider.getKey(value);
boolean isOpen = openNodes.contains(key);
// Outer div contains image, value, and children (when open)
StringBuilder outerClasses = new StringBuilder(itemStyle);
if (isOpen) {
outerClasses.append(openStyle);
}
if (isRootNode) {
outerClasses.append(topStyle);
}
boolean isSelected = (selectionModel != null && selectionModel.isSelected(value));
String ariaSelected = String.valueOf(isSelected);
if (isSelected) {
outerClasses.append(selectedStyle);
}
// Inner div contains image and value
StringBuilder innerClasses = new StringBuilder(itemStyle);
innerClasses.append(itemImageValueStyle);
if (isRootNode) {
innerClasses.append(topImageValueStyle);
}
// Add the open/close icon.
SafeHtml image;
if (isOpen) {
image = openImage;
} else if (model.isLeaf(value)) {
image = LEAF_IMAGE;
} else {
image = closedImage;
}
// Render cell contents