public class CmsCheckBox extends com.google.gwt.user.client.ui.Composite implements com.google.gwt.event.dom.client.HasClickHandlers, I_CmsFormWidget, I_CmsHasInit, com.google.gwt.user.client.ui.HasHorizontalAlignment, com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.Boolean>
It can be checked/unchecked and enabled/disabled, which means 4 combinations in total. So you need to supply 4 images, one for each of the combinations.
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabledI_CmsFormWidget.FieldType| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
WIDGET_TYPE
Type string for this widget.
|
| 构造器和说明 |
|---|
CmsCheckBox()
Default constructor which creates a checkbox without a label.
|
CmsCheckBox(java.lang.String labelText)
Public constructor for a checkbox.
|
| 限定符和类型 | 方法和说明 |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
Adds a click handler to the checkbox.
|
com.google.gwt.event.shared.HandlerRegistration |
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.Boolean> handler) |
void |
disable(java.lang.String disabledReason)
Disables the checkbox and changes the checkbox title attribute to the disabled reason.
|
void |
enable()
Enables the checkbox, switching the checkbox title attribute from the disabled reason to the original title.
|
protected void |
fireValueChangedEvent()
Helper method for firing a 'value changed' event.
|
java.lang.String |
getApparentValue()
Returns the "apparent value", i.e. either the real value if available, or else the ghost value if available, or null otherwise.
|
CmsToggleButton |
getButton()
Gets the toggle button used internally.
|
I_CmsFormWidget.FieldType |
getFieldType()
Returns the type of data this widget produces.
|
java.lang.Boolean |
getFormValue()
Gets the selected/entered value from the widget.
|
java.lang.String |
getFormValueAsString()
Gets the current value of the widget as a string.
|
com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant |
getHorizontalAlignment()
This is the alignment of the text in reference to the checkbox, possible values are left or right.
|
java.lang.String |
getInternalValue()
Returns the internal value of this Checkbox.
|
java.lang.String |
getText()
Returns the text.
|
static void |
initClass()
Initializes this class.
|
boolean |
isChecked()
Returns true if the checkbox is checked.
|
boolean |
isEnabled()
Returns true if the checkbox is enabled.
|
void |
reset()
Resets the widget to its default state.
|
void |
setAutoHideParent(I_CmsAutoHider autoHideParent)
Call this when auto hiding parents are shown.
|
void |
setChecked(boolean checked)
Checks or unchecks the checkbox.
|
void |
setEnabled(boolean enabled)
Enables or disables the checkbox.
|
void |
setErrorMessage(java.lang.String errorMessage)
Sets the error message for this widget.
|
void |
setFormValue(java.lang.Object value)
Sets the value of the widget.
|
void |
setFormValueAsString(java.lang.String value)
Sets the current value of the widget as a string.
|
void |
setHorizontalAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant align)
This is the alignment of the text in reference to the checkbox, possible values are left or right.
|
void |
setInternalValue(java.lang.String value)
Sets the internal value of this Checkbox.
|
void |
setText(java.lang.String text)
Sets the text.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEventspublic static final java.lang.String WIDGET_TYPE
public CmsCheckBox()
public CmsCheckBox(java.lang.String labelText)
The label text passed will be displayed to the right of the checkbox. If it is null, no label is displayed.
labelText - the label textpublic static void initClass()
public com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
addClickHandler 在接口中 com.google.gwt.event.dom.client.HasClickHandlersHasClickHandlers.addClickHandler(com.google.gwt.event.dom.client.ClickHandler)public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.Boolean> handler)
addValueChangeHandler 在接口中 com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.Boolean>HasValueChangeHandlers.addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)public void disable(java.lang.String disabledReason)
disabledReason - the disabled reasonpublic void enable()
public java.lang.String getApparentValue()
I_CmsFormWidgetgetApparentValue 在接口中 I_CmsFormWidgetI_CmsFormWidget.getApparentValue()public CmsToggleButton getButton()
public I_CmsFormWidget.FieldType getFieldType()
I_CmsFormWidgetgetFieldType 在接口中 I_CmsFormWidgetI_CmsFormWidget.getFieldType()public java.lang.Boolean getFormValue()
I_CmsFormWidgetgetFormValue 在接口中 I_CmsFormWidgetI_CmsFormWidget.getFormValue()public java.lang.String getFormValueAsString()
I_CmsFormWidgetgetFormValueAsString 在接口中 I_CmsFormWidgetI_CmsFormWidget.getFormValueAsString()public com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()
getHorizontalAlignment 在接口中 com.google.gwt.user.client.ui.HasHorizontalAlignmentHasHorizontalAlignment.getHorizontalAlignment()public java.lang.String getInternalValue()
public java.lang.String getText()
public boolean isChecked()
public boolean isEnabled()
isEnabled 在接口中 I_CmsFormWidgetpublic void reset()
I_CmsFormWidgetreset 在接口中 I_CmsFormWidgetI_CmsFormWidget.reset()public void setAutoHideParent(I_CmsAutoHider autoHideParent)
I_CmsFormWidgetsetAutoHideParent 在接口中 I_CmsFormWidgetautoHideParent - the auto hide parentI_CmsFormWidget.setAutoHideParent(org.opencms.gwt.client.ui.I_CmsAutoHider)public void setChecked(boolean checked)
checked - if true, check the checkbox else uncheck itpublic void setEnabled(boolean enabled)
setEnabled 在接口中 I_CmsFormWidgetenabled - if true, enable the checkbox, else disable itpublic void setErrorMessage(java.lang.String errorMessage)
I_CmsFormWidgetIf the error message is null, no error message will be displayed.
setErrorMessage 在接口中 I_CmsFormWidgeterrorMessage - an error message or nullI_CmsFormWidget.setErrorMessage(java.lang.String)public void setFormValue(java.lang.Object value)
value - the new valuepublic void setFormValueAsString(java.lang.String value)
I_CmsFormWidgetsetFormValueAsString 在接口中 I_CmsFormWidgetvalue - the new value of the widgetI_CmsFormWidget.setFormValueAsString(java.lang.String)public void setHorizontalAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant align)
setHorizontalAlignment 在接口中 com.google.gwt.user.client.ui.HasHorizontalAlignmentHasHorizontalAlignment.setHorizontalAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant)public void setInternalValue(java.lang.String value)
value - the new internal valuepublic void setText(java.lang.String text)
text - the text to setprotected void fireValueChangedEvent()