use of org.jetbrains.idea.maven.utils.RepositoryAttachDialog in project intellij-community by JetBrains.
the class RepositoryAttachHandler method chooseLibraryAndDownload.
@Nullable
public static NewLibraryConfiguration chooseLibraryAndDownload(@NotNull final Project project, @Nullable final String initialFilter, JComponent parentComponent) {
RepositoryAttachDialog dialog = new RepositoryAttachDialog(project, initialFilter);
dialog.setTitle("Download Library From Maven Repository");
dialog.show();
if (dialog.getExitCode() != DialogWrapper.OK_EXIT_CODE) {
return null;
}
String copyTo = dialog.getDirectoryPath();
String coord = dialog.getCoordinateText();
boolean attachJavaDoc = dialog.getAttachJavaDoc();
boolean attachSources = dialog.getAttachSources();
List<MavenRepositoryInfo> repositories = dialog.getRepositories();
@Nullable NewLibraryConfiguration configuration = resolveAndDownload(project, coord, attachJavaDoc, attachSources, copyTo, repositories);
if (configuration == null) {
Messages.showErrorDialog(parentComponent, ProjectBundle.message("maven.downloading.failed", coord), CommonBundle.getErrorTitle());
}
return configuration;
}
Aggregations