本文整理汇总了Java中com.intellij.ide.projectView.impl.ProjectRootsUtil.isOutsideSourceRoot方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectRootsUtil.isOutsideSourceRoot方法的具体用法?Java ProjectRootsUtil.isOutsideSourceRoot怎么用?Java ProjectRootsUtil.isOutsideSourceRoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.projectView.impl.ProjectRootsUtil
的用法示例。
在下文中一共展示了ProjectRootsUtil.isOutsideSourceRoot方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: invalid4Move
import com.intellij.ide.projectView.impl.ProjectRootsUtil; //导入方法依赖的package包/类
public static boolean invalid4Move(PsiElement element) {
PsiFile parentFile;
if (element instanceof PsiClassOwner) {
final PsiClass[] classes = ((PsiClassOwner)element).getClasses();
if (classes.length == 0) return true;
for (PsiClass aClass : classes) {
if (aClass instanceof JspClass) return true;
}
parentFile = (PsiFile)element;
}
else {
if (element instanceof JspClass) return true;
if (!(element instanceof PsiClass)) return true;
if (element instanceof PsiAnonymousClass) return true;
if (((PsiClass)element).getContainingClass() != null) return true;
parentFile = element.getContainingFile();
}
return parentFile instanceof PsiJavaFile && ProjectRootsUtil.isOutsideSourceRoot(parentFile);
}
示例2: canProcessElement
import com.intellij.ide.projectView.impl.ProjectRootsUtil; //导入方法依赖的package包/类
@Override
public boolean canProcessElement(PsiFile element) {
return element instanceof PsiJavaFile &&
!JspPsiUtil.isInJspFile(element) &&
!ProjectRootsUtil.isOutsideSourceRoot(element) &&
!(element instanceof PsiCompiledElement);
}
示例3: shouldHighlight
import com.intellij.ide.projectView.impl.ProjectRootsUtil; //导入方法依赖的package包/类
@Override
public boolean shouldHighlight(@NotNull PsiFile psiFile) {
return psiFile.getFileType() != StdFileTypes.JAVA || !ProjectRootsUtil.isOutsideSourceRoot(psiFile);
}
示例4: value
import com.intellij.ide.projectView.impl.ProjectRootsUtil; //导入方法依赖的package包/类
public boolean value(final PsiElement element) {
return element instanceof PsiJavaFile &&
!JspPsiUtil.isInJspFile(element) &&
!ProjectRootsUtil.isOutsideSourceRoot((PsiFile)element) &&
((PsiJavaFile) element).getClasses().length > 0;
}
示例5: convertToTopLevelClasses
import com.intellij.ide.projectView.impl.ProjectRootsUtil; //导入方法依赖的package包/类
@Nullable
private static Map<PsiFile, PsiClass[]> convertToTopLevelClasses(final PsiElement[] elements,
final boolean fromUpdate,
String relativePath,
Map<PsiFile, String> relativeMap) {
final Map<PsiFile, PsiClass[]> result = new HashMap<PsiFile, PsiClass[]>();
for (PsiElement element : elements) {
final PsiElement navigationElement = element.getNavigationElement();
LOG.assertTrue(navigationElement != null, element);
final PsiFile containingFile = navigationElement.getContainingFile();
if (!(containingFile instanceof PsiClassOwner &&
ProjectRootsUtil.isOutsideSourceRoot(containingFile))) {
PsiClass[] topLevelClasses = getTopLevelClasses(element);
if (topLevelClasses == null) {
if (element instanceof PsiDirectory) {
if (!fromUpdate) {
final String name = ((PsiDirectory)element).getName();
final String path = relativePath != null ? (relativePath.length() > 0 ? (relativePath + "/") : "") + name : null;
final Map<PsiFile, PsiClass[]> map = convertToTopLevelClasses(element.getChildren(), fromUpdate, path, relativeMap);
if (map == null) return null;
for (Map.Entry<PsiFile, PsiClass[]> entry : map.entrySet()) {
fillResultsMap(result, entry.getKey(), entry.getValue());
}
}
continue;
}
if (!(element instanceof PsiFileSystemItem)) return null;
}
fillResultsMap(result, containingFile, topLevelClasses);
if (relativeMap != null) {
relativeMap.put(containingFile, relativePath);
}
}
}
if (result.isEmpty()) {
return null;
}
else {
boolean hasClasses = false;
for (PsiClass[] classes : result.values()) {
if (classes != null) {
hasClasses = true;
break;
}
}
return hasClasses ? result : null;
}
}