code::ActionListener Class Reference

Inheritance diagram for code::ActionListener:

code::MultipleListeners List of all members.

Detailed Description

The listener interface for receiving action events.

The class that is interested in processing an action event suclasses this interface, and the object created with that class is registered with an ActionSource, using the ActionSource's addActionListener method. When the action event occurs, that object's actionPerformed method is invoked.

Example use:

 @class MyActionListener: public ActionListener {
 @   virtual void actionPerformed ( const ActionEvent* e ) {
 @      cout << "button pressed" << endl;
 @   }
 @};
 @extern Button b; // Button is-a ActionSource
 @MyActionListener mine = new MyActionListener ( );
 @b.addActionListener ( mine );
 

Like Dialog/DialogListener and ListModel/ListListener, this is another instance of the "Observer/Observable" pattern, discussed in "Design Patterns: Elements of Reusable Object-Oriented Software" (Gamma, Helm, Johnson, Vlissides, 1995).

Author:
Charles Kerr
Version:
:
Id
code_ActionEvent.h,v 1.14 2009/12/10 20:08:39 lakshman Exp
See also:
ActionEvent

ActionSource


Public Member Functions

virtual ~ActionListener ()
 All classes should have virtual destructors.
virtual void actionPerformed (const ActionEvent *)=0
 This method is invoked when an action is published by one of the ActionSources that this listener subscribes to.


Constructor & Destructor Documentation

virtual code::ActionListener::~ActionListener (  )  [inline, virtual]

All classes should have virtual destructors.


Member Function Documentation

virtual void code::ActionListener::actionPerformed ( const ActionEvent  )  [pure virtual]

This method is invoked when an action is published by one of the ActionSources that this listener subscribes to.

Implemented in code::MultipleListeners.


Generated on Fri May 4 13:40:12 2012 for WDSS-IIw2 by  doxygen 1.4.7