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<java.lang.String>
,com.google.gwt.event.shared.HasHandlers
public class CmsRadioButtonGroup extends java.lang.Object implements com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.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 Constructor Description CmsRadioButtonGroup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <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<java.lang.String> handler)
void
deselectButton()
Deselects a selected radio button (if one is selected).void
fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
CmsRadioButton
getSelectedButton()
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<java.lang.String> target)
Sets the new value change event target for this button group.
-
-
-
Constructor Detail
-
CmsRadioButtonGroup
public CmsRadioButtonGroup()
-
-
Method Detail
-
addValueChangeHandler
public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String> handler)
- Specified by:
addValueChangeHandler
in interfacecom.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.String>
- See Also:
HasValueChangeHandlers.addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)
-
deselectButton
public void deselectButton()
Deselects a selected radio button (if one is selected).
-
fireEvent
public void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
- Specified by:
fireEvent
in interfacecom.google.gwt.event.shared.HasHandlers
- See Also:
HasHandlers.fireEvent(com.google.gwt.event.shared.GwtEvent)
-
getSelectedButton
public CmsRadioButton getSelectedButton()
Returns the currently selected button, or null if none is selected.- Returns:
- the selected button or null
-
selectButton
public void selectButton(CmsRadioButton button)
Selects a new button and deselects the previously selected one.- Parameters:
button
- the button which should be selected
-
setValueChangeTarget
public void setValueChangeTarget(com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.String> target)
Sets the new value change event target for this button group.- Parameters:
target
- the value change event target
-
addHandler
protected final <H extends com.google.gwt.event.shared.EventHandler> com.google.gwt.event.shared.HandlerRegistration addHandler(H handler, com.google.gwt.event.shared.GwtEvent.Type<H> type)
Adds this handler to the widget.- Type Parameters:
H
- the type of handler to add- Parameters:
type
- the event typehandler
- the handler- Returns:
HandlerRegistration
used to remove the handler
-
-