Make it easy to use a controller as an action listener in the standard AWT

style.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1659 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2005-06-21 04:21:59 +00:00
parent 6413b412f2
commit a0268025f9
@@ -68,6 +68,7 @@ import com.samskivert.swing.event.CommandEvent;
* the controllers. * the controllers.
*/ */
public abstract class Controller public abstract class Controller
implements ActionListener
{ {
/** /**
* This action listener can be wired up to any action event generator * This action listener can be wired up to any action event generator
@@ -267,6 +268,12 @@ public abstract class Controller
return handleAction(new CommandEvent(source, command, arg)); return handleAction(new CommandEvent(source, command, arg));
} }
// documentation inherited from interface ActionListener
public void actionPerformed (ActionEvent event)
{
handleAction(event);
}
/** /**
* Used by {@link #handleAction} to generate arguments to the action * Used by {@link #handleAction} to generate arguments to the action
* handler method. * handler method.