Example #1
0
  /** {@inheritDoc} */
  @Override
  public void onGenerateClicked() {
    String host = Window.prompt(constant.hostNameField(), "");
    if (!host.isEmpty()) {
      service.generateKey(
          host,
          new AsyncRequestCallback<Void>() {
            @Override
            protected void onSuccess(Void result) {
              refreshKeys();
            }

            @Override
            protected void onFailure(Throwable exception) {
              notificationManager.showError(
                  SafeHtmlUtils.fromString(exception.getMessage()).asString());
              eventBus.fireEvent(new ExceptionThrownEvent(exception));
            }
          });
    }
  }