org.jvnet.flamingo.common
Class CommandToggleButtonGroup

java.lang.Object
  extended by org.jvnet.flamingo.common.CommandToggleButtonGroup
All Implemented Interfaces:
java.io.Serializable

public class CommandToggleButtonGroup
extends java.lang.Object
implements java.io.Serializable

Group of command toggle buttons. Unlike the ButtonGroup, this class operates on buttons and not on button models.

Author:
Kirill Grouchnikov
See Also:
Serialized Form

Field Summary
static java.lang.String SELECTED_PROPERTY
          Name of the property change event fired when the group selection is changed.
 
Constructor Summary
CommandToggleButtonGroup()
          Creates a new button group.
 
Method Summary
 void add(JCommandToggleButton b)
          Adds the specified button to the group.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds the specified property change listener on this button group.
 void clearSelection()
          Clears the selection of this button group.
 JCommandToggleButton getSelected()
          Returns the selected button of this group.
 void remove(JCommandToggleButton b)
          Removes the specified button from the group.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes the specified property change listener from this button group.
 void setSelected(JCommandToggleButton button, boolean isSelected)
          Changes the selected status of the specified button.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECTED_PROPERTY

public static final java.lang.String SELECTED_PROPERTY
Name of the property change event fired when the group selection is changed.

See Also:
Constant Field Values
Constructor Detail

CommandToggleButtonGroup

public CommandToggleButtonGroup()
Creates a new button group.

Method Detail

add

public void add(JCommandToggleButton b)
Adds the specified button to the group.

Parameters:
b - The button to be added.

remove

public void remove(JCommandToggleButton b)
Removes the specified button from the group.

Parameters:
b - The button to be removed

setSelected

public void setSelected(JCommandToggleButton button,
                        boolean isSelected)
Changes the selected status of the specified button.

Parameters:
button - Button.
isSelected - Selection indication.

getSelected

public JCommandToggleButton getSelected()
Returns the selected button of this group.

Returns:
The selected button of this group. The result can be null.

clearSelection

public void clearSelection()
Clears the selection of this button group.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds the specified property change listener on this button group.

Parameters:
listener - Listener to add.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the specified property change listener from this button group.

Parameters:
listener - Listener to remove.