Subversion Repository Public Repository

litesoft

Diff Revisions 947 vs 948 for /trunk/GWT_Sandbox/FormEngine/src/com/temp/client/foundation/widget/input/support/CheckBoxValueAdapter.java

Diff revisions: vs.
  @@ -1,42 +1,40 @@
1 1 package com.temp.client.foundation.widget.input.support;
2 2
3 - import com.google.gwt.event.dom.client.ChangeHandler;
4 - import com.google.gwt.event.logical.shared.ValueChangeEvent;
5 - import com.google.gwt.event.logical.shared.ValueChangeHandler;
6 - import com.google.gwt.event.shared.HandlerRegistration;
7 - import com.google.gwt.user.client.ui.CheckBox;
8 - import com.temp.client.foundation.widget.input.fieldsupport.InputWidgetValueAdapter;
9 - import com.temp.client.foundation.widget.input.support.events.NonDomChangeEvent;
10 - import com.temp.shared.utils.ObjectUtils;
11 - import com.temp.shared.utils.Validate;
3 + import com.google.gwt.event.dom.client.*;
4 + import com.google.gwt.event.logical.shared.*;
5 + import com.google.gwt.event.shared.*;
6 + import com.google.gwt.user.client.ui.*;
7 + import com.temp.client.foundation.widget.input.fieldsupport.*;
8 + import com.temp.client.foundation.widget.input.support.events.*;
9 + import com.temp.shared.utils.*;
12 10
13 11 public class CheckBoxValueAdapter implements InputWidgetValueAdapter<Boolean> {
14 12
15 13 private final CheckBox inputWidget;
16 14
17 - private final NonDomChangeEvent changeEvent = new NonDomChangeEvent(this);
15 + private final NonDomChangeEvent changeEvent = new NonDomChangeEvent( this );
18 16
19 17 public CheckBoxValueAdapter( CheckBox inputWidget ) {
20 - Validate.notNull("inputWidget", this.inputWidget = inputWidget);
18 + Validate.notNull( "inputWidget", this.inputWidget = inputWidget );
21 19 }
22 20
23 21 @Override
24 - public HandlerRegistration addChangeHandler(final ChangeHandler handler) {
25 - return inputWidget.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
22 + public HandlerRegistration addChangeHandler( final ChangeHandler handler ) {
23 + return inputWidget.addValueChangeHandler( new ValueChangeHandler<Boolean>() {
26 24 @Override
27 - public void onValueChange(ValueChangeEvent<Boolean> booleanValueChangeEvent) {
28 - changeEvent.dispatch(handler);
25 + public void onValueChange( ValueChangeEvent<Boolean> booleanValueChangeEvent ) {
26 + changeEvent.dispatch( handler );
29 27 }
30 - });
28 + } );
31 29 }
32 30
33 31 @Override
34 32 public Boolean getValue() {
35 - return ObjectUtils.deNull(inputWidget.getValue(), Boolean.FALSE);
33 + return ObjectUtils.deNull( inputWidget.getValue(), Boolean.FALSE );
36 34 }
37 35
38 36 @Override
39 - public void setValue(Boolean value) {
40 - inputWidget.setValue(ObjectUtils.deNull(value, Boolean.FALSE));
37 + public void setValue( Boolean value ) {
38 + inputWidget.setValue( ObjectUtils.deNull( value, Boolean.FALSE ) );
41 39 }
42 40 }