use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class LibraryImpl method copyRootsFrom.
private void copyRootsFrom(LibraryImpl fromModel) {
Map<OrderRootType, VirtualFilePointerContainer> clonedRoots = ContainerUtil.newHashMap();
for (Map.Entry<OrderRootType, VirtualFilePointerContainer> entry : fromModel.myRoots.entrySet()) {
OrderRootType rootType = entry.getKey();
VirtualFilePointerContainer container = entry.getValue();
VirtualFilePointerContainer clone = container.clone(myPointersDisposable);
clonedRoots.put(rootType, clone);
}
myRoots.clear();
myRoots.putAll(clonedRoots);
VirtualFilePointerContainer excludedRoots = fromModel.myExcludedRoots;
myExcludedRoots = excludedRoots != null ? excludedRoots.clone(myPointersDisposable) : null;
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class LibraryImpl method moveRootUp.
@Override
public void moveRootUp(@NotNull String url, @NotNull OrderRootType rootType) {
checkDisposed();
LOG.assertTrue(isWritable());
final VirtualFilePointerContainer container = myRoots.get(rootType);
container.moveUp(url);
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class LibraryImpl method getFiles.
@Override
@NotNull
public VirtualFile[] getFiles(@NotNull OrderRootType rootType) {
checkDisposed();
VirtualFilePointerContainer container = myRoots.get(rootType);
if (container == null) {
return VirtualFile.EMPTY_ARRAY;
}
List<VirtualFile> expanded = new SmartList<>();
for (VirtualFile file : container.getFiles()) {
if (file.isDirectory()) {
if (myJarDirectories.contains(rootType, file.getUrl())) {
collectJarFiles(file, expanded, myJarDirectories.isRecursive(rootType, file.getUrl()));
continue;
}
}
expanded.add(file);
}
return VfsUtilCore.toVirtualFileArray(expanded);
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class LibraryImpl method isValid.
@Override
public boolean isValid(@NotNull final String url, @NotNull final OrderRootType rootType) {
final VirtualFilePointerContainer container = myRoots.get(rootType);
final VirtualFilePointer fp = container.findByUrl(url);
return fp != null && fp.isValid();
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class LibraryImpl method addRoot.
@Override
public void addRoot(@NotNull String url, @NotNull OrderRootType rootType) {
checkDisposed();
LOG.assertTrue(isWritable());
final VirtualFilePointerContainer container = myRoots.get(rootType);
container.add(url);
}
Aggregations