示例#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
  /** Loads a XML representation of the current scenario. */
  private void loadCurrentAsXML() {
    RPC.getScenarioManager()
        .getScenarioAsXML(
            new AsyncCallback<String>() {
              @Override
              public void onFailure(Throwable caught) {
                throw new RuntimeException(caught);
              }

              @Override
              public void onSuccess(String result) {
                textarea.setText(result);
              }
            });
  }
示例#3
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();
              }
            });
  }