String (PsiElement element) { String name = null; if (element instanceof PsiMetaOwner) { final PsiMetaData data = ((PsiMetaOwner) element).getMetaData(); if (data != null) { name = data.getName(element); } } if (name == null && element instanceof PsiNamedElement) { name = ((PsiNamedElement) element).getName(); } return name; }