I am 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 code above uses the new com.google.web.bindery.event.shared.EventBus . The problem occurs when I want to enter the event bus in the MVP Activities that implement the 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 them? Obviously, if I ask for an obsolete EventBus type, then Jin will complain because I did not specify a binding for him.
Refresh . This will allow you to create an application, but now there are two different EventBus s, which is terrible:
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); ...
source share