use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class DetectionExcludesConfigurationImpl method addExcludedFile.
@Override
public void addExcludedFile(@NotNull VirtualFile file, @Nullable FrameworkType type) {
convert();
final String typeId = type != null ? type.getId() : null;
if (typeId != null && myExcludedFrameworks.contains(typeId) || isFileExcluded(file, typeId)) {
return;
}
final VirtualFilePointerContainer container = myExcludedFiles.get(typeId);
if (typeId == null) {
for (VirtualFilePointerContainer pointerContainer : myExcludedFiles.values()) {
removeDescendants(file, pointerContainer);
}
} else {
removeDescendants(file, container);
}
container.add(file);
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class DetectionExcludesConfigurationImpl method doLoadState.
private void doLoadState(@Nullable ExcludesConfigurationState state) {
myExcludedFrameworks.clear();
for (VirtualFilePointerContainer container : myExcludedFiles.values()) {
container.clear();
}
myDetectionEnabled = state == null || state.isDetectionEnabled();
if (state != null) {
myExcludedFrameworks.addAll(state.getFrameworkTypes());
for (ExcludedFileState fileState : state.getFiles()) {
myExcludedFiles.get(fileState.getFrameworkType()).add(fileState.getUrl());
}
}
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class JavaModuleExternalPathsImpl method setRootUrls.
private void setRootUrls(final OrderRootType orderRootType, @NotNull final String[] urls) {
VirtualFilePointerContainer container = myOrderRootPointerContainers.get(orderRootType);
if (container == null) {
if (urls.length == 0) {
// (that in turn can mask issues like https://youtrack.jetbrains.com/issue/IDEA-166461)
return;
}
container = VirtualFilePointerManager.getInstance().createContainer(this, null);
myOrderRootPointerContainers.put(orderRootType, container);
} else {
container.clear();
}
for (final String url : urls) {
container.add(url);
}
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class JavaModuleExternalPathsImpl method readExternal.
@Override
public void readExternal(@NotNull Element element) throws InvalidDataException {
for (PersistentOrderRootType orderRootType : OrderRootType.getAllPersistentTypes()) {
String paths = orderRootType.getModulePathsName();
if (paths != null) {
final Element pathsElement = element.getChild(paths);
if (pathsElement != null) {
VirtualFilePointerContainer container = VirtualFilePointerManager.getInstance().createContainer(this, null);
myOrderRootPointerContainers.put(orderRootType, container);
container.readExternal(pathsElement, ROOT_ELEMENT);
}
}
}
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer in project intellij-community by JetBrains.
the class JavaModuleExternalPathsImpl method writeExternal.
@Override
public void writeExternal(@NotNull Element element) throws WriteExternalException {
for (OrderRootType orderRootType : myOrderRootPointerContainers.keySet()) {
VirtualFilePointerContainer container = myOrderRootPointerContainers.get(orderRootType);
if (container != null && container.size() > 0) {
final Element javaDocPaths = new Element(((PersistentOrderRootType) orderRootType).getModulePathsName());
container.writeExternal(javaDocPaths, ROOT_ELEMENT);
element.addContent(javaDocPaths);
}
}
}
Aggregations