codeoncoffee / Shandor-Xul
Java UI Toolkit with support for Swing, SWT, GWT
$ hg clone http://bitbucket.org/codeoncoffee/shandor-xul/
Event Handlers (aka. Controllers)
Event handlers are the Java classes that your UI interacts with. Any events defined in the UI will be routed to the apporpriately named Event Handler instance. Below is a basic example to illustrate this interaction.
Sample Xul Document
Sample Event Handler
Adding Event Handlers Programatically
In the above example you saw how to create a handler in the Xul document. This is convenient for small applications or testing setups. However, for more complex applications that need to control the creation of classes (Spring, IoC), there's another way to register Event Handlers.
Locate the code where you're loading your Xul application. Specifically you need the XulDomContainer instance that was returned from the XulLoader. Create your XulEventHandler classes and pass them to the XulDomContainer.
This revision is from 2009-06-22 18:53
