Looks good to me. Do you still need the patch that brings back GwtEvent.setSource, or is this enough by itself?
On Thu, May 19, 2011 at 3:58 PM, <[email protected]> wrote: > Reviewers: rjrjr, > > Description: > Adds two protected static methods to EventBus that expose otherwise > inaccessible methods on Event (setSource and dispatch) to subclasses of > EventBus. > > This is not a huge deal to me, but, in general, it would be nice to move > my EventBus implementation out of a c.g package. These two methods are > the key to doing so, and the protected static method approach seemed > like a reasonable way to expose them to only a small subset of user code > (namely subclasses of EventBus). > > > Please review this at http://gwt-code-reviews.appspot.com/1443804/ > > Affected files: > user/src/com/google/web/bindery/event/shared/EventBus.java > > > Index: user/src/com/google/web/bindery/event/shared/EventBus.java > =================================================================== > --- user/src/com/google/web/bindery/event/shared/EventBus.java (revision > 10188) > +++ user/src/com/google/web/bindery/event/shared/EventBus.java (working > copy) > @@ -30,6 +30,24 @@ > */ > public abstract class EventBus { > > + /** Invokes {@code event.dispatch} with {@code handler}. > + * > + * This allows EventBus implementations in different packages to > dispatch > + * events even though the {@code event.dispatch} method is protected. > + */ > + protected static <H> void dispatchEvent(Event<H> event, H handler) { > + event.dispatch(handler); > + } > + > + /** Sets {@code source} as the source of {@code event}. > + * > + * This allows EventBus implementations in different packages to set an > + * event source even though the {@code event.setSource} method is > protected. > + */ > + protected static void setSourceOnEvent(Event<?> event, Object source) { > + event.setSource(source); > + } > + > /** > * Adds an unfiltered handler to receive events of this type from all > sources. > * <p> > > > -- > http://groups.google.com/group/Google-Web-Toolkit-Contributors > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
