* configure the grid that contains the tree received.
* @param tree
* @return TreeGrid
*/
private TreeGrid createTreeGridThemes(final Tree tree) {
final TreeGrid treeGrid = new TreeGrid();
treeGrid.setHeight100();
treeGrid.setWidth100();
//create the fields of the TreeGrid.
TreeGridField field = new TreeGridField("Name", constants.name());
field.setIcon("edit.png");
field.setCanSort(false);
field.setShowAlternateStyle(true);
TreeGridField nameField = new TreeGridField("nodeInfo", constants.description());
nameField.setIcon("descripcion.jpg");
nameField.setShowAlternateStyle(true);
/*
TreeGridField priorityField = new TreeGridField("priority", constants.priority());
priorityField.setIcon("priority.jpg");
priorityField.setWidth("12%");
priorityField.setShowAlternateStyle(true);
*/
TreeGridField initialEstimationField = new TreeGridField("initialEstimation",constants.initialEstimation());
initialEstimationField.setWidth("12%");
initialEstimationField.setIcon("clock.jpg");
initialEstimationField.setShowAlternateStyle(true);
TreeGridField currentEstimationField = new TreeGridField("currentEstimation",constants.currentEstimation());
currentEstimationField.setWidth("12%");
currentEstimationField.setIcon("clock.jpg");
currentEstimationField.setShowAlternateStyle(true);
/*
TreeGridField stateField = new TreeGridField("state",constants.state());
stateField.setWidth("12%");
stateField.setIcon("state.jpg");
stateField.setShowAlternateStyle(true);
*/
//treeGrid.setFields(field, priorityField, initialEstimationField, currentEstimationField, stateField, nameField);
treeGrid.setFields(field, initialEstimationField, currentEstimationField, nameField);
treeGrid.addDrawHandler(new DrawHandler() {
@Override
public void onDraw(DrawEvent event) {
tree.openAll();
}
});
treeGrid.setSortField("Name");
treeGrid.markForRedraw();
//add the fields to the treeGrid.
treeGrid.setData(tree);
//start the handlers.
handlersTreeGridThemes(treeGrid, tree);
return treeGrid;
}