com.sencha.gxt.widget.core.client.form
Class CheckBox

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.widget.core.client.cell.CellComponent<T>
                  extended by com.sencha.gxt.widget.core.client.form.Field<Boolean>
                      extended by com.sencha.gxt.widget.core.client.form.CheckBox
All Implemented Interfaces:
Editor<Boolean>, HasEditorDelegate<Boolean>, HasEditorErrors<Boolean>, LeafValueEditor<Boolean>, ValueAwareEditor<Boolean>, HasChangeHandlers, HasAttachHandlers, HasResizeHandlers, HasValueChangeHandlers<Boolean>, HasHandlers, EventListener, TakesValue<Boolean>, HasName, HasValue<Boolean>, HasVisibility, IsWidget, HasKeyProvider<Boolean>, BeforeHideEvent.HasBeforeHideHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, BeforeShowEvent.HasBeforeShowHandlers, BlurEvent.HasBlurHandlers, DisableEvent.HasDisableHandlers, EnableEvent.HasEnableHandlers, FocusEvent.HasFocusHandlers, HideEvent.HasHideHandlers, InvalidEvent.HasInvalidHandlers, MoveEvent.HasMoveHandlers, ShowContextMenuEvent.HasShowContextMenuHandler, ShowEvent.HasShowHandlers, ValidEvent.HasValidHandlers, IsField<Boolean>, HasFocusSupport, HasItemId
Direct Known Subclasses:
Radio

public class CheckBox
extends Field<Boolean>
implements HasChangeHandlers

Simple checkbox field. ValueChangeEvents are fired when the checkbox state is changed by the user, instead of waiting for a BlurEvent.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sencha.gxt.widget.core.client.form.Field
Field.FieldStyles
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
CheckBox()
          Creates a new check box.
CheckBox(CheckBoxCell cell)
          Creates a new check box.
 
Method Summary
 HandlerRegistration addChangeHandler(ChangeHandler handler)
           
 void clearInvalid()
          Clear any invalid styles / messages for this field.
 String getBoxLabel()
          Returns the box label.
 CheckBoxCell getCell()
          Get the Cell wrapped by this widget.
 void setBoxLabel(String boxLabel)
          The text that appears beside the checkbox (defaults to null).
 void setReadOnly(boolean readOnly)
          Sets the field's read only state.
 void setValue(Boolean value)
          
 
Methods inherited from class com.sencha.gxt.widget.core.client.form.Field
addInvalidHandler, addValidator, addValidHandler, addValueChangeHandler, clear, finishEditing, flush, forceInvalid, getErrorSupport, getName, getValidateOnBlur, getValidationDelay, getValidators, isAutoValidate, isEditing, isReadOnly, isValid, isValid, markInvalid, onBrowserEvent, onPropertyChange, removeValidator, reset, setAutoValidate, setDelegate, setErrorSupport, setName, setOriginalValue, setValidateOnBlur, setValidationDelay, setValue, showErrors, validate, validate
 
Methods inherited from class com.sencha.gxt.widget.core.client.cell.CellComponent
getElement, getKeyProvider, getValue, redraw, setValue
 
Methods inherited from class com.sencha.gxt.widget.core.client.Component
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disable, disableEvents, enable, enableEvents, fireEvent, focus, getData, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getStateId, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.user.client.ui.IsWidget
asWidget
 
Methods inherited from interface com.google.gwt.user.client.TakesValue
getValue
 
Methods inherited from interface com.google.gwt.user.client.ui.HasValue
getValue, setValue
 

Constructor Detail

CheckBox

public CheckBox()
Creates a new check box.


CheckBox

public CheckBox(CheckBoxCell cell)
Creates a new check box.

Parameters:
cell - the check box cell
Method Detail

addChangeHandler

public HandlerRegistration addChangeHandler(ChangeHandler handler)
Specified by:
addChangeHandler in interface HasChangeHandlers

clearInvalid

public void clearInvalid()
Description copied from class: Field
Clear any invalid styles / messages for this field.

Specified by:
clearInvalid in interface IsField<Boolean>
Overrides:
clearInvalid in class Field<Boolean>

getBoxLabel

public String getBoxLabel()
Returns the box label.

Returns:
the box label

getCell

public CheckBoxCell getCell()
Description copied from class: CellComponent
Get the Cell wrapped by this widget.

Overrides:
getCell in class Field<Boolean>
Returns:
the Cell being wrapped

setBoxLabel

public void setBoxLabel(String boxLabel)
The text that appears beside the checkbox (defaults to null).

Parameters:
boxLabel - the box label

setReadOnly

public void setReadOnly(boolean readOnly)
Description copied from class: Field
Sets the field's read only state.

Overrides:
setReadOnly in class Field<Boolean>
Parameters:
readOnly - the read only state

setValue

public void setValue(Boolean value)
Description copied from class: CellComponent

This method will redraw the widget if the new value does not equal the existing value.

Specified by:
setValue in interface ValueAwareEditor<Boolean>
Specified by:
setValue in interface TakesValue<Boolean>
Specified by:
setValue in interface HasValue<Boolean>
Overrides:
setValue in class CellComponent<Boolean>


Copyright © 2012. All Rights Reserved.