com.alkacon.geranium.client.ui.input
public class RadioButtonGroupWidget extends com.google.gwt.user.client.ui.Composite implements I_FormWidget, com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.String>, I_HasInit
This is mostly a 'convenience widget' for creating and handling multiple radio buttons as a single widget.
The radio buttons will be layed out vertically. If you need more control about the layout of the radio
buttons, use multiple RadioButton instances and link them with a RadioButtonGroup.
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabledI_FormWidget.FieldType| Modifier and Type | Field and Description |
|---|---|
protected com.google.gwt.event.shared.SimpleEventBus |
m_eventBus
The event bus.
|
static java.lang.String |
WIDGET_TYPE
The widget type identifier.
|
| Constructor and Description |
|---|
RadioButtonGroupWidget(java.util.Map<java.lang.String,java.lang.String> items)
Creates a new instance from a map of strings.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String> handler) |
void |
fireEvent(com.google.gwt.event.shared.GwtEvent<?> 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.
|
I_FormWidget.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.
|
protected void |
init(java.util.Map<java.lang.String,java.lang.String> items)
Internal method for initializing the widget with a list of select options.
|
boolean |
isEnabled()
Returns
true if this widget is enabled. |
void |
reset()
Resets the widget to its default state.
|
void |
setAutoHideParent(I_AutoHider 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.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, 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, toStringpublic static final java.lang.String WIDGET_TYPE
protected com.google.gwt.event.shared.SimpleEventBus m_eventBus
public RadioButtonGroupWidget(java.util.Map<java.lang.String,java.lang.String> items)
The keys of the map are used as the values of the radio buttons, and the values of the map are used as labels for the radio buttons.
items - the string map containing the select optionspublic com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String> handler)
addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.String>HasValueChangeHandlers.addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)public void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
fireEvent in interface com.google.gwt.event.shared.HasHandlersfireEvent in class com.google.gwt.user.client.ui.WidgetWidget.fireEvent(com.google.gwt.event.shared.GwtEvent)public java.lang.String getApparentValue()
I_FormWidgetgetApparentValue in interface I_FormWidgetI_FormWidget.getApparentValue()public I_FormWidget.FieldType getFieldType()
I_FormWidgetgetFieldType in interface I_FormWidgetI_FormWidget.getFieldType()public java.lang.Object getFormValue()
I_FormWidgetgetFormValue in interface I_FormWidgetI_FormWidget.getFormValue()public java.lang.String getFormValueAsString()
I_FormWidgetgetFormValueAsString in interface I_FormWidgetI_FormWidget.getFormValueAsString()public boolean isEnabled()
I_FormWidgettrue if this widget is enabled.isEnabled in interface I_FormWidgettrue if this widget is enabledI_FormWidget.isEnabled()public void reset()
I_FormWidgetreset in interface I_FormWidgetI_FormWidget.reset()public void setAutoHideParent(I_AutoHider autoHideParent)
I_FormWidgetsetAutoHideParent in interface I_FormWidgetautoHideParent - the auto hide parentI_FormWidget.setAutoHideParent(com.alkacon.geranium.client.ui.I_AutoHider)public void setEnabled(boolean enabled)
I_FormWidgetsetEnabled in interface I_FormWidgetenabled - if true, the widget will be enabled, else disabledI_FormWidget.setEnabled(boolean)public void setErrorMessage(java.lang.String errorMessage)
I_FormWidgetIf the error message is null, no error message will be displayed.
setErrorMessage in interface I_FormWidgeterrorMessage - an error message or nullI_FormWidget.setErrorMessage(java.lang.String)public void setFormValue(java.lang.Object value)
value - the new valuepublic void setFormValueAsString(java.lang.String formValue)
I_FormWidgetsetFormValueAsString in interface I_FormWidgetformValue - the new value of the widgetI_FormWidget.setFormValueAsString(java.lang.String)protected void init(java.util.Map<java.lang.String,java.lang.String> items)
items - the list of select options