public class CmsMultiCheckBox extends com.google.gwt.user.client.ui.Composite implements I_CmsFormWidget, I_CmsHasInit, com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.String>, com.google.gwt.event.dom.client.HasFocusHandlers
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
I_CmsFormWidget.FieldType
限定符和类型 | 字段和说明 |
---|---|
protected java.util.List<CmsCheckBox> |
m_checkboxes
The list of checkboxes.
|
protected CmsErrorWidget |
m_error
Error display for this widget.
|
protected java.util.Map<java.lang.String,java.lang.String> |
m_items
The select options of the multi check box.
|
protected com.google.gwt.user.client.ui.Panel |
m_panel
Panel which contains all the components of the widget.
|
static java.lang.String |
WIDGET_TYPE
The type string for this widget.
|
构造器和说明 |
---|
CmsMultiCheckBox(java.util.List<CmsPair<java.lang.String,java.lang.String>> items)
Constructs a new checkbox group from a list of string pairs.
|
CmsMultiCheckBox(java.util.Map<java.lang.String,java.lang.String> items)
Constructs a new checkbox group from a map from strings to strings.
|
限定符和类型 | 方法和说明 |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String> handler) |
protected void |
fireValueChanged(java.lang.String newValue)
Fires the value change event for the widget.
|
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.
|
java.util.List<CmsCheckBox> |
getCheckboxes()
Returns a list of all checkboxes.
|
I_CmsFormWidget.FieldType |
getFieldType()
Returns the type of data this widget produces.
|
java.lang.Object |
getFormValue()
Gets the selected/entered value from the widget.
|
java.lang.String |
getFormValueAsString()
Gets the current value of the widget as a string.
|
java.util.Set<java.lang.String> |
getSelected()
Returns the set of values of the selected checkboxes.
|
protected void |
init(java.util.Map<java.lang.String,java.lang.String> items)
Initializes the widget given a map of select options.
|
static void |
initClass()
Initializes this class.
|
boolean |
isEnabled()
Returns
true if this widget 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 |
setEnabled(boolean enabled)
Enables or disables the widget.
|
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 formValue)
Sets the current value of the widget as a string.
|
void |
setTextWeak(boolean weak)
Enables or disables italics display in the checkbox labels.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
addStyleDependentName, 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, unsinkEvents
public static final java.lang.String WIDGET_TYPE
protected java.util.List<CmsCheckBox> m_checkboxes
protected CmsErrorWidget m_error
protected java.util.Map<java.lang.String,java.lang.String> m_items
protected com.google.gwt.user.client.ui.Panel m_panel
public CmsMultiCheckBox(java.util.List<CmsPair<java.lang.String,java.lang.String>> items)
The first string of every pair is the value of the checkbox, the second string is the label.
items
- a list of pairs of strings.public CmsMultiCheckBox(java.util.Map<java.lang.String,java.lang.String> items)
The keys of the map are used as the selection values of the checkboxes, while the value for a given key in the map is used as the label for the checkbox which is displayed to the user.
items
- the map of checkbox optionspublic static void initClass()
public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String> handler)
addValueChangeHandler
在接口中 com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.String>
HasValueChangeHandlers.addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)
public java.lang.String getApparentValue()
I_CmsFormWidget
getApparentValue
在接口中 I_CmsFormWidget
I_CmsFormWidget.getApparentValue()
public java.util.List<CmsCheckBox> getCheckboxes()
public I_CmsFormWidget.FieldType getFieldType()
I_CmsFormWidget
getFieldType
在接口中 I_CmsFormWidget
I_CmsFormWidget.getFieldType()
public java.lang.Object getFormValue()
I_CmsFormWidget
getFormValue
在接口中 I_CmsFormWidget
I_CmsFormWidget.getFormValue()
public java.lang.String getFormValueAsString()
I_CmsFormWidget
getFormValueAsString
在接口中 I_CmsFormWidget
I_CmsFormWidget.getFormValueAsString()
public java.util.Set<java.lang.String> getSelected()
public boolean isEnabled()
I_CmsFormWidget
true
if this widget is enabled.isEnabled
在接口中 I_CmsFormWidget
true
if this widget is enabledI_CmsFormWidget.isEnabled()
public void reset()
I_CmsFormWidget
reset
在接口中 I_CmsFormWidget
I_CmsFormWidget.reset()
public void setAutoHideParent(I_CmsAutoHider autoHideParent)
I_CmsFormWidget
setAutoHideParent
在接口中 I_CmsFormWidget
autoHideParent
- the auto hide parentI_CmsFormWidget.setAutoHideParent(org.opencms.gwt.client.ui.I_CmsAutoHider)
public void setEnabled(boolean enabled)
I_CmsFormWidget
setEnabled
在接口中 I_CmsFormWidget
enabled
- if true, the widget will be enabled, else disabledI_CmsFormWidget.setEnabled(boolean)
public void setErrorMessage(java.lang.String errorMessage)
I_CmsFormWidget
If the error message is null, no error message will be displayed.
setErrorMessage
在接口中 I_CmsFormWidget
errorMessage
- 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 formValue)
I_CmsFormWidget
setFormValueAsString
在接口中 I_CmsFormWidget
formValue
- the new value of the widgetI_CmsFormWidget.setFormValueAsString(java.lang.String)
public void setTextWeak(boolean weak)
weak
- true if italics display should be enabledprotected void fireValueChanged(java.lang.String newValue)
newValue
- the new valueprotected void init(java.util.Map<java.lang.String,java.lang.String> items)
The keys of the map are the values of the select options, while the values of the map are the labels which should be used for the checkboxes.
items
- the map of select optionspublic com.google.gwt.event.shared.HandlerRegistration addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler)
addFocusHandler
在接口中 com.google.gwt.event.dom.client.HasFocusHandlers
HasFocusHandlers.addFocusHandler(com.google.gwt.event.dom.client.FocusHandler)