org.progeeks.util.swing
Class CheckBoxActionGroup

java.lang.Object
  extended by org.progeeks.util.DefaultObservableList
      extended by org.progeeks.util.swing.ActionList
          extended by org.progeeks.util.swing.CheckBoxActionGroup
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.EventListener, java.util.List, javax.swing.Action, ObservableList, ViewContextAware

public class CheckBoxActionGroup
extends ActionList

Contains a list of CheckBoxActions and applies mutual exlusion rules. If one check box changes, operations are performed on the other check boxes such as turning them off, etc.. This is to simulat radio button groups at the action level, but with a little more configurability. Any new items added to the ActionList are automatically included in the state tracking for the group.

Version:
$Revision: 1.5 $
Author:
Paul Speed
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
CheckBoxActionGroup()
           
CheckBoxActionGroup(java.lang.String name)
           
CheckBoxActionGroup(java.lang.String name, boolean inheritSelectedProperties)
           
 
Method Summary
 boolean getInheritSelectedProperties()
           
protected  void inheritProperties(javax.swing.Action a)
          Called to have this action inherit some display properties from the specified action.
protected  void initializeClone(ActionList clone)
          Called by either clone method to do custom clone initialization.
 void setInheritSelectedProperties(boolean flag)
          Set to true if the action list's name, icon, etc. should be inherited from whatever action is currently selected.
protected  void setupListeners()
           
protected  void updateState(CheckBoxAction action)
           
 
Methods inherited from class org.progeeks.util.swing.ActionList
actionPerformed, add, add, clone, deepClone, equals, findAction, getAction, getDeepClone, getValue, getViewContext, hashCode, isEnabled, putValue, remove, remove, set, setDeepClone, setEnabled, setViewContext, toString
 
Methods inherited from class org.progeeks.util.DefaultObservableList
addAll, addAll, addPropertyChangeListener, clear, contains, containsAll, fireElementsInserted, fireElementsModified, fireElementsRemoved, firePropertyChangeEvent, get, getPropertyName, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeAll, removePropertyChangeListener, retainAll, setList, size, subList, toArray, toArray
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.Action
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

CheckBoxActionGroup

public CheckBoxActionGroup()

CheckBoxActionGroup

public CheckBoxActionGroup(java.lang.String name)

CheckBoxActionGroup

public CheckBoxActionGroup(java.lang.String name,
                           boolean inheritSelectedProperties)
Method Detail

setInheritSelectedProperties

public void setInheritSelectedProperties(boolean flag)
Set to true if the action list's name, icon, etc. should be inherited from whatever action is currently selected.


getInheritSelectedProperties

public boolean getInheritSelectedProperties()

setupListeners

protected void setupListeners()

initializeClone

protected void initializeClone(ActionList clone)
Description copied from class: ActionList
Called by either clone method to do custom clone initialization. This is to avoid having to override both clone and deepClone to support proper cloning. Default implementation does nothing. Remember, any this.foo type of references are refering to the original object and clone.foo is refering to the clone version. Seems obvious but it is easy to forget. Note: this will always be called at the end of clone() or deepClone() so any nested actions will have already been cloned.

Overrides:
initializeClone in class ActionList

updateState

protected void updateState(CheckBoxAction action)

inheritProperties

protected void inheritProperties(javax.swing.Action a)
Called to have this action inherit some display properties from the specified action.



Copyright © 2002-2003 Paul Speed. All Rights Reserved.