NewLibraryConfiguration (@NotNull LibraryRootsComponentDescriptor descriptor, @NotNull JComponent parentComponent, @Nullable VirtualFile contextDirectory, LibraryType<?> type, final Project project) { final FileChooserDescriptor chooserDescriptor = descriptor.createAttachFilesChooserDescriptor(null); chooserDescriptor.setTitle(ProjectBundle.message("chooser.title.select.library.files")); final VirtualFile[] rootCandidates = FileChooser.chooseFiles(chooserDescriptor, parentComponent, project, contextDirectory); if (rootCandidates.length == 0) { return null; } final List<OrderRoot> roots = RootDetectionUtil.detectRoots(Arrays.asList(rootCandidates), parentComponent, project, descriptor); if (roots.isEmpty()) return null; String name = suggestLibraryName(roots); return doCreate(type, name, roots); }