use of com.intellij.openapi.projectRoots.ex.ProjectRoot in project intellij-community by JetBrains.
the class ProjectJdkImpl method getRoots.
@Override
public VirtualFile[] getRoots(OrderRootType rootType) {
// use getRoots() cause the data is most up-to-date there
final ProjectRoot[] roots = myRootContainer.getRoots(rootType);
final List<VirtualFile> files = new ArrayList<>(roots.length);
for (ProjectRoot root : roots) {
ContainerUtil.addAll(files, root.getVirtualFiles());
}
return VfsUtilCore.toVirtualFileArray(files);
}
use of com.intellij.openapi.projectRoots.ex.ProjectRoot in project intellij-community by JetBrains.
the class ProjectJdkImpl method copyRoots.
static void copyRoots(@NotNull ProjectRootContainerImpl rootContainer, @NotNull ProjectJdkImpl dest) {
dest.myRootContainer.startChange();
dest.myRootContainer.removeAllRoots();
for (OrderRootType rootType : OrderRootType.getAllTypes()) {
final ProjectRoot[] newRoots = rootContainer.getRoots(rootType);
for (ProjectRoot newRoot : newRoots) {
dest.myRootContainer.addRoot(newRoot, rootType);
}
}
dest.myRootContainer.finishChange();
}
Aggregations