/** This is the entry point method. */
  public void onModuleLoad() {
    LoginServiceAsync loginService = GWT.create(LoginService.class);
    loginService.login(
        GWT.getHostPageBaseURL(),
        new AsyncCallback<LoginInfo>() {
          @Override
          public void onFailure(Throwable caught) {
            handleError(caught);
          }

          @Override
          public void onSuccess(LoginInfo result) {
            loginInfo = result;
            if (result.isLoggedIn()) {
              app = new GoogleStudentApp(loginInfo);
              RootPanel.get("main").add(app.getMainPanel());
            } else {
              app = new GoogleStudentApp(loginInfo);
              IView notLoggedIn = new NotLoggedInView(loginInfo);
              app.addView(notLoggedIn);
              RootPanel.get("main").add(app.getMainPanel());
            }
          }
        });
  }
Beispiel #2
0
  public void onModuleLoad() {
    // Check login status using login service.
    loginService.login(
        GWT.getHostPageBaseURL(),
        new AsyncCallback<LoginInfo>() {
          public void onFailure(Throwable error) {
            // TODO render error div
          }

          public void onSuccess(LoginInfo result) {
            loginInfo = result;
            if (loginInfo.isLoggedIn()) {
              loadLogout();
              loadKirinData();
            } else {
              loadLogin();
            }
          }
        });
  }