Oh yes, that's nice. It's great to wrap the original event bus so we can still use it to send fireEvent() and use the instance from start() to add new handler. Very cool.
Thanks Thomas. 2010/11/4 Thomas Broyer <[email protected]> > > > On 4 nov, 09:46, Nicolas Antoniazzi <[email protected]> > wrote: > > Hello, > > > > This is just a quick question to gwt developpers to know what is the > reason > > to pass the EventBus to the start() method of Activity ? > > Is there something special about this instance ? > > Yes, it's actually a ResettableEventBus, so any handler added to it > will automatically be removed when the activity is stopped/cancelled, > and you don't have to track HandlerRegistrations yourself. > Here's what the Javadoc says: > """Any handlers attached to the provided event bus will be de- > registered when the activity is stopped, so activities will rarely > need to hold on to the HandlerRegistration instances returned by > EventBus.addHandler(com.google.gwt.event.shared.GwtEvent.Type, H).""" > > http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/activity/shared/Activity.html#start(com.google.gwt.user.client.ui.AcceptsOneWidget > , > com.google.gwt.event.shared.EventBus) > > -- > 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]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- 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.
