|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ccg.swing.ActionCallback
public class ActionCallback
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).
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 |
|---|
protected ActionCallback(Method m,
Object o)
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).
m - The method to invoke (must not be null).o - The object which the method belongs to (must not be null).create(com.ccg.util.Lookup, javax.swing.AbstractButton, java.lang.Object)| Method Detail |
|---|
public static ActionCallback create(Lookup l,
AbstractButton a,
Object o)
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:
ActionCallback object.
method you specified
for the particular Object will be invoked.
l - The object to lookup the properties of the action handler from
(we lookup the ".action" attribute to determine the name of
the method to invoke on the object passed).a - The graphical component to register the action handler with.o - The object to invoke the method on.
Resources.createButtonGrid(String,Object)public void actionPerformed(ActionEvent e)
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).
actionPerformed in interface ActionListenerae - ignored - but should not be null.create(com.ccg.util.Lookup, javax.swing.AbstractButton, java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||