org.springframework.richclient.command
Class SwingActionAdapter
java.lang.Object
javax.swing.AbstractAction
org.springframework.richclient.command.SwingActionAdapter
- All Implemented Interfaces:
- ActionListener, PropertyChangeListener, Serializable, Cloneable, EventListener, Action
public class SwingActionAdapter
- extends AbstractAction
- implements PropertyChangeListener
An adapter between a Spring Rich Client ActionCommand
and the Swing
Action
interface.
This adheres to the standard GoF Adapter
pattern whereby this class acts as
a wrapper around an underlying ActionCommand
to give it the appearance of
being an Action
.
The PropertyChangeListener
interface is also implemented so that
instances can be notified of property change events being fired by their underlying command.
- See Also:
- Serialized Form
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 |
SwingActionAdapter
public SwingActionAdapter(ActionCommand command)
- Creates a new
SwingActionAdapter
with the given underlying action command. The
newly created instance will add itself as a property change listener of the command.
- Parameters:
command
- The underlying action command.
- Throws:
IllegalArgumentException
- if command
is null.
actionPerformed
public void actionPerformed(ActionEvent event)
- Delegates the handling of the given event to the underlying command.
- Specified by:
actionPerformed
in interface ActionListener
- Parameters:
event
- The action event to be handled.
propertyChange
public void propertyChange(PropertyChangeEvent event)
-
- Specified by:
propertyChange
in interface PropertyChangeListener
update
protected void update()
- Updates this instance according to the properties provided by the
underlying command.
Copyright © 2004-2008 The Spring Framework. All Rights Reserved.