String (@NotNull final PsiElement element, @NotNull final ElementDescriptionLocation location) { if (location instanceof DeleteTypeDescriptionLocation) { final boolean plural = ((DeleteTypeDescriptionLocation)location).isPlural(); final int count = plural ? 2 : 1; if (element instanceof PsiFileSystemItem && PsiUtilBase.isSymLink((PsiFileSystemItem)element)) { return IdeBundle.message("prompt.delete.symlink", count); } if (element instanceof PsiFile) { return IdeBundle.message("prompt.delete.file", count); } if (element instanceof PsiDirectory) { return IdeBundle.message("prompt.delete.directory", count); } PsiMetaData metaData = element instanceof PsiMetaOwner ? ((PsiMetaOwner)element).getMetaData() : null; String typeName = metaData instanceof PsiPresentableMetaData ? ((PsiPresentableMetaData)metaData).getTypeName() : null; if (typeName == null) { typeName = LanguageFindUsages.getType(element); } return !plural ? typeName : StringUtil.pluralize(typeName); } return null; }