use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class LibraryImpl method moveRootDown.
@Override
public void moveRootDown(@NotNull String url, @NotNull OrderRootType rootType) {
checkDisposed();
LOG.assertTrue(isWritable());
final VirtualFilePointerContainer container = myRoots.get(rootType);
container.moveDown(url);
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class LibraryImpl method getUrls.
@Override
@NotNull
public String[] getUrls(@NotNull OrderRootType rootType) {
checkDisposed();
VirtualFilePointerContainer result = myRoots.get(rootType);
return result == null ? ArrayUtilRt.EMPTY_STRING_ARRAY : result.getUrls();
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class LibraryImpl method readRoots.
private void readRoots(Element element) throws InvalidDataException {
for (OrderRootType rootType : getAllRootTypes()) {
final Element rootChild = element.getChild(rootType.name());
if (rootChild == null) {
continue;
}
VirtualFilePointerContainer roots = myRoots.get(rootType);
roots.readExternal(rootChild, ROOT_PATH_ELEMENT);
}
Element excludedRoot = element.getChild(EXCLUDED_ROOTS_TAG);
if (excludedRoot != null) {
getOrCreateExcludedRoots().readExternal(excludedRoot, ROOT_PATH_ELEMENT);
}
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class LibraryImpl method removeRoot.
@Override
public boolean removeRoot(@NotNull String url, @NotNull OrderRootType rootType) {
checkDisposed();
LOG.assertTrue(isWritable());
final VirtualFilePointerContainer container = myRoots.get(rootType);
final VirtualFilePointer byUrl = container.findByUrl(url);
if (byUrl != null) {
container.remove(byUrl);
if (myExcludedRoots != null) {
for (String excludedRoot : myExcludedRoots.getUrls()) {
if (!isUnderRoots(excludedRoot)) {
VirtualFilePointer pointer = myExcludedRoots.findByUrl(excludedRoot);
if (pointer != null) {
myExcludedRoots.remove(pointer);
}
}
}
}
myJarDirectories.remove(rootType, url);
return true;
}
return false;
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class FileAssociationsManagerImpl method addAssociation.
public void addAssociation(PsiFile file, VirtualFile assoc) {
final VirtualFile virtualFile = file.getVirtualFile();
if (virtualFile == null) {
LOG.warn("No VirtualFile for " + file.getName());
return;
}
for (VirtualFilePointer pointer : myAssociations.keySet()) {
if (pointer.getUrl().equals(virtualFile.getUrl())) {
VirtualFilePointerContainer container = myAssociations.get(pointer);
if (container == null) {
container = myFilePointerManager.createContainer(myProject);
myAssociations.put(pointer, container);
}
if (container.findByUrl(assoc.getUrl()) == null) {
container.add(assoc);
touch();
}
return;
}
}
final VirtualFilePointerContainer container = myFilePointerManager.createContainer(myProject);
container.add(assoc);
myAssociations.put(myFilePointerManager.create(virtualFile, myProject, null), container);
touch();
}
Aggregations