org.xnap.commons.gui.action
Class AbstractToggleSettingAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.xnap.commons.gui.action.AbstractXNapAction
          extended by org.xnap.commons.gui.action.AbstractToggleAction
              extended by org.xnap.commons.gui.action.AbstractToggleSettingAction
All Implemented Interfaces:
ActionListener, PropertyChangeListener, Serializable, Cloneable, EventListener, Action, ToggleAction

public abstract class AbstractToggleSettingAction
extends AbstractToggleAction
implements PropertyChangeListener

Provides a default implementation for a toggle action that monitors a BooleanSetting.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.xnap.commons.gui.action.AbstractXNapAction
ICON_FILENAME
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface org.xnap.commons.gui.action.ToggleAction
SELECTED
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
AbstractToggleSettingAction(BooleanSetting setting)
          Constructs a toggle action that monitors a boolean preference key.
 
Method Summary
 void propertyChange(PropertyChangeEvent e)
           
 void toggled(boolean selected)
          Updates the setting.
 
Methods inherited from class org.xnap.commons.gui.action.AbstractToggleAction
actionPerformed, isSelected, setSelected
 
Methods inherited from class org.xnap.commons.gui.action.AbstractXNapAction
getIcon, initialize, setEnabledLater, tr, tr
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.Action
addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 

Constructor Detail

AbstractToggleSettingAction

public AbstractToggleSettingAction(BooleanSetting setting)
Constructs a toggle action that monitors a boolean preference key.

Parameters:
setting - the setting to monitor
Method Detail

propertyChange

public void propertyChange(PropertyChangeEvent e)
Specified by:
propertyChange in interface PropertyChangeListener

toggled

public void toggled(boolean selected)
Updates the setting.

Specified by:
toggled in class AbstractToggleAction


Copyright © 2004-2007 XNap Commons Team. All Rights Reserved.