boolean (PsiElement baseClass, @NotNull PsiElement srcElement, String scopeType) { if (HierarchyBrowserBaseEx.SCOPE_CLASS.equals(scopeType)) { return PsiTreeUtil.isAncestor(baseClass, srcElement, true); } if (HierarchyBrowserBaseEx.SCOPE_MODULE.equals(scopeType)) { Module module = ModuleUtilCore.findModuleForPsiElement(baseClass); VirtualFile virtualFile = srcElement.getContainingFile().getVirtualFile(); return module != null && module.getModuleScope().contains(virtualFile); } if (HierarchyBrowserBaseEx.SCOPE_PROJECT.equals(scopeType)) { VirtualFile virtualFile = srcElement.getContainingFile().getVirtualFile(); return virtualFile == null || !TestSourcesFilter.isTestSources(virtualFile, myProject); } if (HierarchyBrowserBaseEx.SCOPE_TEST.equals(scopeType)) { VirtualFile virtualFile = srcElement.getContainingFile().getVirtualFile(); return virtualFile == null || TestSourcesFilter.isTestSources(virtualFile, myProject); } if (HierarchyBrowserBaseEx.SCOPE_ALL.equals(scopeType)) { return true; } NamedScope namedScope = NamedScopesHolder.getScope(myProject, scopeType); if (namedScope == null) { return false; } PackageSet namedScopePattern = namedScope.getValue(); if (namedScopePattern == null) { return false; } PsiFile psiFile = srcElement.getContainingFile(); if (psiFile == null) { return true; } NamedScopesHolder holder = NamedScopesHolder.getHolder(myProject, scopeType, NamedScopeManager.getInstance(myProject)); return namedScopePattern.contains(psiFile, holder); }