use of com.intellij.openapi.roots.PersistentOrderRootType in project intellij-community by JetBrains.
the class LibraryRootsComponent method getNotExcludedRoots.
private Set<VirtualFile> getNotExcludedRoots() {
Set<VirtualFile> roots = new LinkedHashSet<>();
String[] excludedRootUrls = getLibraryEditor().getExcludedRootUrls();
Set<VirtualFile> excludedRoots = new HashSet<>();
for (String url : excludedRootUrls) {
ContainerUtil.addIfNotNull(excludedRoots, VirtualFileManager.getInstance().findFileByUrl(url));
}
for (PersistentOrderRootType type : OrderRootType.getAllPersistentTypes()) {
VirtualFile[] files = getLibraryEditor().getFiles(type);
for (VirtualFile file : files) {
if (!VfsUtilCore.isUnder(file, excludedRoots)) {
roots.add(PathUtil.getLocalFile(file));
}
}
}
return roots;
}
use of com.intellij.openapi.roots.PersistentOrderRootType in project intellij-community by JetBrains.
the class ProjectRootContainerImpl method readOldVersion.
@SuppressWarnings({ "HardCodedStringLiteral" })
void readOldVersion(Element child) {
for (Element root : child.getChildren("root")) {
String url = root.getAttributeValue("file");
SimpleProjectRoot projectRoot = new SimpleProjectRoot(url);
String type = root.getChild("property").getAttributeValue("value");
for (PersistentOrderRootType rootType : OrderRootType.getAllPersistentTypes()) {
if (type.equals(rootType.getOldSdkRootName())) {
addRoot(projectRoot, rootType);
break;
}
}
}
myFiles = new HashMap<>();
for (OrderRootType rootType : myRoots.keySet()) {
myFiles.put(rootType, myRoots.get(rootType).getVirtualFiles());
}
for (OrderRootType type : OrderRootType.getAllTypes()) {
final VirtualFile[] oldRoots = VirtualFile.EMPTY_ARRAY;
final VirtualFile[] newRoots = getRootFiles(type);
if (!Comparing.equal(oldRoots, newRoots)) {
fireRootsChanged();
break;
}
}
}
use of com.intellij.openapi.roots.PersistentOrderRootType in project intellij-community by JetBrains.
the class ProjectRootContainerImpl method readExternal.
@Override
public void readExternal(Element element) {
for (PersistentOrderRootType type : OrderRootType.getAllPersistentTypes()) {
read(element, type);
}
ApplicationManager.getApplication().runReadAction(() -> {
myFiles = new HashMap<>();
for (OrderRootType rootType : myRoots.keySet()) {
CompositeProjectRoot root = myRoots.get(rootType);
if (myNoCopyJars) {
setNoCopyJars(root);
}
myFiles.put(rootType, root.getVirtualFiles());
}
});
for (OrderRootType type : OrderRootType.getAllTypes()) {
final VirtualFile[] newRoots = getRootFiles(type);
final VirtualFile[] oldRoots = VirtualFile.EMPTY_ARRAY;
if (!Comparing.equal(oldRoots, newRoots)) {
fireRootsChanged();
break;
}
}
}
Aggregations