public void onModuleLoad() {
EventBus eventBus = new SimpleEventBus();
final PlaceController placeController = new PlaceController(eventBus);
Desktop display = GWT.create(Desktop.class);
if (display instanceof HasEventBus) {
HasEventBus hasEventBus = (HasEventBus) display;
hasEventBus.setEventBus(eventBus);
}
if (display instanceof HasPlaceController) {
HasPlaceController hasPlaceController = (HasPlaceController) display;
hasPlaceController.setPlaceController(placeController);
}
display.initDesktop();
// Start ActivityManager for the main widget with our ActivityMapper
ActivityMapper activityMapper = new PresenterActivityMapper((PlacePresenterFactory) GWT.create(PlacePresenterFactory.class));
ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
activityManager.setDisplay(display);