org.xnap.commons.gui.action
Class AbstractToggleAction

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

public abstract class AbstractToggleAction
extends AbstractXNapAction
implements ToggleAction

Provides a default implementation for toggeable Action objects.

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
AbstractToggleAction()
          Constructor an AbstractToggleAction that is not selected by default.
AbstractToggleAction(boolean selected)
           
 
Method Summary
 void actionPerformed(ActionEvent event)
           
 boolean isSelected()
          Returns the state of the action.
 void setSelected(boolean newValue)
          Sets the state of the action.
abstract  void toggled(boolean selected)
          Invoked when the selection changes.
 
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

AbstractToggleAction

public AbstractToggleAction(boolean selected)

AbstractToggleAction

public AbstractToggleAction()
Constructor an AbstractToggleAction that is not selected by default.

Method Detail

isSelected

public boolean isSelected()
Returns the state of the action.

Specified by:
isSelected in interface ToggleAction
Returns:
true, if the action is currently in active state, e.g. selected in case of a JToggleButton

actionPerformed

public void actionPerformed(ActionEvent event)
Specified by:
actionPerformed in interface ActionListener

toggled

public abstract void toggled(boolean selected)
Invoked when the selection changes.


setSelected

public void setSelected(boolean newValue)
Sets the state of the action.

Specified by:
setSelected in interface ToggleAction
Parameters:
newValue - if true, the action is set to active state


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