String (@NotNull final PsiElement element) { final String result; PsiElement container = PsiTreeUtil.getParentOfType(element, PsiMember.class, PsiFile.class); if (container instanceof PsiClass) { String qName = ((PsiClass)container).getQualifiedName(); if (qName != null) { result = qName; } else { result = ((PsiClass)container).getName(); } } else if (container instanceof PsiJavaFile) { result = ((PsiJavaFile)container).getPackageName(); } else {//TODO: local classes result = null; } if (result != null) { return JavaPsiBundle.message("aux.context.display", result); } return null; }