Hi all,

We are using MVP as much as possible, but it has been a pain so far,
not a lot of documentation. There is one thing that we really couldn't
get right. Please see how much boilerplate blabla this application
needs, and see how ugly the class at the end is. We don't want the
class near the end. And if someone has a tip how to clean up this
code, please! Thanks a lot!

Baloe

public class OurApp implements EntryPoint {

        @Override
        public void onModuleLoad() {

                AppGinjector injector = GWT.create(AppGinjector.class);
                Root app = new Root();

                EventBus eventBus = injector.getEventBus();
                PlaceController placeController = injector.getPlaceController();
                ActivityMapper activityMapper = injector.getActivityMapper();

                ActivityManager activityManager = new
ActivityManager(activityMapper, eventBus);
                activityManager.setDisplay(app);

                AppPlaceHistoryMapper historyMapper =
GWT.create(AppPlaceHistoryMapper.class);
                PlaceHistoryHandler historyHandler = new
PlaceHistoryHandler(historyMapper);
                historyHandler.register(placeController, eventBus,
((AppPlaceController) placeController).getDefault());

                historyHandler.handleCurrentHistory();
                RootLayoutPanel.get().add(app);

                Resources.Instance.css().ensureInjected();
        }

        private class Root extends LayoutPanel implements AcceptsOneWidget {
                @Override
                public void setWidget(IsWidget w) {
                        if (w == null) {
                                clear();
                        } else {
                                add(w);
                        }
                }

        }

}


-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to