com.google.gwt.user.client.ui
Class RadioButton

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.FocusWidget
              extended by com.google.gwt.user.client.ui.ButtonBase
                  extended by com.google.gwt.user.client.ui.CheckBox
                      extended by com.google.gwt.user.client.ui.RadioButton
All Implemented Interfaces:
EventListener, HasFocus, HasHTML, HasName, HasText, SourcesClickEvents, SourcesFocusEvents, SourcesKeyboardEvents

public class RadioButton
extends CheckBox

A mutually-exclusive selection radio button widget.

CSS Style Rules

Example

public class RadioButtonExample implements EntryPoint {

  public void onModuleLoad() {
    // Make some radio buttons, all in one group.
    RadioButton rb0 = new RadioButton("myRadioGroup", "foo");
    RadioButton rb1 = new RadioButton("myRadioGroup", "bar");
    RadioButton rb2 = new RadioButton("myRadioGroup", "baz");

    // Check 'baz' by default.
    rb2.setChecked(true);

    // Add them to the root panel.
    FlowPanel panel = new FlowPanel();
    panel.add(rb0);
    panel.add(rb1);
    panel.add(rb2);
    RootPanel.get().add(panel);
  }
}


Constructor Summary
RadioButton(java.lang.String group)
          Creates a new radio associated with a particular group.
RadioButton(java.lang.String group, java.lang.String label)
          Creates a new radio associated with a particular group, and initialized with the given HTML label.
RadioButton(java.lang.String group, java.lang.String label, boolean asHTML)
          Creates a new radio button associated with a particular group, and initialized with the given label (optionally treated as HTML).
 
Method Summary
 
Methods inherited from class com.google.gwt.user.client.ui.CheckBox
getHTML, getName, getText, isChecked, isEnabled, onDetach, setChecked, setEnabled, setFocus, setHTML, setName, setTabIndex, setText
 
Methods inherited from class com.google.gwt.user.client.ui.FocusWidget
addClickListener, addFocusListener, addKeyboardListener, getFocusImpl, getTabIndex, onBrowserEvent, removeClickListener, removeFocusListener, removeKeyboardListener, setAccessKey
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, onAttach, onLoad, removeFromParent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getTitle, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RadioButton

public RadioButton(java.lang.String group)
Creates a new radio associated with a particular group. All radio buttons associated with the same group name belong to a mutually-exclusive set.

Parameters:
group - the group with which to associate the radio button

RadioButton

public RadioButton(java.lang.String group,
                   java.lang.String 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.

Parameters:
group - the group with which to associate the radio button
label - this radio button's label

RadioButton

public RadioButton(java.lang.String group,
                   java.lang.String label,
                   boolean asHTML)
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.

Parameters:
group - the group with which to associate the radio button
label - this radio button's label
asHTML - true to treat the specified label as HTML