Пример #1
0
  protected void setup() {
    RootPanel.get().add(mainPresenter.getDisplay().asWidget());

    mainPresenter.bind();
    History.addValueChangeHandler(this);

    eventBus.addHandler(
        LoginSuccessfulEvent.TYPE,
        new LoginSuccessfulEventHandler() {
          @Override
          public void loginSuccessful(LoginSuccessfulEvent event) {
            History.newItem(getPreviousHistoryToken());
          }
        });

    eventBus.addHandler(
        LoginRequiredEvent.TYPE,
        new LoginRequiredEventHandler() {
          @Override
          public void loginRequired(LoginRequiredEvent event) {
            if (!AppPlace.HOME.equals(getPlace(History.getToken()))) {
              History.newItem(AppPlace.HOME.getToken());
            }
          }
        });

    switchSection(History.getToken());
  }
Пример #2
0
 public FlowPanel getLayout() {
   return mainPresenter.getDisplay().getLayout();
 }