litesoft
@ 942
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
package org.litesoft.mgwt.client.widgets; import org.litesoft.GWT.client.widgets.*; import org.litesoft.commonfoundation.annotations.*; import org.litesoft.commonfoundation.html.*; import org.litesoft.commonfoundation.typeutils.*; import com.google.gwt.dom.client.*; import com.google.gwt.editor.client.*; import com.google.gwt.event.logical.shared.*; import com.google.gwt.event.shared.*; import com.google.gwt.user.client.*; import com.google.gwt.user.client.ui.*; import com.googlecode.mgwt.ui.client.*; import com.googlecode.mgwt.ui.client.theme.base.*; import com.googlecode.mgwt.ui.client.widget.*; /** * */ public class MLabeledCheckBox extends Composite implements HasText, HasValue<Boolean>, IsEditor<LeafValueEditor<Boolean>> { private final LabelElement labelElement = LabelElement.as( DOM.createLabel() ); private final MCheckBox mCheckBox; private String mText; public MLabeledCheckBox( @Nullable String pText, @NotNull CheckBoxCss pCheckBoxCss, @NotNull InputCss pInputCss ) { SpanPanel zPanel = new SpanPanel(); zPanel.add( labelElement ); zPanel.add( mCheckBox = new MCheckBox( pCheckBoxCss ) ); initWidget( zPanel ); addStyleName( pInputCss.radioButton() ); setText( pText ); } public MLabeledCheckBox( @Nullable String pText ) { this( pText, MGWTStyle.getTheme().getMGWTClientBundle().getCheckBoxCss(), MGWTStyle.getTheme().getMGWTClientBundle().getInputCss() ); } @Override public String getText() { return mText; } @Override public void setText( @Nullable String pText ) { labelElement.setInnerHTML( HTMLize.escapeNoWrap( Strings.noEmpty( mText = pText, " " ) ) ); } @Override public Boolean getValue() { return mCheckBox.getValue(); } @Override public void setValue( Boolean value ) { mCheckBox.setValue( value ); } @Override public void setValue( Boolean value, boolean fireEvents ) { mCheckBox.setValue( value, fireEvents ); } @Override public HandlerRegistration addValueChangeHandler( ValueChangeHandler<Boolean> handler ) { return mCheckBox.addValueChangeHandler( handler ); } @Override public LeafValueEditor<Boolean> asEditor() { return mCheckBox.asEditor(); } } |
Commits for litesoft/trunk/mobileGWT/mgwtPlus/src/org/litesoft/mgwt/client/widgets/MLabeledCheckBox.java
Revision | Author | Commited | Message |
---|---|---|---|
942 Diff | GeorgeS | Mon 02 Jun, 2014 23:41:46 +0000 | Extracting commonfoundation |
939 Diff | GeorgeS | Mon 02 Jun, 2014 21:30:31 +0000 | Extracting commonfoundation |
801 Diff | GeorgeS | Wed 15 Aug, 2012 03:59:02 +0000 | |
764 Diff | GeorgeS | Thu 12 Jul, 2012 14:22:25 +0000 | |
751 | GeorgeS | Sat 07 Jul, 2012 18:21:49 +0000 |