com.linxpda.dbaware.awt
Class DBRadioGroup

java.lang.Object
  |
  +--java.awt.CheckboxGroup
        |
        +--com.linxpda.dbaware.awt.DBRadioGroup
All Implemented Interfaces:
DBAware, java.util.EventListener, java.awt.event.ItemListener, java.io.Serializable

public class DBRadioGroup
extends java.awt.CheckboxGroup
implements java.awt.event.ItemListener, DBAware

This class is responsible for parenting a collection of DBRadiobox components. It ensures that only one is selected at one time, maintains which member of the group is the default selection, and returns a value based upon which component is selected at the time of the request.

See Also:
Serialized Form

Constructor Summary
DBRadioGroup()
          Create a new DBRadioGroup.
 
Method Summary
 DBRadiobox addRadiobox(DBRadiobox b)
          Add the provided DBRadiobox to this group.
 java.lang.String getColumnLabel()
          Returns the data column label associated with this component.
 DBRadiobox getSelectedRadiobox()
          Returns the DBRadiobox that is currently selected.
 java.lang.Object getValue()
          Returns a dbaware component's value as an Object formatted in a manner in which the component can display.
 void itemStateChanged(java.awt.event.ItemEvent e)
          Used to hear selection events from the DBRadiobox components in this group.
 void reset()
          Resets the default DBRadiobox to 'on' and all others to 'off'.
 void setColumnLabel(java.lang.String label)
          Sets the data column into which this component's value will be stored.
 void setDefault(DBRadiobox b)
          Sets which DBRadiobox is the default value for this group.
 void setSelectedRadiobox(java.lang.String label)
          Sets which DBRadiobox in this group is to be selected.
 void setValue(Entry value)
          Passes an Entry object, from which the dbaware component retrieves it's value and displays it.
 
Methods inherited from class java.awt.CheckboxGroup
getCurrent, getSelectedCheckbox, setCurrent, setSelectedCheckbox, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DBRadioGroup

public DBRadioGroup()
Create a new DBRadioGroup.
Method Detail

addRadiobox

public DBRadiobox addRadiobox(DBRadiobox b)
Add the provided DBRadiobox to this group. If another DBRadiobox in this group is selected, this one will be deselected.

setDefault

public void setDefault(DBRadiobox b)
Sets which DBRadiobox is the default value for this group.

getSelectedRadiobox

public DBRadiobox getSelectedRadiobox()
Returns the DBRadiobox that is currently selected.

setSelectedRadiobox

public void setSelectedRadiobox(java.lang.String label)
Sets which DBRadiobox in this group is to be selected. All other are deselected.

reset

public void reset()
Resets the default DBRadiobox to 'on' and all others to 'off'.
Specified by:
reset in interface DBAware

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Used to hear selection events from the DBRadiobox components in this group.
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

getColumnLabel

public java.lang.String getColumnLabel()
Description copied from interface: DBAware
Returns the data column label associated with this component.
Specified by:
getColumnLabel in interface DBAware

setColumnLabel

public void setColumnLabel(java.lang.String label)
Description copied from interface: DBAware
Sets the data column into which this component's value will be stored.
Specified by:
setColumnLabel in interface DBAware
Following copied from interface: com.linxpda.dbaware.DBAware
Parameters:
label - The name of the column in which to store this component's value.

getValue

public java.lang.Object getValue()
Description copied from interface: DBAware
Returns a dbaware component's value as an Object formatted in a manner in which the component can display.
Specified by:
getValue in interface DBAware

setValue

public void setValue(Entry value)
Description copied from interface: DBAware
Passes an Entry object, from which the dbaware component retrieves it's value and displays it.
Specified by:
setValue in interface DBAware