예제 #1
0
  private boolean rememberMe() {
    final String accountName = Cookies.getCookie(COOKIE_RM_ACCOUNT);
    final String token = Cookies.getCookie(COOKIE_RM_TOKEN);

    if (accountName != null && token != null) {
      RPC.getAccountManagementRPC()
          .login(
              accountName,
              token,
              new AsyncCallback<LoginResponse>() {
                @Override
                public void onSuccess(LoginResponse result) {
                  handleLoginResponse(result, accountName, true);
                }

                @Override
                public void onFailure(Throwable caught) {
                  throw new IllegalStateException(caught);
                }
              });
      return true;
    } else {
      return false;
    }
  }
예제 #2
0
  private void getAccountSettings() {
    RPC.getAccountManagementRPC()
        .getAccountDetails(
            new AsyncCallback<AccountDetails>() {

              @Override
              public void onFailure(Throwable caught) {
                throw new RuntimeException(caught);
              }

              @Override
              public void onSuccess(AccountDetails result) {
                Manager.get().setAccountDetails(result);
                SoPeCoUI.get().initializeMainView();
              }
            });
  }