I'm trying to use Gin in MVP GWT 2.4. In my module, I have:
import com.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.event.shared.SimpleEventBus;
@Override
protected void configure() {
bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);
...
}
The above code uses the new com.google.web.bindery.event.shared.EventBus
. The problem comes when I want to inject the event bus in MVP Activities that implement Activity:
package com.google.gwt.activity.shared;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
public interface Activity {
...
void start(AcceptsOneWidget panel, EventBus eventBus);
}
Activity
uses the deprecated com.google.gwt.event.shared.EventBus
. How can I reconcile the two? Obviously, if I ask for the deprecated type of EventBus, then Gin will complain because I didn't specify a binding for it.
Update: This will allow the app to build, but now there are two different EventBus
s, which is awful:
protected void configure() {
bind(com.google.gwt.event.shared.EventBus.class).to(
com.google.gwt.event.shared.SimpleEventBus.class).in(Singleton.class);
bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);
...