String (Object element) { String elementValue = null; if (element instanceof PsiNamedElement) { elementValue = ((PsiNamedElement)element).getName(); } else if (element instanceof PsiElement) { elementValue = ((PsiElement)element).getText(); } return elementValue; }