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