de.tkuhn.swing.actions
Class BooleanStateAction
java.lang.Object
javax.swing.AbstractAction
de.tkuhn.swing.actions.DelegatingAction
de.tkuhn.swing.actions.BooleanStateAction
- All Implemented Interfaces:
- BooleanAction, ForwardingAction, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
public class BooleanStateAction
- extends DelegatingAction
- implements BooleanAction
A simple DelegatingAction
JavaBean that implements the
BooleanAction
interface by holding the state in the boolean
property selected as an attribute. It also implements the
ForwardingAction
interface.
- Version:
- 0.9.3
- Author:
- Tilmann Kuhn
- See Also:
BooleanAction
,
ForwardingAction
,
Serialized Form
Fields inherited from class javax.swing.AbstractAction |
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary |
BooleanStateAction()
Creates a new instance of BooleanStateAction |
BooleanStateAction(boolean selected)
Creates a new instance of BooleanStateAction with given initial value. |
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent actionEvent)
Implementation of actionPerformed() in
ActionListener . |
boolean |
isSelected()
Getter for property selected. |
void |
setSelected(boolean selected)
Setter for property selected. |
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 |
BooleanStateAction
public BooleanStateAction()
- Creates a new instance of BooleanStateAction
BooleanStateAction
public BooleanStateAction(boolean selected)
- Creates a new instance of BooleanStateAction with given initial value.
- Parameters:
selected
- initial value for the selected property.
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent actionEvent)
- Implementation of
actionPerformed()
in
ActionListener
.
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
- Overrides:
actionPerformed
in class DelegatingAction
- Parameters:
actionEvent
- the ActionEvent
to be processed.
isSelected
public boolean isSelected()
- Getter for property selected.
- Specified by:
isSelected
in interface BooleanAction
- Returns:
- Value of property selected.
setSelected
public void setSelected(boolean selected)
- Setter for property selected.
- Specified by:
setSelected
in interface BooleanAction
- Parameters:
selected
- New value of property selected.
Copyright © Tilmann Kuhn