org.karora.cooee.app.button
Class ButtonGroup

java.lang.Object
  extended by org.karora.cooee.app.button.ButtonGroup
All Implemented Interfaces:
java.io.Serializable, RenderIdSupport

public class ButtonGroup
extends java.lang.Object
implements RenderIdSupport, java.io.Serializable

A collection of radio buttons which allows the selection of only one radio button at a time.

See Also:
Serialized Form

Constructor Summary
ButtonGroup()
           
 
Method Summary
 void addButton(ToggleButton radioButton)
          Adds a RadioButton to the group.
 ToggleButton[] getButtons()
          Returns all RadioButtons in the group.
 java.lang.String getRenderId()
          Returns an identifier that is unique within the ApplicationInstance with which the implementor will be used.
 void removeButton(ToggleButton radioButton)
          Removes a RadioButton from the group.
 void updateSelection(ToggleButton changedButton)
          Notifies the ButtonGroup that a RadioButton within its domain may have changed state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ButtonGroup

public ButtonGroup()
Method Detail

addButton

public void addButton(ToggleButton radioButton)
Adds a RadioButton to the group. Applications should use RadioButton.setGroup() to add buttons from a group rather than invoking this method.

Parameters:
radioButton - the RadioButton to add
See Also:
ToggleButton.setGroup(ButtonGroup)

getButtons

public ToggleButton[] getButtons()
Returns all RadioButtons in the group.

Returns:
the RadioButton

getRenderId

public java.lang.String getRenderId()
Description copied from interface: RenderIdSupport
Returns an identifier that is unique within the ApplicationInstance with which the implementor will be used.

Specified by:
getRenderId in interface RenderIdSupport
See Also:
RenderIdSupport.getRenderId()

removeButton

public void removeButton(ToggleButton radioButton)
Removes a RadioButton from the group. Applications should use RadioButton.setGroup() to remove buttons from a group rather than invoking this method.

Parameters:
radioButton - the RadioButton to remove
See Also:
ToggleButton.setGroup(ButtonGroup)

updateSelection

public void updateSelection(ToggleButton changedButton)
Notifies the ButtonGroup that a RadioButton within its domain may have changed state.

Parameters:
changedButton - the changed RadioButton


Copyright © 2009. All Rights Reserved.