*/
@Override
public void render(Treeitem ti, Object node) {
final MaterialCategory materialCategory = (MaterialCategory) node;
Label lblName = new Label(materialCategory.getName());
Label lblUnits = new Label(getUnits(materialCategory).toString());
Label lblPrice = new Label(getPrice(materialCategory).toString()
+ getCurrencySymbol());
Treerow tr = null;
ti.setValue(node);
if (ti.getTreerow() == null) {
tr = new Treerow();
tr.setParent(ti);
ti.setOpen(true); // Expand node
} else {
tr = ti.getTreerow();
tr.getChildren().clear();
}
// Add category name
Treecell cellName = new Treecell();
lblName.setParent(cellName);
cellName.setParent(tr);
// Add total assigned material units in category
Treecell cellUnits = new Treecell();
lblUnits.setParent(cellUnits);
cellUnits.setParent(tr);
// Add total price for assigned materials in category
Treecell cellPrice = new Treecell();
lblPrice.setParent(cellPrice);
cellPrice.setParent(tr);
}