@Override public void addExcludedFramework(@NotNull FrameworkType type) { convert(); myExcludedFrameworks.add(type.getId()); final VirtualFilePointerContainer container = myExcludedFiles.remove(type.getId()); if (container != null) { container.clear(); } }
public void removeExcluded( @NotNull Collection<VirtualFile> files, final FrameworkType frameworkType) { ensureOldSettingsLoaded(); if (myExcludedFrameworks.contains(frameworkType.getId())) { files.clear(); return; } final Iterator<VirtualFile> iterator = files.iterator(); while (iterator.hasNext()) { VirtualFile file = iterator.next(); if (isFileExcluded(file, frameworkType.getId())) { iterator.remove(); } } }
@Override public void addExcludedUrl(@NotNull String url, @Nullable FrameworkType type) { final VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(url); if (file != null) { addExcludedFile(file, type); return; } convert(); final String typeId = type != null ? type.getId() : null; if (typeId != null && myExcludedFrameworks.contains(typeId)) { return; } myExcludedFiles.get(typeId).add(url); }
@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); }