本文整理汇总了Java中com.intellij.openapi.vfs.VfsUtilCore.iterateChildrenRecursively方法的典型用法代码示例。如果您正苦于以下问题:Java VfsUtilCore.iterateChildrenRecursively方法的具体用法?Java VfsUtilCore.iterateChildrenRecursively怎么用?Java VfsUtilCore.iterateChildrenRecursively使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.vfs.VfsUtilCore
的用法示例。
在下文中一共展示了VfsUtilCore.iterateChildrenRecursively方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: iterateContent
import com.intellij.openapi.vfs.VfsUtilCore; //导入方法依赖的package包/类
@Override
public boolean iterateContent(@NotNull ContentIterator iterator) {
Module[] modules = ApplicationManager.getApplication().runReadAction(new Computable<Module[]>() {
@Override
public Module[] compute() {
return ModuleManager.getInstance(myProject).getModules();
}
});
for (final Module module : modules) {
for (VirtualFile contentRoot : getRootsToIterate(module)) {
boolean finished = VfsUtilCore.iterateChildrenRecursively(contentRoot, myContentFilter, iterator);
if (!finished) return false;
}
}
return true;
}
示例2: accept
import com.intellij.openapi.vfs.VfsUtilCore; //导入方法依赖的package包/类
protected boolean accept(@NotNull final PsiDirectory dir, @NotNull final Processor<VirtualFile> processor) {
final Project project = dir.getProject();
final ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex();
//we should analyze generated source files only if the action is explicitly invoked for a directory located under generated roots
final boolean processGeneratedFiles = isInGeneratedSources(dir.getVirtualFile(), project);
return VfsUtilCore.iterateChildrenRecursively(dir.getVirtualFile(), VirtualFileFilter.ALL, new ContentIterator() {
@Override
@SuppressWarnings({"SimplifiableIfStatement"})
public boolean processFile(@NotNull final VirtualFile fileOrDir) {
if (!myIncludeTestSource && index.isInTestSourceContent(fileOrDir)) return true;
if (!processGeneratedFiles && isInGeneratedSources(fileOrDir, project)) return true;
if (!fileOrDir.isDirectory()) {
return processor.process(fileOrDir);
}
return true;
}
});
}
示例3: iterateContentUnderDirectory
import com.intellij.openapi.vfs.VfsUtilCore; //导入方法依赖的package包/类
@Override
public boolean iterateContentUnderDirectory(@NotNull VirtualFile dir, @NotNull ContentIterator iterator) {
return VfsUtilCore.iterateChildrenRecursively(dir, myContentFilter, iterator);
}