use of com.intellij.psi.DelegatePsiTarget in project intellij-community by JetBrains.
the class DomDocumentationProvider method generateDoc.
@Override
public String generateDoc(PsiElement element, final PsiElement originalElement) {
if (element instanceof PomTargetPsiElement) {
PomTarget target = ((PomTargetPsiElement) element).getTarget();
if (target instanceof DelegatePsiTarget) {
element = ((DelegatePsiTarget) target).getNavigationElement();
}
}
final DomElement domElement = DomUtil.getDomElement(element);
if (domElement == null) {
return null;
}
ElementPresentationTemplate template = domElement.getChildDescription().getPresentationTemplate();
if (template != null) {
String documentation = template.createPresentation(domElement).getDocumentation();
if (documentation != null)
return documentation;
}
return ElementPresentationManager.getDocumentationForElement(domElement);
}
Aggregations