Reputation: 77
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?
Upvotes: 3
Views: 1078