public class VRadioButtonGroup extends FocusableFlowPanelComposite implements Field, com.google.gwt.event.dom.client.ClickHandler, com.google.gwt.user.client.ui.HasEnabled
RadioButtonGroup component.| Modifier and Type | Field and Description |
|---|---|
static String |
CLASSNAME
Default classname for this widget.
|
static String |
CLASSNAME_OPTION
Default classname for all radio buttons within this widget.
|
static String |
CLASSNAME_OPTION_SELECTED
Default classname for the selected radio button within this widget.
|
ApplicationConnection |
client
For internal use only.
|
| Constructor and Description |
|---|
VRadioButtonGroup()
Constructs a widget for the RadioButtonGroup component.
|
| Modifier and Type | Method and Description |
|---|---|
Registration |
addSelectionChangeHandler(Consumer<elemental.json.JsonObject> selectionChanged)
Adds the given selection change handler to this widget.
|
void |
buildOptions(List<elemental.json.JsonObject> items)
Build all the options.
|
void |
focus()
Set focus to the selected radio button (or first radio button if there is
no selection).
|
elemental.json.JsonObject |
getItem(com.google.gwt.dom.client.Element element)
Returns the JsonObject used to populate the RadioButton widget that
contains given Element.
|
boolean |
isEnabled() |
boolean |
isHtmlContentAllowed()
Returns whether HTML is allowed in the item captions.
|
boolean |
isReadonly()
Returns whether this radio button group is read-only or not.
|
void |
onClick(com.google.gwt.event.dom.client.ClickEvent event) |
void |
selectItemKey(String selectedItemKey)
Removes previous selection and adds new selection.
|
void |
setEnabled(boolean enabled) |
void |
setHtmlContentAllowed(boolean htmlContentAllowed)
Sets whether HTML is allowed in the item captions.
|
void |
setReadonly(boolean readonly)
Sets the read-only status of this radio button group.
|
void |
setTabIndex(int tabIndex)
Sets the tabulator index for the container element that holds the radio
buttons.
|
protected void |
updateEnabledState()
Sets radio buttons enabled according to this widget's enabled and
read-only status, as well as each option's own enabled status.
|
protected void |
updateItemEnabled(com.google.gwt.user.client.ui.RadioButton radioButton,
boolean value)
Updates the enabled state of a radio button.
|
protected void |
updateItemSelection(com.google.gwt.user.client.ui.RadioButton radioButton,
boolean value)
Updates the selected state of a radio button.
|
addBlurHandler, addFocusHandler, getWidgetclaimElement, 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, 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 String CLASSNAME
public static final String CLASSNAME_OPTION
public static final String CLASSNAME_OPTION_SELECTED
public ApplicationConnection client
public VRadioButtonGroup()
public void buildOptions(List<elemental.json.JsonObject> items)
items - the list of optionspublic elemental.json.JsonObject getItem(com.google.gwt.dom.client.Element element)
element - the element to search fornull if not foundpublic void onClick(com.google.gwt.event.dom.client.ClickEvent event)
onClick in interface com.google.gwt.event.dom.client.ClickHandlerpublic void setTabIndex(int tabIndex)
tabIndex - tabulator index for the radio button groupprotected void updateEnabledState()
public boolean isHtmlContentAllowed()
true if the captions are used as HTML, false if
used as plain textpublic void setHtmlContentAllowed(boolean htmlContentAllowed)
true, the captions are displayed as HTML and the developer is
responsible for ensuring no harmful HTML is used. If set to
false, the content is displayed as plain text.
This value is delegated from the RadioButtonGroupState.
htmlContentAllowed - true if the captions are used as HTML, false
if used as plain textpublic boolean isEnabled()
isEnabled in interface com.google.gwt.user.client.ui.HasEnabledpublic boolean isReadonly()
true if this widget is read-only, false otherwisepublic void setReadonly(boolean readonly)
readonly - true if this widget should be read-only, false
otherwisepublic void setEnabled(boolean enabled)
setEnabled in interface com.google.gwt.user.client.ui.HasEnabledpublic Registration addSelectionChangeHandler(Consumer<elemental.json.JsonObject> selectionChanged)
selectionChanged - the handler that should be triggered when selection changespublic void selectItemKey(String selectedItemKey)
selectedItemKey - the key of the selected radio buttonpublic void focus()
focus in interface Focusablefocus in class FocusableFlowPanelCompositeprotected void updateItemSelection(com.google.gwt.user.client.ui.RadioButton radioButton,
boolean value)
radioButton - the radio button to updatevalue - true if selected; false if notprotected void updateItemEnabled(com.google.gwt.user.client.ui.RadioButton radioButton,
boolean value)
radioButton - the radio button to updatevalue - true if enabled; false if notCopyright © 2021 Vaadin Ltd. All rights reserved.