com.carlosbcruz.account.util
Class AccountAbstractActionDecorator

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by com.carlosbcruz.account.util.AccountAbstractActionDecorator
All Implemented Interfaces:
AccountSubject, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public class AccountAbstractActionDecorator
extends javax.swing.AbstractAction
implements AccountSubject

Provides the AbstractAction with an enhancement with the use of a Decorator Design Patter. A new Account Abstract Action Decorator allows listeners to be attached to Actions. Whenever an Action is Performed all the listeners will be notified behind the scenes.

Author:
Carlos Fernando Bella Cruz - pessoal@carlosbcruz.com
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
AccountAbstractActionDecorator(java.lang.String name, javax.swing.Icon icon)
          Replicate the constructor specified at ActionSubject class.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addObserver(AccountObserver observer)
          Add an observer
 void notifyChange()
          Notify the observers that a change has occured
 void removeObserver(AccountObserver observer)
          Remove an observer
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccountAbstractActionDecorator

public AccountAbstractActionDecorator(java.lang.String name,
                                      javax.swing.Icon icon)
Replicate the constructor specified at ActionSubject class.

Parameters:
name - The name of the Action
icon - The icon that represents the Action
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

addObserver

public void addObserver(AccountObserver observer)
Description copied from interface: AccountSubject
Add an observer

Specified by:
addObserver in interface AccountSubject

removeObserver

public void removeObserver(AccountObserver observer)
Description copied from interface: AccountSubject
Remove an observer

Specified by:
removeObserver in interface AccountSubject

notifyChange

public void notifyChange()
Description copied from interface: AccountSubject
Notify the observers that a change has occured

Specified by:
notifyChange in interface AccountSubject