String (@NotNull PsiElement element, @NotNull ElementDescriptionLocation location) { if (!(location instanceof HighlightUsagesDescriptionLocation)) return null; String elementName = null; if (element instanceof PsiClass) { elementName = ((PsiClass)element).getQualifiedName(); if (elementName == null) { elementName = ((PsiClass)element).getName(); } } else if (element instanceof PsiMethod) { elementName = PsiFormatUtil.formatMethod((PsiMethod)element, PsiSubstitutor.EMPTY, METHOD_FLAGS, PsiFormatUtilBase.SHOW_TYPE); } else if (element instanceof PsiVariable) { elementName = PsiFormatUtil.formatVariable((PsiVariable)element, VARIABLE_FLAGS, PsiSubstitutor.EMPTY); } else if (element instanceof PsiPackage) { elementName = ((PsiPackage)element).getQualifiedName(); } return elementName == null ? null : JavaPsiBundle.message("element.kind.and.name", JavaElementKind.fromElement(element).subject(), elementName); }