diff --git a/projects/samskivert/src/java/com/samskivert/swing/Controller.java b/projects/samskivert/src/java/com/samskivert/swing/Controller.java index 57de1b9a..7df55c04 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/Controller.java +++ b/projects/samskivert/src/java/com/samskivert/swing/Controller.java @@ -1,5 +1,5 @@ // -// $Id: Controller.java,v 1.15 2002/06/19 23:22:40 mdb Exp $ +// $Id: Controller.java,v 1.16 2003/07/11 03:42:27 mdb Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne @@ -231,6 +231,30 @@ public abstract class Controller } } + /** + * A convenience method for constructing and immediately handling an + * event on this controller (via {@link #handleAction(ActionEvent)}). + * + * @return true if the controller knew how to handle the action, false + * otherwise. + */ + public boolean handleAction (Component source, String command) + { + return handleAction(new ActionEvent(source, 0, command)); + } + + /** + * A convenience method for constructing and immediately handling an + * event on this controller (via {@link #handleAction(ActionEvent)}). + * + * @return true if the controller knew how to handle the action, false + * otherwise. + */ + public boolean handleAction (Component source, String command, Object arg) + { + return handleAction(new CommandEvent(source, command, arg)); + } + /** * Used by {@link #handleAction} to generate arguments to the action * handler method.