You're aware that addHandler* returns a HandlerRegistration object correct? You can call remove the handler by doing
HandlerRegistration r = eventBus.addHandler(...); r.removeHandler(); but most times, you won't need to track HandlerRegistration objects or call remove handler since an event bus decorator called ResettableEventBus is usually what is received from activities. That being said, I find it useful to have a pool class that is used from custom widgets where an event bus is not passed in but used internally. To answer your question. HandlerManager is deprecated. HandlerManager.HandlerRegistry has been renamed SimpleEventBus On Sep 12, 11:54 am, jarrod <[email protected]> wrote: > Ray, > > I read through as much of the review as I could. Forgive me, but it's > an awful lot of information to wrap my head around, especially without > some context to consider it in. > > If I understood the gist of it correctly, it sounds like the problem > is overuse of HandlerManager for tasks it was not originally designed > for. The refactoring goal, then, is separation of concerns; namely > that HandlerManager should be relegated to support of DOM events in > Widgets, while EventBus is a new but related class designed to handle > application-level event notification. > > Did I get that right? > > Even so, I think it would still be helpful to have a removeHandler > method on the EventBus for convenience. > > On Sep 11, 9:32 pm, Ray Ryan <[email protected]> wrote: > > > > > Please see the discussion here: > > >http://gwt-code-reviews.appspot.com/841804/show > > > We much prefer to keep the api minimal. > > > On Sat, Sep 11, 2010 at 5:24 PM, jarrod <[email protected]> wrote: > > > Is there any reason NOT to add the following method to the EventBus > > > interface? > > > > <H extends EventHandler> void removeHandler(GwtEvent.Type<H> type, H > > > handler); > > > > This would make it much easier to adopt the use of EventBus throughout > > > my application instead of referring to the HandlerManager concrete > > > implementation. > > > > Shoot, maybe all of HandlerManager's public methods should be part of > > > the EventBus interface? > > > >http://code.google.com/p/google-web-toolkit/issues/detail?id=5271 > > > > -- > > >http://groups.google.com/group/Google-Web-Toolkit-Contributors -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
