本文整理匯總了Java中com.intellij.openapi.vfs.VfsUtil.visitChildrenRecursively方法的典型用法代碼示例。如果您正苦於以下問題:Java VfsUtil.visitChildrenRecursively方法的具體用法?Java VfsUtil.visitChildrenRecursively怎麽用?Java VfsUtil.visitChildrenRecursively使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.vfs.VfsUtil
的用法示例。
在下文中一共展示了VfsUtil.visitChildrenRecursively方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateDataModel
import com.intellij.openapi.vfs.VfsUtil; //導入方法依賴的package包/類
@Override
public void updateDataModel() {
getWizardContext().setProjectName(PathUtil.getFileName(projectRootDirectoryBrowser.getText()));
getWizardContext().setProjectFileDirectory(projectRootDirectoryBrowser.getText());
if (importIntoDefaultProjectOption.isSelected()) {
getParameters().projectCreationRoot = ProjectUtil.getBaseDir();
} else if (createProjectInSelectedRootOption.isSelected()) {
getParameters().projectCreationRoot = projectRootDirectoryBrowser.getText();
} else if (importProjectIntoCustomRootOption.isSelected()) {
getParameters().projectCreationRoot = customImportRootDirectoryBrowser.getText();
}
getParameters().root = projectRootDirectoryBrowser.getText();
getParameters().importablePdeFiles = ProcessingPluginUtil.INSTANCE.filterFilesAtRoot(projectRootDirectoryBrowser.getText(), isPdeFile());
Collection<VirtualFile> dataDirectoryResults = ProcessingPluginUtil.INSTANCE.filterFilesAtRoot(projectRootDirectoryBrowser.getText(), vfsPath -> vfsPath.isDirectory() && vfsPath.getName().equals("data"));
if (! dataDirectoryResults.isEmpty()) {
VirtualFile dataDirectory = dataDirectoryResults.iterator().next();
final AtomicBoolean dataDirectoryHasFiles = new AtomicBoolean(false);
VfsUtil.visitChildrenRecursively(dataDirectory, new VirtualFileVisitor() {
@Override
public boolean visitFile(@NotNull VirtualFile file) {
if (dataDirectoryHasFiles.get()) {
return false;
}
if (!file.isDirectory()) {
dataDirectoryHasFiles.set(true);
return false;
}
return true;
}
});
if (dataDirectoryHasFiles.get()) {
getParameters().resourceDirectoryPath = dataDirectory;
}
} else {
getParameters().resourceDirectoryPath = null;
}
}