Free EcmaScript Interpreter. 
A JavaScript interpreter written in Java.

 
Language extensions - Event processing
The event processing mechanism is very similar to the Netscape event processing by the syntax, but differ in its semantic. These differences are required because the goal is different. The FESI event processing capability is targeted to the processing of Java 1.1 events (as found in the AWT, Beans and Swing), and not to a specific browser environment. The event mechanism can be used both for beans and for non bean objects (as long as they follow the Java 1.1 event model).

The FESI event processing is capable to handle any Java 1.1 event, the event adaptor is built dynamically as needed.

If FESI is used as an embedded scripting capability in another product, the built-in event extension capability can be used or another set of capabilities can be developed, at the programmer choice.

Event procedures are of two kinds: functions (with the event as the parameter) or string to be evaluated. The parsing is done at the time of event establishement and parsing error are raised there. If a string if used, the variable event is bound to the first parameter of the handler method. The variable this is bound to the object for which the variable was registered. Only one event of a type can be registered on any object (that is on its wrapper). The event handler is unregistered by using null as event handler.

The event parameter is the Java event value (wrapped as an EcmaScript value), and can be used as any other Java value.
The name of the event is as follow:
    1. For event listener which have a single function handler (as ActionEvent), either the name of the event or the name of the event handler (preceded by "on") can be used.
    2. For event listener which have multiple event handlers (as WindowEvent), the name of the function must be used (preceded by "on").
Remarks:
Return to the main page

Last update: 12 March 1998