use of org.eclipse.jdt.core.dom.TagElement in project xtext-eclipse by eclipse.
the class XbaseHoverDocumentationProvider method handleBlockTags.
protected void handleBlockTags(String title, List<TagElement> tags) {
if (tags.isEmpty())
return;
handleBlockTagTitle(title);
for (Iterator<TagElement> iter = tags.iterator(); iter.hasNext(); ) {
TagElement tag = iter.next();
buffer.append(BlOCK_TAG_ENTRY_START);
if (TagElement.TAG_SEE.equals(tag.getTagName())) {
handleSeeTag(tag);
} else {
@SuppressWarnings("unchecked") List<ASTNode> fragments = tag.fragments();
handleContentElements(fragments);
}
buffer.append(BlOCK_TAG_ENTRY_END);
}
}
use of org.eclipse.jdt.core.dom.TagElement in project xtext-eclipse by eclipse.
the class XbaseHoverDocumentationProvider method handleParameters.
protected void handleParameters(EObject object, List<TagElement> parameters, List<String> parameterNames) {
if (parameters.size() == 0 && containsOnlyNull(parameterNames))
return;
handleBlockTagTitle("Parameters:");
for (Iterator<TagElement> iter = parameters.iterator(); iter.hasNext(); ) {
TagElement tag = iter.next();
buffer.append(BlOCK_TAG_ENTRY_START);
handleParamTag(tag);
buffer.append(BlOCK_TAG_ENTRY_END);
}
for (int i = 0; i < parameterNames.size(); i++) {
String name = parameterNames.get(i);
if (name != null) {
buffer.append(BlOCK_TAG_ENTRY_START);
buffer.append(PARAM_NAME_START);
buffer.append(name);
buffer.append(PARAM_NAME_END);
buffer.append(BlOCK_TAG_ENTRY_END);
}
}
}
use of org.eclipse.jdt.core.dom.TagElement in project xtext-eclipse by eclipse.
the class XbaseHoverDocumentationProvider method handleExceptionTags.
protected void handleExceptionTags(List<TagElement> tags, Map<String, URI> exceptionNamesToURI) {
if (tags.size() == 0 && containsOnlyNull(exceptionNamesToURI.values()))
return;
handleBlockTagTitle("Throws:");
for (Iterator<TagElement> iter = tags.iterator(); iter.hasNext(); ) {
TagElement tag = iter.next();
buffer.append(BlOCK_TAG_ENTRY_START);
handleThrowsTag(tag);
buffer.append(BlOCK_TAG_ENTRY_END);
}
for (int i = 0; i < exceptionNamesToURI.size(); i++) {
String name = Lists.newArrayList(exceptionNamesToURI.keySet()).get(i);
if (name != null && exceptionNamesToURI.get(name) != null) {
buffer.append(BlOCK_TAG_ENTRY_START);
buffer.append(createLinkWithLabel(XtextElementLinks.XTEXTDOC_SCHEME, exceptionNamesToURI.get(name), name));
buffer.append(BlOCK_TAG_ENTRY_END);
}
}
}
use of org.eclipse.jdt.core.dom.TagElement in project whole by wholeplatform.
the class CompilationUnitBuilder method newTagElement.
public TagElement newTagElement(String tagName) {
TagElement tag = ast.newTagElement();
tag.setTagName(tagName);
return tag;
}
use of org.eclipse.jdt.core.dom.TagElement in project whole by wholeplatform.
the class CompilationUnitBuilder method putCUDocComment.
public void putCUDocComment() {
String copyright = generator.getCopyright();
String license = generator.getLicense();
String comment = copyright;
if (comment != null && comment.length() > 0)
comment += "\n " + license;
else
comment = license;
if (comment != null && comment.length() > 0) {
TagElement te = newTagElement(null, comment);
Javadoc cuDoc = newJavadoc();
cuDoc.tags().add(te);
packageDec.setJavadoc(cuDoc);
}
}
Aggregations