本文整理汇总了Java中com.intellij.ide.projectView.impl.ProjectRootsUtil.isInSource方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectRootsUtil.isInSource方法的具体用法?Java ProjectRootsUtil.isInSource怎么用?Java ProjectRootsUtil.isInSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.projectView.impl.ProjectRootsUtil
的用法示例。
在下文中一共展示了ProjectRootsUtil.isInSource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDirectoryIcon
import com.intellij.ide.projectView.impl.ProjectRootsUtil; //导入方法依赖的package包/类
private void setDirectoryIcon(final PresentationData data, final VirtualFile file, final Project project) {
if (ProjectRootManager.getInstance(project).getFileIndex().isExcluded(file)) {
data.setIcon(IconLoader.findIcon("/icons/modules/ExcludedTreeOpen.png"));
} else if (ProjectRootsUtil.isModuleContentRoot(file, project)) {
data.setIcon(IconLoader.findIcon("/icons/nodes/ModuleOpen.png"));
} else if (ProjectRootsUtil.isInSource(file, project)) {
data.setIcon(IconLoader.findIcon("/icons/modules/sourceRootOpen.png"));
} else if (ProjectRootsUtil.isInTestSource(file, project)) {
data.setIcon(IconLoader.findIcon("/icons/modules/testRootOpen.png"));
} else if (data.getIcon(false).equals(PlatformIcons.PACKAGE_ICON)) {
// Looks like an open directory anyway
data.setIcon(PlatformIcons.PACKAGE_ICON);
} else {
data.setIcon(TintedIconsService.getIcon("/icons/nodes/folderOpen.png", "ff00cc"));
}
}
示例2: isForMe
import com.intellij.ide.projectView.impl.ProjectRootsUtil; //导入方法依赖的package包/类
@Override
public boolean isForMe(ProjectViewNode node) {
if (node instanceof PsiDirectoryNode) {
PsiDirectoryNode dirNode = (PsiDirectoryNode) node;
final Project project = dirNode.getProject();
final PsiDirectory psiDirectory = dirNode.getValue();
final VirtualFile directoryFile = psiDirectory.getVirtualFile();
return ProjectRootsUtil.isInSource(directoryFile, project) ||
ProjectRootsUtil.isInTestSource(directoryFile, project);
}
return false;
}
示例3: isForMe
import com.intellij.ide.projectView.impl.ProjectRootsUtil; //导入方法依赖的package包/类
@Override
public boolean isForMe(ProjectViewNode node) {
if (node instanceof PsiDirectoryNode) {
PsiDirectoryNode dirNode = (PsiDirectoryNode) node;
final PsiDirectory psiDirectory = dirNode.getValue();
if (psiDirectory != null) {
final Project project = dirNode.getProject();
final VirtualFile directoryFile = psiDirectory.getVirtualFile();
return ProjectRootsUtil.isModuleContentRoot(directoryFile, project)
|| ProjectRootsUtil.isInSource(directoryFile, project);
}
}
return false;
}