Hi,
1. There is another example of using custom events in the Ext GWT
sample. Take a look at the main page presenter:
-> MainPagePresenter:
...
@Inject
public MainPagePresenter(final EventBus eventBus, MyView view,
MyProxy proxy,
PlaceManager placeManager) {
super(eventBus, view, proxy, placeManager);
getView().setUiHandlers(this);
MainPagePresenter.navigationPaneHeader =
getView().getNavigationPaneHeader();
getEventBus().addHandler(NavigationPaneUpdateEvent.getType(), new
NavigationPaneUpdateEventHandler() {
@Override
public void onUpdateNavigationPane(NavigationPaneUpdateEvent
event) {
Log.debug("onUpdateNavigationPane(NavigationPaneUpdateEvent
event)");
getNavigationPaneHeader().setHeadingText(event.getDisplayName());
}
});
}
->
2. In order to support multiple form factors (desktop, tablet, mobile)
the Serendipity sample uses the "Ginjector provider" approach - so
that you can bind different Gin Modules to different Ginjector's.
Take a look the module definition file (gwt.xml) and the files in the
"com.gwtcx.sample.serendipity.client.gin" package.
-> DesktopGinjectorProvider:
public class DesktopGinjectorProvider implements GinjectorProvider {
@Override
public SerendipityGinjector get() {
Log.debug("DesktopGinjectorProvider - get()");
return GWT.create(DesktopGinjector.class);
}
}
->
-> DesktopGinjector:
@GinModules({DispatchAsyncModule.class, SharedGinModule.class,
DesktopGinModule.class})
public interface DesktopGinjector extends SerendipityGinjector {
}
->
-> DesktopGinModule:
public class DesktopGinModule extends AbstractPresenterModule {
@Override
protected void configure() {
//
// Presenters
//
bindPresenter(MainPagePresenter.class,
MainPagePresenter.MyView.class,
MainPageDesktopView.class, MainPagePresenter.MyProxy.class);
bindPresenter(DashboardsPresenter.class,
DashboardsPresenter.MyView.class,
DashboardsDesktopView.class,
DashboardsPresenter.MyProxy.class);
}
}
->