use of org.jetbrains.idea.devkit.dom.ExtensionPoint in project intellij-community by JetBrains.
the class ExtensionPointDocumentationProvider method generateDoc.
@Override
public String generateDoc(PsiElement element, @Nullable PsiElement originalElement) {
ExtensionPoint extensionPoint = findExtensionPoint(element);
if (extensionPoint == null)
return null;
final PsiClass epClass = getExtensionPointClass(extensionPoint);
if (epClass != null) {
StringBuilder sb = new StringBuilder();
sb.append("<em>EP Definition</em><br/>");
final String quickInfo = StringUtil.notNullize(getQuickNavigateInfo(element, originalElement));
sb.append(quickInfo);
sb.append("<br/>");
sb.append("<br/>");
sb.append("<em>EP Implementation</em>");
sb.append(JavaDocumentationProvider.generateExternalJavadoc(epClass));
return sb.toString();
}
return null;
}
use of org.jetbrains.idea.devkit.dom.ExtensionPoint in project intellij-community by JetBrains.
the class ExtensionPointDocumentationProvider method getQuickNavigateInfo.
@Override
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
ExtensionPoint extensionPoint = findExtensionPoint(element);
if (extensionPoint == null)
return null;
final XmlFile epDeclarationFile = DomUtil.getFile(extensionPoint);
final Module epModule = ModuleUtilCore.findModuleForFile(epDeclarationFile.getVirtualFile(), element.getProject());
final String epPrefix = extensionPoint.getNamePrefix();
final PsiClass epClass = getExtensionPointClass(extensionPoint);
StringBuilder epClassText = new StringBuilder();
if (epClass != null) {
JavaDocInfoGenerator.generateType(epClassText, PsiTypesUtil.getClassType(epClass), epClass, true);
} else {
epClassText.append("<unknown>");
}
return (epModule == null ? "" : "[" + epModule.getName() + "]") + (epPrefix == null ? "" : " " + epPrefix) + "<br/>" + "<b>" + extensionPoint.getEffectiveName() + "</b>" + " (" + epDeclarationFile.getName() + ")<br/>" + epClassText.toString();
}
Aggregations