void () { @NotNull RepositoryLibraryProperties properties = myEditorComponent.getProperties(); //String oldVersion = properties.getVersion(); boolean wasGeneratedName = RepositoryLibraryType.getInstance().getDescription(properties).equals(myEditorComponent.getLibraryEditor().getName()); final EnumSet<ArtifactKind> artifactKinds = ArtifactKind.kindsOf(libraryHasSources(myEditorComponent.getLibraryEditor()), libraryHasJavaDocs(myEditorComponent.getLibraryEditor()), properties.getPackaging()); if (libraryHasExternalAnnotations(myEditorComponent.getLibraryEditor())) { artifactKinds.add(ArtifactKind.ANNOTATIONS); } final Project project = myEditorComponent.getProject(); assert project != null : "EditorComponent's project must not be null in order to be used with RepositoryLibraryWithDescriptionEditor"; RepositoryLibraryPropertiesModel model = new RepositoryLibraryPropertiesModel( properties.getVersion(), artifactKinds, properties.isIncludeTransitiveDependencies(), properties.getExcludedDependencies(), RemoteRepositoriesConfiguration.getInstance(project).getRepositories(), properties.getJarRepositoryId()); boolean isGlobalLibrary = false; LibraryEditor editor = myEditorComponent.getLibraryEditor(); if (editor instanceof ExistingLibraryEditor libraryEditor && libraryEditor.getLibrary() instanceof LibraryEx libraryEx) { LibraryTable table = libraryEx.getTable(); isGlobalLibrary = table != null && LibraryTablesRegistrar.APPLICATION_LEVEL.equals(table.getTableLevel()); } RepositoryLibraryPropertiesDialog dialog = new RepositoryLibraryPropertiesDialog( project, model, RepositoryLibraryDescription.findDescription(properties), true, true, isGlobalLibrary); if (!dialog.showAndGet()) { return; } myEditorComponent.getProperties().changeVersion(model.getVersion()); myEditorComponent.getProperties().setIncludeTransitiveDependencies(model.isIncludeTransitiveDependencies()); myEditorComponent.getProperties().setExcludedDependencies(model.getExcludedDependencies()); myEditorComponent.getProperties().setJarRepositoryId(model.getRemoteRepositoryId()); if (wasGeneratedName) { myEditorComponent.renameLibrary(RepositoryLibraryType.getInstance().getDescription(properties)); } final LibraryEditor libraryEditor = myEditorComponent.getLibraryEditor(); final String copyTo = getStorageRoot(myEditorComponent.getLibraryEditor().getUrls(OrderRootType.CLASSES)); final Collection<OrderRoot> roots = JarRepositoryManager.loadDependenciesModal( project, properties.getRepositoryLibraryDescriptor(), model.getArtifactKinds(), null, copyTo ); if (roots == null || RepositoryLibraryUtils.isVerifiableRootsChanged(libraryEditor, roots)) { /* Reset verification if verifiable roots changed */ /* If auto-rebuild enabled, RepositoryLibraryChangeListener will handle the change and build verification for new roots */ myEditorComponent.getProperties().setArtifactsVerification(Collections.emptyList()); } libraryEditor.removeAllRoots(); if (roots != null) { libraryEditor.addRoots(roots); } myEditorComponent.updateRootsTree(); updateDescription(); }