java.lang.Object | ||||||
↳ | com.google.gwt.user.client.ui.UIObject | |||||
↳ | com.google.gwt.user.client.ui.Widget | |||||
↳ | com.google.gwt.user.client.ui.FocusWidget | |||||
↳ | com.google.gwt.user.client.ui.ButtonBase | |||||
↳ | com.google.gwt.user.client.ui.CheckBox | |||||
↳ | com.google.gwt.user.client.ui.RadioButton |
A mutually-exclusive selection radio button widget. Fires
ClickEvent
s
when the radio button is clicked, and ValueChangeEvent
s when the
button becomes checked. Note, however, that browser limitations prevent
ValueChangeEvents from being sent when the radio button is cleared as a side
effect of another in the group being clicked.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new radio associated with a particular group name.
| |||||||||||
Creates a new radio associated with a particular group, and initialized
with the given HTML label.
| |||||||||||
Creates a new radio associated with a particular group, and initialized
with the given HTML label.
| |||||||||||
Creates a new radio button associated with a particular group, and
initialized with the given label (optionally treated as HTML).
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Overridden to send ValueChangeEvents only when appropriate.
| |||||||||||
Change the group name of this radio button.
| |||||||||||
Overridden to defer the call to super.sinkEvents until the first time this
widget is attached to the dom, as a performance enhancement.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
No-op.
|
Creates a new radio associated with a particular group name. All radio buttons associated with the same group name belong to a mutually-exclusive set. Radio buttons are grouped by their name attribute, so changing their name using the setName() method will also change their associated group.
name | the group name with which to associate the radio button |
---|
Creates a new radio associated with a particular group, and initialized with the given HTML label. All radio buttons associated with the same group name belong to a mutually-exclusive set. Radio buttons are grouped by their name attribute, so changing their name using the setName() method will also change their associated group.
name | the group name with which to associate the radio button |
---|---|
label | this radio button's html label |
Creates a new radio associated with a particular group, and initialized with the given HTML label. All radio buttons associated with the same group name belong to a mutually-exclusive set. Radio buttons are grouped by their name attribute, so changing their name using the setName() method will also change their associated group.
name | the group name with which to associate the radio button |
---|---|
label | this radio button's label |
Creates a new radio button associated with a particular group, and initialized with the given label (optionally treated as HTML). All radio buttons associated with the same group name belong to a mutually-exclusive set. Radio buttons are grouped by their name attribute, so changing their name using the setName() method will also change their associated group.
name | name the group with which to associate the radio button |
---|---|
label | this radio button's label |
asHTML | true to treat the specified label as HTML
|
Overridden to send ValueChangeEvents only when appropriate.
event | the event received |
---|
Change the group name of this radio button. Radio buttons are grouped by their name attribute, so changing their name using the setName() method will also change their associated group. If changing this group name results in a new radio group with multiple radio buttons selected, this radio button will remain selected and the other radio buttons will be unselected.
name | name the group with which to associate the radio button |
---|
Overridden to defer the call to super.sinkEvents until the first time this
widget is attached to the dom, as a performance enhancement. Subclasses
wishing to customize sinkEvents can preserve this deferred sink behavior by
putting their implementation behind a check of
isOrWasAttached()
:
@Override public void sinkEvents(int eventBitsToAdd) { if (isOrWasAttached()) { /* customized sink code goes here */ } else { super.sinkEvents(eventBitsToAdd); } }
eventBitsToAdd | a bitfield representing the set of events to be added to this element's event set |
---|
No-op. CheckBox's click handler is no good for radio button, so don't use
it. Our event handling is all done in onBrowserEvent(Event)