|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.aria.EventHandler
org.formaria.scripts.groovy.GroovyEventHandler
public class GroovyEventHandler
Copyright (c) Formaria Ltd., 2008
License: see license.txt
| Field Summary |
|---|
| Fields inherited from class org.formaria.aria.EventHandler |
|---|
changeCounter, configFiles, container, currentEvt, currentProject, handlers, localChangeCounter, mouseDownComponent, mouseEventInvoked, registrations, suppressFocusEvents, xValidationHandler |
| Constructor Summary | |
|---|---|
GroovyEventHandler(Project project,
java.lang.Object c,
ValidationHandler vh)
Create an event handler |
|
| Method Summary | |
|---|---|
MethodReference |
addHandler(java.lang.Object comp,
long eventType,
java.lang.String methodStr)
Adds an event handler. |
java.lang.reflect.Method |
findEvent(java.lang.Object src,
long eventType)
Lookup an event for a component. |
boolean |
invoke(long eventType,
java.util.EventObject evt)
Invokes an event. |
void |
removeHandlers(java.lang.Object comp)
Remove all the event handlers for a particular object |
| Methods inherited from class org.formaria.aria.EventHandler |
|---|
actionPerformed, addConfigFile, addHandler, addHandler, addListener, checkRegistration, clearMouseClick, doRead, doRead, doRead, focusGained, focusLost, getCurrentEvent, getValidationHandler, isFocusChangeSuppressed, itemStateChanged, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, read, read, read, suppressFocusEvents, textValueChanged, updateConfig, wasMouseClicked, wasMouseDoubleClicked, wasMouseRightClicked |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GroovyEventHandler(Project project,
java.lang.Object c,
ValidationHandler vh)
project - the owner projectc - the container/pagevh - the validation handler| Method Detail |
|---|
public boolean invoke(long eventType,
java.util.EventObject evt)
EventHandler
invoke in interface AriaEventHandlerinvoke in class EventHandlereventType - the event typeevt - the event object
public void removeHandlers(java.lang.Object comp)
EventHandler
removeHandlers in interface AriaEventHandlerremoveHandlers in class EventHandlercomp - the object whose events are being removed
public java.lang.reflect.Method findEvent(java.lang.Object src,
long eventType)
EventHandler
findEvent in interface AriaEventHandlerfindEvent in class EventHandlersrc - the event source componenteventType - the event type
public MethodReference addHandler(java.lang.Object comp,
long eventType,
java.lang.String methodStr)
throws java.lang.ClassNotFoundException,
java.lang.NoSuchMethodException
Adds an event handler. A specific handler such as the addActionHandler should be used instead of calling this method
The handler can also be defined in classes other than the current page or classes derived from Page. The syntax for such expressions is as follows:
mypackage.MyClass[referenceName].myMethod for a named object instancemypackage.MyClass[].myMethod to create a new instance of the class on each evaluationmypackage.MyClass.myMethod to invoke a static methodmyMethod[referenceName] for a method contained with the invoking pagea/b/c.myMethod for a method contained within in a model
node such as a POJO, where a/b/c refers to a POJOwhere mypackage is the name of the Java package containing the class MyClass. The value of referenceName is a user defined value that identifies the instance of the class. The application instantiates an instance of the class when the expression is first encountered and thereafter maintains the instance with each subsequent call retrieving the same instance of the class.
The page may also reference scripts with the expression ${script.XXXXX()}
where XXXXX is the name of the script method to be invoked.
addHandler in interface AriaEventHandleraddHandler in class EventHandlereventType - the event typemethodStr - the method to be invoked in response to the objectcomp - the component that fires the event
java.lang.ClassNotFoundException - The class cannot be found
java.lang.NoSuchMethodException - The specified method does not exist in the class
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||