Ejemplo n.º 1
0
 public Content getHyperLink(DocLink link, Content label, String title, String target) {
   HtmlTree anchor = HtmlTree.A(link.toString(), label);
   if (title != null && title.length() != 0) {
     anchor.addAttr(HtmlAttr.TITLE, title);
   }
   if (target != null && target.length() != 0) {
     anchor.addAttr(HtmlAttr.TARGET, target);
   }
   return anchor;
 }
Ejemplo n.º 2
0
 public Content getHyperLink(
     DocLink link, Content label, boolean strong, String stylename, String title, String target) {
   Content body = label;
   if (strong) {
     body = HtmlTree.SPAN(HtmlStyle.typeNameLink, body);
   }
   if (stylename != null && stylename.length() != 0) {
     HtmlTree t = new HtmlTree(HtmlTag.FONT, body);
     t.addAttr(HtmlAttr.CLASS, stylename);
     body = t;
   }
   HtmlTree l = HtmlTree.A(link.toString(), body);
   if (title != null && title.length() != 0) {
     l.addAttr(HtmlAttr.TITLE, title);
   }
   if (target != null && target.length() != 0) {
     l.addAttr(HtmlAttr.TARGET, target);
   }
   return l;
 }
 /**
  * Add the member summary for the given class.
  *
  * @param classDoc the class that is being documented
  * @param member the member being documented
  * @param firstSentenceTags the first sentence tags to be added to the summary
  * @param tableContents the list of contents to which the documentation will be added
  * @param counter the counter for determining id and style for the table row
  */
 public void addMemberSummary(
     ClassDoc classDoc,
     ProgramElementDoc member,
     Tag[] firstSentenceTags,
     List<Content> tableContents,
     int counter) {
   HtmlTree tdSummaryType = new HtmlTree(HtmlTag.TD);
   tdSummaryType.addStyle(HtmlStyle.colFirst);
   writer.addSummaryType(this, member, tdSummaryType);
   HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
   setSummaryColumnStyle(tdSummary);
   addSummaryLink(classDoc, member, tdSummary);
   writer.addSummaryLinkComment(this, member, firstSentenceTags, tdSummary);
   HtmlTree tr = HtmlTree.TR(tdSummaryType);
   tr.addContent(tdSummary);
   if (member instanceof MethodDoc && !member.isAnnotationTypeElement()) {
     int methodType =
         (member.isStatic()) ? MethodTypes.STATIC.value() : MethodTypes.INSTANCE.value();
     if (member.containingClass().isInterface()) {
       methodType =
           (((MethodDoc) member).isAbstract())
               ? methodType | MethodTypes.ABSTRACT.value()
               : methodType | MethodTypes.DEFAULT.value();
     } else {
       methodType =
           (((MethodDoc) member).isAbstract())
               ? methodType | MethodTypes.ABSTRACT.value()
               : methodType | MethodTypes.CONCRETE.value();
     }
     if (utils.isDeprecated(member) || utils.isDeprecated(classdoc)) {
       methodType = methodType | MethodTypes.DEPRECATED.value();
     }
     methodTypesOr = methodTypesOr | methodType;
     String tableId = "i" + counter;
     typeMap.put(tableId, methodType);
     tr.addAttr(HtmlAttr.ID, tableId);
   }
   if (counter % 2 == 0) tr.addStyle(HtmlStyle.altColor);
   else tr.addStyle(HtmlStyle.rowColor);
   tableContents.add(tr);
 }