final Textbox tb = new Textbox(materialCategory.getName());
tb.setWidth("90%");
tb.addEventListener("onChange", new EventListener() {
@Override
public void onEvent(Event event) {
final InputEvent ie = (InputEvent) event;
materialCategory.setName(ie.getValue());
}
});
tb.addEventListener("onFocus", new EventListener() {
@Override
public void onEvent(Event event) {
((Treeitem)tb.getParent().getParent().getParent()).setSelected(true);
refreshMaterials();
}
});
Treecell tc = new Treecell();
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();
}
tb.setParent(tc);
tc.setParent(tr);
final Textbox codeTb = new Textbox(materialCategory.getCode());
codeTb.setWidth("95%");
codeTb.setDisabled(materialCategory.isCodeAutogenerated());
codeTb.addEventListener("onChange", new EventListener() {
@Override
public void onEvent(Event event) {
final InputEvent ie = (InputEvent) event;
materialCategory.setCode(ie.getValue());
}
});
codeTb.addEventListener("onFocus", new EventListener() {
@Override
public void onEvent(Event event) {