Am I trying in GWT to create a Multiple Choice Tree for nodes and have encountered a problem similar to this Shift Key question in GWT? . When the SelectionEvent element is created from a tree, I would like to know if the Shift key is pressed or not.
SelectionHandler<TreeItem> getSelectionHandler() {
return new SelectionHandler<TreeItem>(){
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
}
};
}
The solution in the question above cannot be applied in this case, since the SelectionHandler class does not inherit from DOMEvent, and then does not have the getNativeEvent () function.
I tried a dirty solution by adding keyDownEventHandler and keyUpEventHandler to a tree with a boolean flag, but handlers are only called when focus is on the tree, so this does not work.
Is there a simple solution (or just a solution, even if it is not simple)? Thank.
aem:
, FocusPanel keyUp/DownHandler, , , TextArea, "" ... .