@Override public UsageGroup groupUsage(@NotNull Usage usage) { final FileUsageGroup usageGroup = (FileUsageGroup)super.groupUsage(usage); if (usageGroup != null) { final PsiFile psiFile = usageGroup.getPsiFile(); if (psiFile instanceof PsiJavaFile && !(psiFile instanceof ServerPageFile)) { return null; } } return usageGroup; }
@Override public void visitFile(PsiFile file) { final VirtualFile fileOrDir = file.getVirtualFile(); if(fileOrDir == null) { return; } if(!fileOrDir.isInLocalFileSystem()) { return; } final Module module = ModuleUtilCore.findModuleForFile(fileOrDir, myPsiManager.getProject()); if(module != null) { myModules.add(module); } if(file instanceof PsiJavaFile) { final PsiJavaFile javaFile = (PsiJavaFile) file; final String packageName = javaFile.getPackageName(); if(containsPackagePrefix(module, packageName) || (packageName.length() == 0 && !(javaFile instanceof ServerPageFile)) || !myUsePackageNotation) { mySourceFiles.add(FileUtil.toSystemIndependentName(fileOrDir.getPath())); } else { myPackages.add(packageName); } } }
public static boolean isInServerPageFile(PsiElement file) { return PsiUtilCore.getTemplateLanguageFile(file) instanceof ServerPageFile; }
public static boolean isInJsp(PsiElement file) { return PsiUtilCore.getTemplateLanguageFile(file) instanceof ServerPageFile; }