use of com.intellij.openapi.roots.ui.configuration.projectRoot.LibrariesContainer in project intellij-community by JetBrains.
the class MvcUpgradeAction method removeOldMvcSdk.
public static void removeOldMvcSdk(MvcFramework framework, ModifiableRootModel model) {
final LibraryPresentationManager presentationManager = LibraryPresentationManager.getInstance();
for (OrderEntry entry : model.getOrderEntries()) {
if (entry instanceof LibraryOrderEntry) {
final Library library = ((LibraryOrderEntry) entry).getLibrary();
final LibrariesContainer container = LibrariesContainerFactory.createContainer(model);
if (library != null) {
final VirtualFile[] files = container.getLibraryFiles(library, OrderRootType.CLASSES);
if (presentationManager.isLibraryOfKind(Arrays.asList(files), framework.getLibraryKind())) {
model.removeOrderEntry(entry);
}
}
}
}
}
Aggregations