}
} else {
focus();
}
}
final MouseEventDetails details = new MouseEventDetails(evt);
ScheduledCommand command = new ScheduledCommand() {
public void execute() {
// Determine if we should send the event immediately to the
// server. We do not want to send the event if there is a
// selection event happening after this. In all other cases
// we want to send it immediately.
boolean sendClickEventNow = true;
if (details.getButton() == NativeEvent.BUTTON_LEFT
&& immediate && selectable) {
// Probably a selection that will cause a value change
// event to be sent
sendClickEventNow = false;
// The exception is that user clicked on the
// currently selected row and null selection is not
// allowed == no selection event
if (isSelected() && selectedIds.size() == 1
&& !isNullSelectionAllowed) {
sendClickEventNow = true;
}
}
client.updateVariable(paintableId, "clickedKey", key, false);
client.updateVariable(paintableId, "clickEvent",
details.toString(), sendClickEventNow);
}
};
if (treeHasFocus) {
command.execute();
} else {