com.smartgwt.client.widgets.form.fields
Class CheckboxItem

java.lang.Object
  extended by com.smartgwt.client.core.JsObject
      extended by com.smartgwt.client.core.DataClass
          extended by com.smartgwt.client.core.RefDataClass
              extended by com.smartgwt.client.widgets.form.fields.FormItem
                  extended by com.smartgwt.client.widgets.form.fields.CheckboxItem
All Implemented Interfaces:
HasHandlers, HasBlurHandlers, HasChangedHandlers, HasChangeHandlers, HasClickHandlers, HasDoubleClickHandlers, HasEditorEnterHandlers, HasEditorExitHandlers, HasFocusHandlers, HasIconClickHandlers, HasIconKeyPressHandlers, HasItemHoverHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasPickerIconClickHandlers, HasTitleClickHandlers, HasTitleDoubleClickHandlers, HasTitleHoverHandlers

public class CheckboxItem
extends FormItem

Checkbox form item, implemented with customizable checkbox images


Field Summary
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
CheckboxItem()
           
CheckboxItem(JavaScriptObject jsObj)
           
CheckboxItem(String name)
           
CheckboxItem(String name, String title)
           
 
Method Summary
 Boolean getAllowEmptyValue()
          By default checkboxes allow the user to toggle between true and false values only.
 String getCheckedImage()
          URL for the image to display when this checkbox is selected, or checked.
 Boolean getLabelAsTitle()
          By default a checkboxItem sets showTitle:true, and so takes up two cells with the default TitleOrientation of "left" (see form layout overview).
static CheckboxItem getOrCreateRef(JavaScriptObject jsObj)
           
 String getPartialSelectedImage()
          URL for the image to display when this checkbox is partially selected
 Boolean getShowLabel()
          Should we show the label text next to the checkbox item.
 Boolean getShowTitle()
          CheckboxItem has special behavior for titles, see labelAsTitle.
 Boolean getShowValueIconDisabled()
          Should a "Disabled" state icon be shown when the item is disabled
 Boolean getShowValueIconDown()
          Should a "Down" state icon be shown when the mouse goes down over this checkbox
 Boolean getShowValueIconOver()
          Should an "Over" state icon be shown when the user rolls over this checkbox
 String getTextBoxStyle()
          Base CSS class for this item's title text
 String getTitleStyle()
          Base CSS class for this item's title cell.
 String getUncheckedImage()
          URL for the image to display when this checkbox is not selected, or unchecked
 String getUnsetImage()
          URL for the image to display when this checkbox is unset.
 Boolean getValueAsBoolean()
          Return the value of the checkbox as a boolean
 void setAllowEmptyValue(Boolean allowEmptyValue)
          By default checkboxes allow the user to toggle between true and false values only.
 void setCheckedImage(String checkedImage)
          URL for the image to display when this checkbox is selected, or checked.
 void setJavaScriptObject(JavaScriptObject jsObj)
           
 void setLabelAsTitle(Boolean labelAsTitle)
          By default a checkboxItem sets showTitle:true, and so takes up two cells with the default TitleOrientation of "left" (see form layout overview).
 void setPartialSelectedImage(String partialSelectedImage)
          URL for the image to display when this checkbox is partially selected
 void setShowLabel(Boolean showLabel)
          Should we show the label text next to the checkbox item.
 void setShowTitle(Boolean showTitle)
          CheckboxItem has special behavior for titles, see labelAsTitle.
 void setShowUnsetImage(Boolean showUnsetImage)
          Determines what image to display when the value for this checkbox is unset.
 void setShowValueIconDisabled(Boolean showValueIconDisabled)
          Should a "Disabled" state icon be shown when the item is disabled
 void setShowValueIconDown(Boolean showValueIconDown)
          Should a "Down" state icon be shown when the mouse goes down over this checkbox
 void setShowValueIconOver(Boolean showValueIconOver)
          Should an "Over" state icon be shown when the user rolls over this checkbox
 void setTextBoxStyle(String textBoxStyle)
          Base CSS class for this item's title text
 void setTitleStyle(String titleStyle)
          Base CSS class for this item's title cell.
 void setUncheckedImage(String uncheckedImage)
          URL for the image to display when this checkbox is not selected, or unchecked
 void setUnsetImage(String unsetImage)
          URL for the image to display when this checkbox is unset.
 
Methods inherited from class com.smartgwt.client.widgets.form.fields.FormItem
_getValue, addBlurHandler, addChangedHandler, addChangeHandler, addClickHandler, addDoubleClickHandler, addEditorEnterHandler, addEditorExitHandler, addFocusHandler, addIconClickHandler, addIconKeyPressHandler, addItemHoverHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addPickerIconClickHandler, addTitleClickHandler, addTitleDoubleClickHandler, addTitleHoverHandler, blurItem, canEditCriterion, clearValue, convertToFormItemArray, disable, enable, focusInItem, getAccessKey, getAlign, getAllowExpressions, getAlwaysFetchMissingValues, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsString, getBrowserSpellCheck, getCanEdit, getCanFocus, getCellHeight, getCellStyle, getClassName, getConfig, getContainerWidget, getCriteriaField, getCriterion, getCriterion, getDataPath, getDateFormatter, getDecimalPad, getDecimalPrecision, getDefaultIconSrc, getDisabled, getDisableIconsOnReadOnly, getDisplayField, getDisplayFieldName, getDisplayValue, getDisplayValue, getEditorTypeConfig, getEditPendingCSSText, getEmptyDisplayValue, getEmptyValueIcon, getEndRow, getErrorIconHeight, getErrorIconSrc, getErrorIconWidth, getErrorMessageWidth, getFetchMissingValues, getFieldName, getFilterLocally, getForm, getFullDataPath, getGlobalTabIndex, getHeight, getHint, getHintStyle, getHoverAlign, getHoverDelay, getHoverHeight, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getIcon, getIconHeight, getIconPageRect, getIconPrompt, getIconRect, getIconVAlign, getIconWidth, getImageURLPrefix, getImageURLSuffix, getImplicitSave, getImplicitSaveOnBlur, getInputFormat, getLeft, getLocateItemBy, getMultipleValueSeparator, getName, getOperator, getOptionCriteria, getOptionFilterContext, getOptionOperationId, getPageLeft, getPageRect, getPageTop, getPickerIconHeight, getPickerIconName, getPickerIconPrompt, getPickerIconSrc, getPickerIconWidth, getPrintTextBoxStyle, getPrintTitleStyle, getPrompt, getRect, getRedrawOnChange, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRowSpan, getSaveOnEnter, getSelectedRecord, getSelectOnFocus, getShouldSaveValue, getShowDisabled, getShowErrorIcon, getShowErrorStyle, getShowErrorText, getShowFocused, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowOverIcons, getShowPickerIcon, getShowValueIconOnly, getStartRow, getStopOnError, getSuppressValueIcon, getSynchronousValidation, getTabIndex, getTextAlign, getTimeFormatter, getTitle, getTitleAlign, getTitleColSpan, getTitleOrientation, getTitleVAlign, getTooltip, getTop, getType, getValidateOnChange, getValidateOnExit, getValidOperators, getVAlign, getValue, getValueField, getValueFieldName, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getVisible, getVisibleHeight, getVisibleWidth, getWidth, getWrapTitle, hasAdvancedCriteria, hide, hideIcon, invalidateDisplayValueCache, isCreated, isDisabled, isDrawn, isVisible, redraw, setAccessKey, setAlign, setAllowExpressions, setAlwaysFetchMissingValues, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setBrowserSpellCheck, setCanEdit, setCanEditCriterionPredicate, setCanFocus, setCellHeight, setCellStyle, setColSpan, setColSpan, setCriteriaField, setCriterion, setCriterionGetter, setCriterionSetter, setDataPath, setDateFormatter, setDecimalPad, setDecimalPrecision, setDefaultIconSrc, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDisabled, setDisableIconsOnReadOnly, setDisplayField, setDisplayFormat, setDisplayFormat, setEditorType, setEditorValueFormatter, setEditorValueParser, setEditPendingCSSText, setEmptyDisplayValue, setEmptyValueIcon, setEndRow, setErrorFormatter, setErrorIconHeight, setErrorIconSrc, setErrorIconWidth, setErrorMessageWidth, setErrorOrientation, setFetchMissingValues, setFilterLocally, setGlobalTabIndex, setHeight, setHeight, setHint, setHintStyle, setHoverAlign, setHoverDelay, setHoverHeight, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setIconHeight, setIconPrompt, setIcons, setIconVAlign, setIconWidth, setImageURLPrefix, setImageURLSuffix, setImplicitSave, setImplicitSaveOnBlur, setInitHandler, setInputFormat, setInputTransformer, setItemHoverFormatter, setItemTitleHoverFormatter, setLeft, setLocateItemBy, setMultipleValueSeparator, setName, setOperator, setOptionCriteria, setOptionDataSource, setOptionFilterContext, setOptionOperationId, setPickerIconHeight, setPickerIconName, setPickerIconPrompt, setPickerIconSrc, setPickerIconWidth, setPrintTextBoxStyle, setPrintTitleStyle, setPrompt, setProperty, setProperty, setProperty, setProperty, setProperty, setRedrawOnChange, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRowSpan, setSaveOnEnter, setSelectOnFocus, setShouldSaveValue, setShowDisabled, setShowErrorIcon, setShowErrorStyle, setShowErrorText, setShowFocused, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIfCondition, setShowOverIcons, setShowPickerIcon, setShowValueIconOnly, setStartRow, setStopOnError, setSuppressValueIcon, setSynchronousValidation, setTabIndex, setTextAlign, setTimeFormatter, setTitle, setTitleAlign, setTitleColSpan, setTitleOrientation, setTitleVAlign, setTooltip, setTop, setType, setValidateOnChange, setValidateOnExit, setValidators, setValidOperators, setVAlign, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueField, setValueFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconMapper, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setWidth, setWidth, setWrapTitle, shouldFetchMissingValue, shouldSaveOnEnter, show, showIcon, showPicker, stopHover, updateState, validate
 
Methods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef
 
Methods inherited from class com.smartgwt.client.core.DataClass
doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute
 
Methods inherited from class com.smartgwt.client.core.JsObject
setJsObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

CheckboxItem

public CheckboxItem()

CheckboxItem

public CheckboxItem(JavaScriptObject jsObj)

CheckboxItem

public CheckboxItem(String name)

CheckboxItem

public CheckboxItem(String name,
                    String title)
Method Detail

getOrCreateRef

public static CheckboxItem getOrCreateRef(JavaScriptObject jsObj)

setJavaScriptObject

public void setJavaScriptObject(JavaScriptObject jsObj)
Overrides:
setJavaScriptObject in class FormItem

setAllowEmptyValue

public void setAllowEmptyValue(Boolean allowEmptyValue)
By default checkboxes allow the user to toggle between true and false values only. Setting this property to true will allow the user to toggle between three values - true, false and unset.

Parameters:
allowEmptyValue - allowEmptyValue Default value is false

getAllowEmptyValue

public Boolean getAllowEmptyValue()
By default checkboxes allow the user to toggle between true and false values only. Setting this property to true will allow the user to toggle between three values - true, false and unset.

Returns:
Boolean

setCheckedImage

public void setCheckedImage(String checkedImage)
URL for the image to display when this checkbox is selected, or checked.

This image is implemented using the valueIcons subsystem, and may be modified via the standard valueIcons properties such as valueIconWidth

Note that this is the base image name - if showValueIconOver et al are set, the state ("Over", "Down" and "Disabled") will be added to this name as the user interacts with the checkbox, as well as the ".gif" extension

Parameters:
checkedImage - . See SCImgURL. Default value is "[SKIN]/DynamicForm/checked.gif"
See Also:
Appearance overview and related methods

getCheckedImage

public String getCheckedImage()
URL for the image to display when this checkbox is selected, or checked.

This image is implemented using the valueIcons subsystem, and may be modified via the standard valueIcons properties such as valueIconWidth

Note that this is the base image name - if showValueIconOver et al are set, the state ("Over", "Down" and "Disabled") will be added to this name as the user interacts with the checkbox, as well as the ".gif" extension

Returns:
. See SCImgURL
See Also:
Appearance overview and related methods

setLabelAsTitle

public void setLabelAsTitle(Boolean labelAsTitle)
By default a checkboxItem sets showTitle:true, and so takes up two cells with the default TitleOrientation of "left" (see form layout overview). However, the title cell is left blank by default, and the title specified by title is shown inside the formItem's cell instead, in an element called the "label".

To instead show the title in it's original location, set labelAsTitle:true. You can also set showLabel:false to suppress the label and/or title altogether.

Parameters:
labelAsTitle - labelAsTitle Default value is null

getLabelAsTitle

public Boolean getLabelAsTitle()
By default a checkboxItem sets showTitle:true, and so takes up two cells with the default TitleOrientation of "left" (see form layout overview). However, the title cell is left blank by default, and the title specified by title is shown inside the formItem's cell instead, in an element called the "label".

To instead show the title in it's original location, set labelAsTitle:true. You can also set showLabel:false to suppress the label and/or title altogether.

Returns:
Boolean

setPartialSelectedImage

public void setPartialSelectedImage(String partialSelectedImage)
URL for the image to display when this checkbox is partially selected

Parameters:
partialSelectedImage - . See SCImgURL. Default value is "[SKIN]/DynamicForm/partialcheck.gif"
See Also:
Appearance overview and related methods

getPartialSelectedImage

public String getPartialSelectedImage()
URL for the image to display when this checkbox is partially selected

Returns:
. See SCImgURL
See Also:
Appearance overview and related methods

setShowLabel

public void setShowLabel(Boolean showLabel)
Should we show the label text next to the checkbox item.

Parameters:
showLabel - showLabel Default value is true

getShowLabel

public Boolean getShowLabel()
Should we show the label text next to the checkbox item.

Returns:
Boolean

setShowTitle

public void setShowTitle(Boolean showTitle)
CheckboxItem has special behavior for titles, see labelAsTitle.

Overrides:
setShowTitle in class FormItem
Parameters:
showTitle - showTitle Default value is true

getShowTitle

public Boolean getShowTitle()
CheckboxItem has special behavior for titles, see labelAsTitle.

Overrides:
getShowTitle in class FormItem
Returns:
Boolean

setShowValueIconDisabled

public void setShowValueIconDisabled(Boolean showValueIconDisabled)
Should a "Disabled" state icon be shown when the item is disabled

Note : This is an advanced setting

Parameters:
showValueIconDisabled - showValueIconDisabled Default value is true

getShowValueIconDisabled

public Boolean getShowValueIconDisabled()
Should a "Disabled" state icon be shown when the item is disabled

Returns:
Boolean

setShowValueIconDown

public void setShowValueIconDown(Boolean showValueIconDown)
Should a "Down" state icon be shown when the mouse goes down over this checkbox

Note : This is an advanced setting

Parameters:
showValueIconDown - showValueIconDown Default value is true

getShowValueIconDown

public Boolean getShowValueIconDown()
Should a "Down" state icon be shown when the mouse goes down over this checkbox

Returns:
Boolean

setShowValueIconOver

public void setShowValueIconOver(Boolean showValueIconOver)
Should an "Over" state icon be shown when the user rolls over this checkbox

Note : This is an advanced setting

Parameters:
showValueIconOver - showValueIconOver Default value is true

getShowValueIconOver

public Boolean getShowValueIconOver()
Should an "Over" state icon be shown when the user rolls over this checkbox

Returns:
Boolean

setTextBoxStyle

public void setTextBoxStyle(String textBoxStyle)
Base CSS class for this item's title text

Overrides:
setTextBoxStyle in class FormItem
Parameters:
textBoxStyle - . See FormItemBaseStyle. Default value is "labelAnchor"
See Also:
Appearance overview and related methods

getTextBoxStyle

public String getTextBoxStyle()
Base CSS class for this item's title text

Overrides:
getTextBoxStyle in class FormItem
Returns:
. See FormItemBaseStyle
See Also:
Appearance overview and related methods

setTitleStyle

public void setTitleStyle(String titleStyle)
Base CSS class for this item's title cell.

Note: This styling applies to the standard form item title cell for this item - it does not apply to item's label. To modify the styling for that text, use textBoxStyle instead.

Overrides:
setTitleStyle in class FormItem
Parameters:
titleStyle - . See FormItemBaseStyle. Default value is null
See Also:
Appearance overview and related methods

getTitleStyle

public String getTitleStyle()
Base CSS class for this item's title cell.

Note: This styling applies to the standard form item title cell for this item - it does not apply to item's label. To modify the styling for that text, use textBoxStyle instead.

Overrides:
getTitleStyle in class FormItem
Returns:
. See FormItemBaseStyle
See Also:
Appearance overview and related methods

setUncheckedImage

public void setUncheckedImage(String uncheckedImage)
URL for the image to display when this checkbox is not selected, or unchecked

Parameters:
uncheckedImage - . See SCImgURL. Default value is "[SKIN]/DynamicForm/unchecked.gif"
See Also:
Appearance overview and related methods

getUncheckedImage

public String getUncheckedImage()
URL for the image to display when this checkbox is not selected, or unchecked

Returns:
. See SCImgURL
See Also:
Appearance overview and related methods

setUnsetImage

public void setUnsetImage(String unsetImage)
URL for the image to display when this checkbox is unset. Note that if showUnsetImage is false or allowEmptyValue is false the uncheckedImage will be used for null values rather than this image.

Parameters:
unsetImage - . See SCImgURL. Default value is "[SKIN]/DynamicForm/unsetcheck.gif"
See Also:
Appearance overview and related methods

getUnsetImage

public String getUnsetImage()
URL for the image to display when this checkbox is unset. Note that if showUnsetImage is false or allowEmptyValue is false the uncheckedImage will be used for null values rather than this image.

Returns:
. See SCImgURL
See Also:
Appearance overview and related methods

setShowUnsetImage

public void setShowUnsetImage(Boolean showUnsetImage)
Determines what image to display when the value for this checkbox is unset. Set to true to display the unsetImage for null values, or false to use the uncheckedImage for both null and explicitly unchecked values.

If this attribute is not set, the unsetImage for null values if allowEmptyValue is true for this item, otherwise the unchecked image will be used.

Parameters:
showUnsetImage - showUnsetImage Default value is IRA

getValueAsBoolean

public Boolean getValueAsBoolean()
Return the value of the checkbox as a boolean

Returns:
the checbox value as Boolean