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