| java.lang.Object org.pnuts.beans.EventAdapter
EventAdapter | public class EventAdapter (Code) | | This class generates an event adapter for a particular listener type and callback method.
In Pnuts,
import("java.awt.event.*")
adapterClass = generateEventAdapter(ActionListener, "actionPerformed")
adapter = adapterClass(function (e) ... , getContext())
|
Method Summary | |
public static Class | generateEventAdapter(Class listenerType, String methodName) Generate an adapter class for bean events.
The generated class implements the the specified listenerType.
The constructor has two arguments (PnutsFunction, Context). | public static ClassFile | getClassFileForEventAdapter(String className, Class listenerType, String methodName) Creates a class file of a event adapter that implements the specified listenerType. |
hasJava2Security | static boolean hasJava2Security(Code) | | |
generateEventAdapter | public static Class generateEventAdapter(Class listenerType, String methodName)(Code) | | Generate an adapter class for bean events.
The generated class implements the the specified listenerType.
The constructor has two arguments (PnutsFunction, Context). The method methodName
calls a function which is specified as a parameter of the constructor.
Parameters: listenerType - a Class object of a EventListener subclass Parameters: methodName - a method name of the listener type. a Class object of the generated class |
getClassFileForEventAdapter | public static ClassFile getClassFileForEventAdapter(String className, Class listenerType, String methodName)(Code) | | Creates a class file of a event adapter that implements the specified listenerType.
The constructor of the created class takes PnutsFunction and Context as the parameters.
When the corresponding event is observed, the PnutsFunction is called in the Context.
Parameters: className - the class name of the event adapter Parameters: listenerType - a Class object of a EventListener subclass Parameters: methodName - a method name of the listener type. |
|
|