use of org.sonarlint.intellij.tasks.ServerDownloadProjectTask in project sonarlint-intellij by SonarSource.
the class SonarLintProjectBindPanel method downloadProjectList.
/**
* Assumes that it's bound and a server is selected
*/
@CheckForNull
private Map<String, RemoteModule> downloadProjectList() {
ApplicationManager.getApplication().assertIsDispatchThread();
SonarQubeServer selectedServer = getSelectedServer();
String storageId = getSelectedStorageId();
if (selectedServer == null || storageId == null) {
return null;
}
SonarLintEngineManager core = SonarLintUtils.get(SonarLintEngineManager.class);
ConnectedSonarLintEngine engine = core.getConnectedEngine(storageId);
ServerDownloadProjectTask downloadTask = new ServerDownloadProjectTask(project, engine, selectedServer);
try {
ProgressManager.getInstance().run(downloadTask);
return downloadTask.getResult();
} catch (Exception e) {
String msg = e.getMessage() != null ? e.getMessage() : "Failed to download list of projects";
Messages.showErrorDialog(rootPanel, msg, "Error Downloading Project List");
return null;
}
}
Aggregations