boolean (PsiElement element) { final String packageName = myConfig.getPersistantData().getPackageName(); if (element instanceof PsiPackage) { return Comparing.strEqual(packageName, ((PsiPackage)element).getQualifiedName()); } else if (element instanceof PsiDirectory) { final PsiPackage psiPackage = JavaDirectoryService.getInstance().getPackage(((PsiDirectory)element)); return psiPackage != null && Comparing.strEqual(packageName, psiPackage.getQualifiedName()); } return false; }