ResponseWriter responseWriter = facesContext.getResponseWriter();
TreeCellComponent treeCellComponent = (TreeCellComponent) component;
IconProvider iconProvider = treeCellComponent.getIconProvider();
LabelProvider labelProvider = treeCellComponent.getLabelProvider();
responseWriter.startElement("treecell", component);
treeCellComponent.setNodeId(computeId(treeCellComponent));
responseWriter.writeAttribute("id", treeCellComponent.getNodeId(), "id");
String var = treeCellComponent.getVar();
Object userObject = facesContext.getExternalContext().getSessionMap().get(var);
if ( (treeCellComponent.getAttributes().get("label") != null) || (labelProvider != null)){
// Deal with label
String label = null;
if (labelProvider != null) {
label = labelProvider.getText(userObject, TreeRowComponent.CLOSED);
treeCellComponent.setLabel(label);
} else {
Object value = convertAsString(facesContext, component, getProperty(facesContext, "label", component));
if (value != null) {
label = value.toString();