I wish that it would turn around TreeItem when you click on it and not on the “+”.
I added the following code:
Tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
event.getSelectedItem().setState(!event.getSelectedItem().getState());
}
});
TreeItem expand but not collapsed, because onSelection activated twice.
What could be the reason for this?
There is an issue in GWT issue tracker:
http://code.google.com/p/google-web-toolkit/issues/detail?id=3660&q=Tree%20selection&colspec=ID%20Type%20Status%20Owner%20Milestone%20Summary%20Stars