Package org.opencms.gwt.client.ui.input
Class CmsRadioButtonGroup
java.lang.Object
org.opencms.gwt.client.ui.input.CmsRadioButtonGroup
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasValueChangeHandlers<String>
,com.google.gwt.event.shared.HasHandlers
public class CmsRadioButtonGroup
extends Object
implements com.google.gwt.event.logical.shared.HasValueChangeHandlers<String>
This class coordinates multiple radio buttons and makes sure that when a radio button of a group is
selected, no other radio button of the same group is selected.
- Since:
- 8.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final <H extends com.google.gwt.event.shared.EventHandler>
com.google.gwt.event.shared.HandlerRegistrationaddHandler
(H handler, com.google.gwt.event.shared.GwtEvent.Type<H> type) Adds this handler to the widget.com.google.gwt.event.shared.HandlerRegistration
addValueChangeHandler
(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler) void
Deselects a selected radio button (if one is selected).void
fireEvent
(com.google.gwt.event.shared.GwtEvent<?> event) Returns the currently selected button, or null if none is selected.void
selectButton
(CmsRadioButton button) Selects a new button and deselects the previously selected one.void
setValueChangeTarget
(com.google.gwt.event.logical.shared.HasValueChangeHandlers<String> target) Sets the new value change event target for this button group.
-
Constructor Details
-
CmsRadioButtonGroup
public CmsRadioButtonGroup()
-
-
Method Details
-
deselectButton
Deselects a selected radio button (if one is selected). -
getSelectedButton
Returns the currently selected button, or null if none is selected.- Returns:
- the selected button or null
-
selectButton
Selects a new button and deselects the previously selected one.- Parameters:
button
- the button which should be selected