Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.greenstone.gatherer.util
Class XORToggleButtonGroup  view XORToggleButtonGroup download XORToggleButtonGroup.java

java.lang.Object
  extended byorg.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.


Field Summary
private  boolean ignore
          true if we are to ignore any further change events we recieve.
private  javax.swing.JToggleButton last_button
           
private  int selected_count
          The current number of checkboxes that are selected.
 
Constructor Summary
XORToggleButtonGroup()
           
 
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
 

Field Detail

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
Constructor Detail

XORToggleButtonGroup

public XORToggleButtonGroup()
Method Detail

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.