ValueUpdater<Boolean> valueUpdater) {
String type = event.getType();
boolean enterPressed = "keydown".equals( type ) && event.getKeyCode() == KeyCodes.KEY_ENTER;
if ( "change".equals( type ) || enterPressed ) {
InputElement input = parent.getFirstChild().cast();
Boolean isChecked = input.isChecked();
/*
* Toggle the value if the enter key was pressed and the cell handles
* selection or doesn't depend on selection. If the cell depends on
* selection but doesn't handle selection, then ignore the enter key and
* let the SelectionEventManager determine which keys will trigger a
* change.
*/
if ( enterPressed ) {
isChecked = !isChecked;
input.setChecked( isChecked );
}
/*
* Save the new value. However, if the cell depends on the selection, then
* do not save the value because we can get into an inconsistent state.