java.lang.Object
org.greenstone.gatherer.util.XORToggleButtonGroup
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.util.EventListener
- public class XORToggleButtonGroup
- extends java.lang.Object
- implements java.awt.event.ActionListener
Just like any other button group, this object encapsulates several checkbox listeners, but instead of recording which are selected, or indeed what buttons it has assigned to it, this group has but one purpose: to ensure that at least one check button is always selected.
|
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent event)
Any implementation of ActionListener includes this method so that we can be informed when an action has occured on any registered checkboxes, allowing us to roll back the action if this is the only selected checkbox remaining. |
void |
add(javax.swing.JToggleButton toggle_button)
|
void |
establish()
Ensures that at least one option is selected. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ignore
private boolean ignore
- true if we are to ignore any further change events we recieve.
selected_count
private int selected_count
- The current number of checkboxes that are selected. Never < 1.
last_button
private javax.swing.JToggleButton last_button
XORToggleButtonGroup
public XORToggleButtonGroup()
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
- Any implementation of ActionListener includes this method so that we can be informed when an action has occured on any registered checkboxes, allowing us to roll back the action if this is the only selected checkbox remaining.
- Specified by:
actionPerformed in interface java.awt.event.ActionListener
add
public void add(javax.swing.JToggleButton toggle_button)
establish
public void establish()
- Ensures that at least one option is selected.