Exemplo n.º 1
0
 /** {@inheritDoc} */
 @Override
 public void onGenerateGithubKeyClicked() {
   CurrentUser user = appContext.getCurrentUser();
   if (user != null && service.getSshKeyProviders().containsKey(GITHUB_HOST)) {
     generateGithubKey(user);
   } else {
     notificationManager.showError(constant.sshKeysProviderNotFound(GITHUB_HOST));
   }
 }
Exemplo n.º 2
0
  private void generateGithubKey(CurrentUser user) {
    service
        .getSshKeyProviders()
        .get(GITHUB_HOST)
        .generateKey(
            user.getProfile().getId(),
            new AsyncCallback<Void>() {
              @Override
              public void onSuccess(Void result) {
                refreshKeys();
              }

              @Override
              public void onFailure(Throwable exception) {
                getFailedKey(GITHUB_HOST);
              }
            });
  }