com.groiss.gui.component
Class RadioButton

java.lang.Object
  extended by com.groiss.gui.AbstractComponent
      extended by com.groiss.gui.component.RadioButton
All Implemented Interfaces:
Component, java.io.Serializable, java.lang.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:
Serialized Form

Field Summary
 
Fields inherited from class com.groiss.gui.AbstractComponent
actions, ACTIVE, browserMode, DEFAULT, ID, IE, INVISIBLE, isSensitive, label, NS, ON_BLUR, ON_CHANGE, ON_CLICK, ON_DBLCLICK, ON_FOCUS, ON_KEY_DOWN, ON_KEY_PRESS, ON_KEY_UP, ON_LOAD, ON_MOUSE_DOWN, ON_MOUSE_MOVE, ON_MOUSE_OUT, ON_MOUSE_UP, ON_RESET, ON_SELECT, ON_SUBMIT, ON_UNLOAD, outputter, parent, parentElem, READONLY, root, viewMode
 
Constructor Summary
RadioButton()
          Constructs a new empty RadioButton.
RadioButton(java.lang.String name, java.lang.String value)
          Constructor with name and value.
RadioButton(java.lang.String name, java.lang.String value, boolean checked)
          Constructor with name, value and the initial state.
RadioButton(java.lang.String name, java.lang.String value, boolean checked, java.lang.String styleClass)
          Constructor with name, value and the initial state.
 
Method Summary
 java.lang.Object getContent()
           
 java.lang.String getName()
           
 java.lang.String getText()
           
 java.lang.String getValue()
           
 boolean isChecked()
           
 void setChecked(boolean checked)
          sets whether the radioButton is checked or not
 void setContent(java.lang.Object o)
          Set the button text.
 void setName(java.lang.String name)
          sets the name of the radioButton
 void setText(java.lang.String text)
          sets the text
 void setValue(java.lang.String value)
          sets the value of the checkbox
 
Methods inherited from class com.groiss.gui.AbstractComponent
clone, create, getActionListener, getAttribute, getBrowserMode, getId, getLabel, getParent, getParentElement, getRoot, getRootName, getStyle, getViewMode, init, init, init, removeAttribute, setActionListener, setAttribute, setBrowserMode, setEncoding, setExpandEmptyElements, setId, setIndenting, setLabel, setNewLines, setParent, setParentElement, setRootName, setStyle, setViewMode, show, show, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RadioButton

public RadioButton()
Constructs a new empty RadioButton.


RadioButton

public RadioButton(java.lang.String name,
                   java.lang.String value)
Constructor with name and value.

Parameters:
name - - the name of the RadioButton group
value - - the value of the RadioButton

RadioButton

public RadioButton(java.lang.String name,
                   java.lang.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(java.lang.String name,
                   java.lang.String value,
                   boolean checked,
                   java.lang.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 Detail

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(java.lang.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 java.lang.String getName()
Specified by:
getName in interface Component
Overrides:
getName in class AbstractComponent
Returns:
- the name of the component

setValue

public void setValue(java.lang.String value)
sets the value of the checkbox

Parameters:
value - the value of the checkbox

getValue

public java.lang.String getValue()

setText

public void setText(java.lang.String text)
sets the text

Parameters:
text - the text String

getText

public java.lang.String getText()

setContent

public void setContent(java.lang.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 java.lang.Object getContent()
Specified by:
getContent in interface Component
Overrides:
getContent in class AbstractComponent
Returns:
the content object of the component


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.