On the surface, a Handler is just a Listener, but with only 1 event method. Event Handlers also don't have a removeOnClickHandler method, instead the add method returns a registration object that can be used to de-register that handler.
Underneath, Handlers are a very different beast. All of the Handlers for a specific Widget are registered with the same HandlerManager, thus no more needs for a ClickListenerCollection and a MouseListenerCollection and a KeyboardListenerCollection, etc. The HandlerManager will also manage any Handlers and Events that you invent and want to add to the Widget. On top of that, DOM events (click, mouse, keyboard, etc) are handled specially and only sinkEvents when the related handler is added. The result of this "uniform event mechanism" is that the amount of code GWT generates is a lot less, and consumes less memory than the old Listener mechanism. More detail available on my blog: http://lemnik.wordpress.com/2009/03/04/gwts-new-event-model-handlers-in-gwt-16/ http://lemnik.wordpress.com/2009/03/12/using-event-handlers-in-gwt-16/ Hope that helps a bit. //J Ved wrote: > Hi, > > I have a query regarding the listners which are exposed by GWT1.6 API > for the widgets Comparing the same with GWT 1.5 > > I have seen a drastic change in the listner API exposed by the GWT 1.6 > for Eg: > addClickListner is not present in GWT1.6 it has addClickHandler > > > Can i know why these listeners are deprecated and what advantage i get > it from Using 1.6 rather than GWT 1.5 > > > Thanks & Regards, > Ved Prakash Kamishetty > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
