Ejemplo n.º 1
0
 public static ConsoleDialog startConsoleDialog(ConsoleDialogListener listener) {
   if (logger.isLoggable(Level.FINE)) {
     logger.fine("startConsoleDialog");
   }
   ConsoleDialog dialog = new ConsoleDialog(listener);
   dialog.center();
   dialog.startConsole();
   return dialog;
 }
Ejemplo n.º 2
0
  private void changeKaaHost() {
    final String host = view.getKaaHost().getValue();
    if (host != null && host.length() > 0) {
      view.clearError();
      ConsoleDialog.startConsoleDialog(
          new ConsoleDialogListener() {

            @Override
            public void onOk(boolean success) {}

            @Override
            public void onStart(
                String uuid, final ConsoleDialog dialog, final AsyncCallback<Void> callback) {
              Sandbox.getSandboxService()
                  .changeKaaHost(
                      uuid,
                      host,
                      new AsyncCallback<Void>() {
                        @Override
                        public void onFailure(Throwable caught) {
                          callback.onFailure(caught);
                        }

                        @Override
                        public void onSuccess(Void result) {
                          dialog.appendToConsoleAtFinish(
                              "Succesfully changed kaa host to '" + host + "'\n");
                          callback.onSuccess(result);
                        }
                      });
            }
          });
    } else {
      view.setErrorMessage(Utils.messages.emptyKaaHostError());
    }
  }