MVP GWT 2.4 で Gin を使用しようとしています。私のモジュールには、次のものがあります。
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);
...
}
上記のコードでは、新しいcom.google.web.bindery.event.shared.EventBus
. アクティビティを実装する MVP アクティビティにイベント バスを挿入したい場合に問題が発生します。
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
非推奨の を使用しcom.google.gwt.event.shared.EventBus
ます。どうすれば2つを調和させることができますか? 明らかに、非推奨タイプの EventBus を要求すると、そのバインディングを指定していないため、Gin は文句を言うでしょう。
更新: これにより、アプリをビルドできるようになりますが、今では 2 つの異なるEventBus
s があり、これはひどいものです:
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);
...