private void initListeners() { testConnectionButton.addActionListener(actionEvent -> { ServerConfiguration configuration = createServerConfigurationForTesting(); final Ref<Exception> excRef = new Ref<>(); final ProgressManager progressManager = ProgressManager.getInstance(); progressManager.runProcessWithProgressSynchronously(() -> { final ProgressIndicator progressIndicator = progressManager.getProgressIndicator(); if (progressIndicator != null) { progressIndicator.setText("Connecting to Mongo server..."); } try { mongoManager.connect(configuration); } catch (Exception ex) { excRef.set(ex); } }, "Testing Connection", true, ServerConfigurationPanel.this.project); if (!excRef.isNull()) { Messages.showErrorDialog(rootPanel, excRef.get().getMessage(), "Connection Test Failed"); } else { Messages.showInfoMessage(rootPanel, "Connection test successful", "Connection Test Successful"); } }); }
DownloadResourcesRunnable downloadResourcesRunnable = new DownloadResourcesRunnable(); ProgressManager.getInstance() .runProcessWithProgressSynchronously( downloadResourcesRunnable, "Loading SonarQube resources from server",
/** * Runs the process that enables the set of {@link CloudLibrary apis} on GCP. * * @param apisToEnable the APIs selected by the user for enablement */ private void runApiEnablement(Set<CloudLibrary> apisToEnable) { ProgressManager.getInstance() .runProcessWithProgressSynchronously( () -> CloudApiManager.enableApis(apisToEnable, getCloudProject(), project), GoogleCloudApisMessageBundle.message("cloud.apis.enable.progress.title"), true /*canBeCanceled*/, project); }
/** * Runs the process that creates the service account and generates the service account key file. * * @param selectedRoles the {@link Role roles} selected by the user * @param serviceAccountName the name of the service account * @param serviceAccountKeyDownloadPath the {@link Path} to the chosen download folder */ private void runServiceAccountManagement( Set<Role> selectedRoles, String serviceAccountName, Path serviceAccountKeyDownloadPath) { ProgressManager.getInstance() .runProcessWithProgressSynchronously( () -> CloudApiManager.createServiceAccountAndDownloadKey( selectedRoles, serviceAccountName, serviceAccountKeyDownloadPath, getCloudProject(), project), GoogleCloudApisMessageBundle.message( "cloud.apis.service.account.create.progress.title"), true /*canBeCanceled*/, project); }
@Override public ProjectData loadCoverageData(@NotNull File sessionDataFile, @Nullable CoverageSuite baseCoverageSuite) { if (!(baseCoverageSuite instanceof PerlCoverageSuite)) { return null; } if (ApplicationManager.getApplication().isDispatchThread()) { final Ref<ProjectData> projectDataRef = new Ref<>(); ProgressManager.getInstance().runProcessWithProgressSynchronously( () -> projectDataRef.set(doLoadCoverageData(sessionDataFile, (PerlCoverageSuite)baseCoverageSuite)), "Loading Coverage Data...", true, baseCoverageSuite.getProject()); return projectDataRef.get(); } else { return doLoadCoverageData(sessionDataFile, (PerlCoverageSuite)baseCoverageSuite); } }
progressManager.runProcessWithProgressSynchronously(() -> { final ProgressIndicator indicator = progressManager.getProgressIndicator(); if (indicator != null) {
.runProcessWithProgressSynchronously( () -> AppEngineAdminService.getInstance()