use of com.intellij.openapi.roots.SyntheticLibrary in project intellij-community by JetBrains.
the class SyntheticLibraryElementNode method getChildren.
@NotNull
@Override
public Collection<AbstractTreeNode> getChildren() {
List<AbstractTreeNode> children = new ArrayList<>();
SyntheticLibrary library = getLibrary();
Project project = Objects.requireNonNull(getProject());
PsiManager psiManager = PsiManager.getInstance(project);
for (VirtualFile file : library.getSourceRoots()) {
if (!file.isValid())
continue;
if (file.isDirectory()) {
PsiDirectory psiDir = psiManager.findDirectory(file);
if (psiDir != null) {
children.add(new PsiDirectoryNode(project, psiDir, getSettings()));
}
} else {
PsiFile psiFile = psiManager.findFile(file);
if (psiFile != null) {
children.add(new PsiFileNode(project, psiFile, getSettings()));
}
}
}
return children;
}
Aggregations