To respond to events, we create listener objects.
A listener is an object whose class implements an appropriate interface; in GXT it's the
Listener
interfaceSelectionListener
is a listener implementation used to listen for selections such as button pressesThe method
handleEvent()
, orcomponentSelected()
in the case of a button, contains the code to run when the event is firedThe listener is attached to a GUI component using the
addListener()
method oraddSelectionListener()
for a button
As of version 2.0, GWT uses handlers for its event handling. GXT version 3.0 will move from using listeners to using handlers, so that it will be compatible with the GWT event handling mechanism. This compatibility will also allow GXT 3.0 to add support for GWT UIBinder. UIBinder
is used for building a UI in a declarative way, using an XML file, in order to cut down on boilerplate code and provide more flexible layouts.