private void doImport()

in src/main/java/com/googlesource/gerrit/plugins/importer/client/ImportProjectScreen.java [85:130]


  private void doImport() {
    final String targetName =
        getValue(targetNameTxt).length() == 0 ? getValue(srcNameTxt) : getValue(targetNameTxt);

    ImportProjectInput in = ImportProjectInput.create();
    in.from(getValue(fromTxt));
    in.name(getValue(srcNameTxt));
    in.user(getValue(userTxt));
    in.pass(getValue(passTxt));
    in.parent(getValue(parentTxt));

    new RestApi("config")
        .id("server")
        .view(Plugin.get().getName(), "projects")
        .id(targetName)
        .put(
            in,
            new AsyncCallback<ImportStatisticInfo>() {

              @Override
              public void onSuccess(ImportStatisticInfo result) {
                clearForm();
                Plugin.get().go("/admin/projects/" + targetName);

                final DialogBox successDialog = new DialogBox();
                successDialog.setText("Project Import");
                successDialog.setAnimationEnabled(true);

                Panel p = new VerticalPanel();
                p.setStyleName("importer-message-panel");
                p.add(new Label("The project was imported."));
                p.add(new Label("Created Changes: " + result.numChangesCreated()));
                Button okButton = new Button("OK");
                okButton.addClickHandler(event -> successDialog.hide());

                p.add(okButton);
                successDialog.add(p);

                successDialog.center();
                successDialog.show();
              }

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