
Untitled
By: a guest on
Apr 28th, 2012 | syntax:
None | size: 0.52 KB | hits: 19 | expires: Never
Prevent GWT Tree from closing branch with selected node
public class CustomTreeItem extends TreeItem {
@Override
public void setState(boolean open, boolean fireEvents) {
//check if we want to allow the item to close
if (!open && !mayClose()) {
return;
}
super.setState(boolean open, boolean fireEvents);
}
/**
* Returns true if the item may be closed, due to some specific rules
*/
public boolean mayClose() {
// your check goes here
}
}