Search in sources :

Example 1 with TagletWriterImpl

use of com.sun.tools.doclets.formats.html.TagletWriterImpl in project RoboBinding by RoboBinding.

the class EventTaglet method getTagletOutput.

public TagletOutput getTagletOutput(Doc doc, TagletWriter tagletWriter) throws IllegalArgumentException {
    Tag[] tags = doc.tags(NAME);
    if (tags.length == 0) {
        return null;
    }
    TagletWriterImpl tagletWriterImpl = (TagletWriterImpl) tagletWriter;
    StringBuilder sb = new StringBuilder();
    sb.append("<table style=\"border: 2px solid gray\"><caption style=\"text-align:left\"><strong>Supported Events</strong></caption><tr style=\"background-color:#555555; color: #ffffff\"><th>Name</th><th>Event class</th></tr>");
    for (int i = 0; i < tags.length; i++) {
        Tag tag = tags[i];
        Event event = parser.parse(tag);
        String translatedClassName = inlineLinkTagTranslator.translate(event.getClassName(), tag, doc, tagletWriterImpl);
        sb.append(MessageFormat.format("<tr style=\"background-color:{0}\"><td><strong>{1}</strong></td><td>{2}</td></tr>", (i % 2 == 0) ? "#eeeeef" : "#ffffff", event.getName(), translatedClassName));
    }
    sb.append("</table></br>");
    return new TagletOutputImpl(sb.toString());
}
Also used : Tag(com.sun.javadoc.Tag) TagletOutputImpl(com.sun.tools.doclets.formats.html.TagletOutputImpl) TagletWriterImpl(com.sun.tools.doclets.formats.html.TagletWriterImpl)

Example 2 with TagletWriterImpl

use of com.sun.tools.doclets.formats.html.TagletWriterImpl in project RoboBinding by RoboBinding.

the class PropTaglet method getTagletOutput.

public TagletOutput getTagletOutput(Doc doc, TagletWriter tagletWriter) throws IllegalArgumentException {
    Tag[] tags = doc.tags(NAME);
    if (tags.length == 0) {
        return null;
    }
    TagletWriterImpl tagletWriterImpl = (TagletWriterImpl) tagletWriter;
    StringBuilder sb = new StringBuilder();
    sb.append("<table style=\"border: 2px solid gray\"><caption style=\"text-align:left\"><strong>Supported Properties</strong></caption><tr style=\"background-color:#555555; color: #ffffff\"><th>Name</th><th>Supported types</th><th>Two-ways?</th></tr>");
    for (int i = 0; i < tags.length; i++) {
        Tag tag = tags[i];
        Prop prop = parser.parse(tag);
        sb.append(MessageFormat.format("<tr style=\"background-color:{0}\"><td><strong>{1}</strong></td><td>{2}</td><td>{3}</td></tr>", (i % 2 == 0) ? "#eeeeef" : "#ffffff", prop.getName(), inlineLinkTagTranslator.translate(prop.getSupportedTypes(), tag, doc, tagletWriterImpl), prop.getSupportedBindingTypes()));
    }
    sb.append("</table></br>");
    return new TagletOutputImpl(sb.toString());
}
Also used : Tag(com.sun.javadoc.Tag) TagletOutputImpl(com.sun.tools.doclets.formats.html.TagletOutputImpl) TagletWriterImpl(com.sun.tools.doclets.formats.html.TagletWriterImpl)

Aggregations

Tag (com.sun.javadoc.Tag)2 TagletOutputImpl (com.sun.tools.doclets.formats.html.TagletOutputImpl)2 TagletWriterImpl (com.sun.tools.doclets.formats.html.TagletWriterImpl)2