void () { String testUrl = getCurrentUrlText(); if (myRepositoryTestProgressIndicator != null) { myRepositoryTestProgressIndicator.cancel(); myRepositoryTestProgressIndicator = null; } myRepositoryTestProgressIndicator = mySpinnerProgressManager .run(new Task.Backgroundable(myProject, DvcsBundle.message("clone.repository.url.test.title", testUrl), true) { private TestResult myTestResult; @Override public void run(@NotNull ProgressIndicator indicator) { myTestResult = test(testUrl); } @Override public void onSuccess() { if (myTestResult.isSuccess()) { myRepositoryTestValidationInfo = null; Disposable dialogDisposable = getDisposable(); if (Disposer.isDisposed(dialogDisposable)) return; JBPopupFactory.getInstance() .createBalloonBuilder(new JLabel(DvcsBundle.message("clone.repository.url.test.success.message"))) .setDisposable(dialogDisposable) .createBalloon() .show(new RelativePoint(myTestButton, new Point(myTestButton.getWidth() / 2, myTestButton.getHeight())), Balloon.Position.below); } else { myRepositoryTestValidationInfo = new ValidationInfo(DvcsBundle.message("clone.repository.url.test.failed.message", XmlStringUtil.escapeString(myTestResult.myErrorMessage)), myRepositoryUrlCombobox); startTrackingValidation(); } myRepositoryTestProgressIndicator = null; } }); }