org.brains2b.swingext.gui
Class ExtButtonGroup

java.lang.Object
  extended by javax.swing.ButtonGroup
      extended by org.brains2b.swingext.gui.ExtButtonGroup
All Implemented Interfaces:
java.io.Serializable

public class ExtButtonGroup
extends javax.swing.ButtonGroup

Extended ButtonGroup overwrites ButtonGroup to keep access to the buttons contained and the sequence it is contained in.

Buttons added to this group will have their focus keys overwritten for Tab/Shift-Tab to go to the next/previous item in the group.

Left/Down goes to the previous item, Right/Up to the next item within the group.

Version:
0.20 [05-07-2007]
Author:
dennis@brains2b.nl
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.ButtonGroup
buttons
 
Constructor Summary
ExtButtonGroup()
          Constructor for ExtButtonGroup.
 
Method Summary
 void add(javax.swing.AbstractButton b)
          Add will add an AbstractButton to the ButtonGroup, set the tooltip text for this group if the button does not have a separate one Adds a KeyListener to this button to handle focus keys.
 java.lang.String getToolTipText()
          Returns the toolTipText.
 java.util.Iterator iterator()
          An iterator for the buttons in this group This elimates the need to use the Enumeration in the original ButtonGroup
 void remove(javax.swing.AbstractButton b)
          Removes the button from the ButtonGroup Removes the KeyListener from the button
 void setEnabled(boolean b)
          Sets all the buttons in this group to enabled or disabled.
 void setToolTipText(java.lang.String toolTipText)
          Sets the toolTipText.
 void setVisible(boolean b)
          set all buttons in this group to visible or invisible
 
Methods inherited from class javax.swing.ButtonGroup
getButtonCount, getElements, getSelection, isSelected, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtButtonGroup

public ExtButtonGroup()
Constructor for ExtButtonGroup.

Method Detail

add

public void add(javax.swing.AbstractButton b)
Add will add an AbstractButton to the ButtonGroup, set the tooltip text for this group if the button does not have a separate one

Adds a KeyListener to this button to handle focus keys.

Overrides:
add in class javax.swing.ButtonGroup
See Also:
ButtonGroup.add(AbstractButton)

remove

public void remove(javax.swing.AbstractButton b)
Removes the button from the ButtonGroup

Removes the KeyListener from the button

Overrides:
remove in class javax.swing.ButtonGroup
See Also:
ButtonGroup.remove(AbstractButton)

iterator

public java.util.Iterator iterator()
An iterator for the buttons in this group

This elimates the need to use the Enumeration in the original ButtonGroup

Returns:
Iterator

getToolTipText

public java.lang.String getToolTipText()
Returns the toolTipText.

Returns:
String

setToolTipText

public void setToolTipText(java.lang.String toolTipText)
Sets the toolTipText.

Parameters:
toolTipText - The toolTipText to set

setEnabled

public void setEnabled(boolean b)
Sets all the buttons in this group to enabled or disabled.

Parameters:
b, - true for enabled, false for disabled
Since:
Framework 0.31

setVisible

public void setVisible(boolean b)
set all buttons in this group to visible or invisible

Parameters:
b, - true for visible, for for invisible
Since:
Framework 0.35