com.ccg.swing
Class ActionCallback

java.lang.Object
  extended by com.ccg.swing.ActionCallback
All Implemented Interfaces:
ActionListener, EventListener

public class ActionCallback
extends Object
implements ActionListener

Object used to invoke a particular method of a object.

This class provides a means to install callback handlers based on the name of a method which belongs to a object. This makes a VERY nice mechanism to dynamically create graphical interfaces based on the content of property files (or ResourceBundles).

You can use this object directly, but typically it is used indirectly by other GUI building methods (when creating dynamic menus, buttons, or button grids).

Since:
1.0
Version:
$Revision: 1.3 $
Author:
$Author: pkb $
See Also:
Resources.createButtonGrid(String,Object), RMenuBar

Constructor Summary
protected ActionCallback(Method m, Object o)
          Constructs the object - but doesn't register it.
 
Method Summary
 void actionPerformed(ActionEvent e)
          This is the "action handler" it calls the registered method.
static ActionCallback create(Lookup l, AbstractButton a, Object o)
          Construct a ActionCallback object based on a set of properties and register it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionCallback

protected ActionCallback(Method m,
                         Object o)
Constructs the object - but doesn't register it.

Derived classes MUST make use of this constructor (though at this point in time, I'm not sure if there will be much point in deriving a class).

Parameters:
m - The method to invoke (must not be null).
o - The object which the method belongs to (must not be null).
Since:
1.0
See Also:
create(com.ccg.util.Lookup, javax.swing.AbstractButton, java.lang.Object)
Method Detail

create

public static ActionCallback create(Lookup l,
                                    AbstractButton a,
                                    Object o)
Construct a ActionCallback object based on a set of properties and register it.

This method provides the only public mechanism for creating these object types. It does the following:


actionPerformed

public void actionPerformed(ActionEvent e)
This is the "action handler" it calls the registered method.

One would typically not invoke this method directly. It is typically invoked via a user interface action (when the user presses a button or selects a menu item). The registered method is then called (and not passed any parameters).

Specified by:
actionPerformed in interface ActionListener
Parameters:
ae - ignored - but should not be null.
Since:
1.0
See Also:
create(com.ccg.util.Lookup, javax.swing.AbstractButton, java.lang.Object)


Copyright 1998-1998-2006 null. All Rights Reserved.