本文整理汇总了Java中com.intellij.openapi.roots.impl.DirectoryInfo类的典型用法代码示例。如果您正苦于以下问题:Java DirectoryInfo类的具体用法?Java DirectoryInfo怎么用?Java DirectoryInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DirectoryInfo类属于com.intellij.openapi.roots.impl包,在下文中一共展示了DirectoryInfo类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldBeShown
import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
private boolean shouldBeShown(VirtualFile dir, ViewSettings settings) {
DirectoryInfo directoryInfo = myIndex.getInfoForFile(dir);
if (directoryInfo.isInProject()) return true;
if (!Registry.is("ide.hide.excluded.files") && settings instanceof ProjectViewSettings && ((ProjectViewSettings)settings).isShowExcludedFiles()) {
return directoryInfo.isExcluded();
}
return false;
}
示例2: getSourceRootDirectory
import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Nullable
private static PsiDirectory getSourceRootDirectory(PsiDirectory directory) {
PsiManager manager = directory.getManager();
DirectoryIndex directoryIndex = DirectoryIndex.getInstance(manager.getProject());
DirectoryInfo info = directoryIndex.getInfoForDirectory(directory.getVirtualFile());
if (info == null || !info.hasSourceRoot()) return null;
return manager.findDirectory(info.getSourceRoot());
}
示例3: contains
import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Override
public boolean contains(VirtualFile file) {
VirtualFile dir = file.isDirectory() ? file : file.getParent();
if (dir == null) return false;
DirectoryInfo info = myDirectoryIndex.getInfoForDirectory(dir);
return info != null && info.hasLibraryClassRoot();
}
示例4: actionPerformed
import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = e.getData(PlatformDataKeys.PROJECT);
final DirectoryIndex index = DirectoryIndex.getInstance(project);
if (project != null) {
final VirtualFile root = e.getData(PlatformDataKeys.VIRTUAL_FILE);
ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
@Override
public void run() {
final ContentIterator contentIterator = new ContentIterator() {
@Override
public boolean processFile(VirtualFile fileOrDir) {
LOG.info(fileOrDir.getPath());
final DirectoryInfo directoryInfo = index.getInfoForDirectory(fileOrDir);
if (directoryInfo != null) {
LOG.info(directoryInfo.toString());
}
return true;
}
};
if (root != null) {
ProjectRootManager.getInstance(project).getFileIndex().iterateContentUnderDirectory(root, contentIterator);
} else {
ProjectRootManager.getInstance(project).getFileIndex().iterateContent(contentIterator);
}
}
}, "Dumping directory index", true, project);
}
}
示例5: getContentFolderType
import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Override
@Nullable
public ContentFolderTypeProvider getContentFolderType(@Nonnull DirectoryInfo info) {
if (info.isInModuleSource()) {
RootIndex rootIndex = getRootIndex();
return rootIndex.getContentFolderType(info);
}
return null;
}
示例6: actionPerformed
import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = e.getData(CommonDataKeys.PROJECT);
final DirectoryIndex index = DirectoryIndex.getInstance(project);
if (project != null) {
final VirtualFile root = e.getData(PlatformDataKeys.VIRTUAL_FILE);
ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
@Override
public void run() {
final ContentIterator contentIterator = new ContentIterator() {
@Override
public boolean processFile(VirtualFile fileOrDir) {
LOG.info(fileOrDir.getPath());
final DirectoryInfo directoryInfo = index.getInfoForDirectory(fileOrDir);
if (directoryInfo != null) {
LOG.info(directoryInfo.toString());
}
return true;
}
};
if (root != null) {
ProjectRootManager.getInstance(project).getFileIndex().iterateContentUnderDirectory(root, contentIterator);
} else {
ProjectRootManager.getInstance(project).getFileIndex().iterateContent(contentIterator);
}
}
}, "Dumping directory index", true, project);
}
}
示例7: contains
import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Override
public boolean contains(@Nonnull VirtualFile file) {
VirtualFile dir = file.isDirectory() ? file : file.getParent();
if (dir == null) return false;
DirectoryInfo info = myDirectoryIndex.getInfoForDirectory(dir);
return info != null && info.hasLibraryClassRoot();
}
示例8: getInfoForDirectory
import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Override
public DirectoryInfo getInfoForDirectory(@Nonnull VirtualFile dir) {
DirectoryInfo info = getInfoForFile(dir);
return info.isInProject() ? info : null;
}
示例9: getInfoForFile
import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Nonnull
@Override
public DirectoryInfo getInfoForFile(@Nonnull VirtualFile file) {
return getRootIndex().getInfoForFile(file);
}
示例10: getOrderEntries
import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
@Nonnull
@Override
public OrderEntry[] getOrderEntries(@Nonnull DirectoryInfo info) {
return getRootIndex().getOrderEntries(info);
}
示例11: shouldBeShown
import com.intellij.openapi.roots.impl.DirectoryInfo; //导入依赖的package包/类
private static boolean shouldBeShown(DirectoryIndex directoryIndex, VirtualFile dir, ViewSettings settings) {
DirectoryInfo directoryInfo = directoryIndex.getInfoForFile(dir);
if (directoryInfo.isInProject()) return true;
return settings.getViewOption(ShowExcludedFilesProjectViewPaneOptionProvider.KEY) == Boolean.TRUE && directoryInfo.isExcluded();
}