Class RadioButton

java.lang.Object
com.groiss.gui.AbstractComponent
com.groiss.gui.component.RadioButton
All Implemented Interfaces:
Component, Serializable, Cloneable

public class RadioButton extends AbstractComponent
A HTML radio button. <input type=radio ... It is used for attributes that accept a single value from a set of alternatives. Each RadioButton in the group should be given the same name. RadioButtons require an explicit VALUE and NAME attribute. CHECKED is an optional attribute and can be used to specify which options are selected for initial form display.
See Also:
  • Constructor Details

    • RadioButton

      public RadioButton()
      Constructs a new empty RadioButton.
    • RadioButton

      public RadioButton(String name, String value)
      Constructor with name and value.
      Parameters:
      name - - the name of the RadioButton group
      value - - the value of the RadioButton
    • RadioButton

      public RadioButton(String name, String value, boolean checked)
      Constructor with name, value and the initial state.
      Parameters:
      name - the name of the RadioButton group
      value - the value of this button
      checked - whether the RadioButton is checked or not
    • RadioButton

      public RadioButton(String name, String value, boolean checked, String styleClass)
      Constructor with name, value and the initial state.
      Parameters:
      name - the name of the RadioButton group
      value - the value of this button
      checked - whether the RadioButton is checked or not
      styleClass - the name of a CSS class
  • Method Details

    • setChecked

      public void setChecked(boolean checked)
      sets whether the radioButton is checked or not
      Parameters:
      checked - the checked-mode of the radioButton
    • isChecked

      public boolean isChecked()
    • setName

      public void setName(String name)
      sets the name of the radioButton
      Specified by:
      setName in interface Component
      Overrides:
      setName in class AbstractComponent
      Parameters:
      name - the name
    • getName

      public String getName()
      Specified by:
      getName in interface Component
      Overrides:
      getName in class AbstractComponent
      Returns:
      - the name of the component
    • setValue

      public void setValue(String value)
      sets the value of the checkbox
      Parameters:
      value - the value of the checkbox
    • getValue

      public String getValue()
    • setText

      public void setText(String text)
      sets the text
      Parameters:
      text - the text String
    • getText

      public String getText()
    • setContent

      public void setContent(Object o)
      Set the button text.
      Specified by:
      setContent in interface Component
      Overrides:
      setContent in class AbstractComponent
      Parameters:
      o - any object where the string representation is used for rendering
    • getContent

      public Object getContent()
      Specified by:
      getContent in interface Component
      Overrides:
      getContent in class AbstractComponent
      Returns:
      the content object of the component