Class awtExt.Choice
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class awtExt.Choice

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Choice
                   |
                   +----awtExt.Choice

public class Choice
extends Choice
Extension of standard awt Choice object. Provides a callback mechanism for invoking a user defined method, when an ACTION_EVENT occurs within this awtExt component. The called back method and target object must have a specific signature. This allows you to separate your application functionality from the GUI. i.e, no need to subclass the Choice object in order to invoke your user defined code.

NOTE: This component does NOT  use the general EventDispatch
mechanism, as the only event of interest is the ACTION_EVENT.
See Also:
Callback, Choice

Constructor Index

 o Choice()
Default Constructor.
 o Choice(methodRef)
Constructor.
 o Choice(Object, String)
Constructor.

Method Index

 o action(Event, Object)
Called when an action occurs.
 o addActionCallback(methodRef)
Adds user defined methodRef.

Constructors

 o Choice
  public Choice()
Default Constructor.
 o Choice
  public Choice(methodRef mr)
Constructor.
Parameters:
mr - method reference to callbackable method. mr must have the target object set.
See Also:
setTarget
 o Choice
  public Choice(Object target,
                String method) throws InvalidMethodRefException
Constructor. An exception may be thrown because it generates a methodRef from the target, method parameter pair.
Parameters:
target - object which is target of the called back method
method - string representation of method to invoke on target object.
Throws: InvalidMethodRefException
generated if creation of callback fails

Methods

 o addActionCallback
  public void addActionCallback(methodRef aMethodRef)
Adds user defined methodRef. This is invoked when a ACTION_EVENT occurs. The methodRef must be defined using the utility class awtExt.Callback
Parameters:
aMethodRef - ACTION_EVENT event handling method. aMethodRefmust have the target object set.
See Also:
setTarget, Callback, methodRef
 o action
  public boolean action(Event evt,
                        Object obj)
Called when an action occurs. This in turn calls back a user defined method on a target object. The called back method *AND* the target object must have a specific signature.
Parameters:
evt - The action event that just occurred.
obj - The label of this object.
Overrides:
action in class Component
See Also:
Callback, CallbackInfo

All Packages  Class Hierarchy  This Package  Previous  Next  Index