/**
  * Add the packages list that use the given class.
  *
  * @param contentTree the content tree to which the packages list will be added
  */
 protected void addPackageList(Content contentTree) throws IOException {
   Content table =
       HtmlTree.TABLE(
           HtmlStyle.useSummary,
           0,
           3,
           0,
           useTableSummary,
           getTableCaption(
               configuration.getResource(
                   "doclet.ClassUse_Packages.that.use.0",
                   getLink(
                       new LinkInfoImpl(
                           configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)))));
   table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
   Content tbody = new HtmlTree(HtmlTag.TBODY);
   Iterator<PackageDoc> it = pkgSet.iterator();
   for (int i = 0; it.hasNext(); i++) {
     PackageDoc pkg = it.next();
     HtmlTree tr = new HtmlTree(HtmlTag.TR);
     if (i % 2 == 0) {
       tr.addStyle(HtmlStyle.altColor);
     } else {
       tr.addStyle(HtmlStyle.rowColor);
     }
     addPackageUse(pkg, tr);
     tbody.addContent(tr);
   }
   table.addContent(tbody);
   Content li = HtmlTree.LI(HtmlStyle.blockList, table);
   contentTree.addContent(li);
 }
 /**
  * Add deprecated information to the documentation tree
  *
  * @param deprmembers list of deprecated members
  * @param headingKey the caption for the deprecated members table
  * @param tableSummary the summary for the deprecated members table
  * @param tableHeader table headers for the deprecated members table
  * @param contentTree the content tree to which the deprecated members table will be added
  */
 protected void addDeprecatedAPI(
     List<Doc> deprmembers,
     String headingKey,
     String tableSummary,
     String[] tableHeader,
     Content contentTree) {
   if (deprmembers.size() > 0) {
     Content caption = writer.getTableCaption(configuration.getResource(headingKey));
     Content table =
         (configuration.isOutputHtml5())
             ? HtmlTree.TABLE(HtmlStyle.deprecatedSummary, caption)
             : HtmlTree.TABLE(HtmlStyle.deprecatedSummary, tableSummary, caption);
     table.addContent(writer.getSummaryTableHeader(tableHeader, "col"));
     Content tbody = new HtmlTree(HtmlTag.TBODY);
     for (int i = 0; i < deprmembers.size(); i++) {
       ProgramElementDoc member = (ProgramElementDoc) deprmembers.get(i);
       HtmlTree td = HtmlTree.TD(HtmlStyle.colOne, getDeprecatedLink(member));
       if (member.tags("deprecated").length > 0)
         writer.addInlineDeprecatedComment(member, member.tags("deprecated")[0], td);
       HtmlTree tr = HtmlTree.TR(td);
       if (i % 2 == 0) tr.addStyle(HtmlStyle.altColor);
       else tr.addStyle(HtmlStyle.rowColor);
       tbody.addContent(tr);
     }
     table.addContent(tbody);
     Content li = HtmlTree.LI(HtmlStyle.blockList, table);
     Content ul = HtmlTree.UL(HtmlStyle.blockList, li);
     contentTree.addContent(ul);
   }
 }
 /**
  * Add the list of packages that use the given package.
  *
  * @param contentTree the content tree to which the package list will be added
  */
 protected void addPackageList(Content contentTree) throws IOException {
   Content table =
       HtmlTree.TABLE(
           HtmlStyle.useSummary,
           0,
           3,
           0,
           useTableSummary,
           getTableCaption(
               configuration.getResource(
                   "doclet.ClassUse_Packages.that.use.0",
                   getPackageLink(pkgdoc, Util.getPackageName(pkgdoc)))));
   table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
   Content tbody = new HtmlTree(HtmlTag.TBODY);
   Iterator<String> it = usingPackageToUsedClasses.keySet().iterator();
   for (int i = 0; it.hasNext(); i++) {
     PackageDoc pkg = configuration.root.packageNamed(it.next());
     HtmlTree tr = new HtmlTree(HtmlTag.TR);
     if (i % 2 == 0) {
       tr.addStyle(HtmlStyle.altColor);
     } else {
       tr.addStyle(HtmlStyle.rowColor);
     }
     addPackageUse(pkg, tr);
     tbody.addContent(tr);
   }
   table.addContent(tbody);
   Content li = HtmlTree.LI(HtmlStyle.blockList, table);
   contentTree.addContent(li);
 }
 /**
  * Get the tree link.
  *
  * @return a content tree for the tree link
  */
 protected Content getNavLinkTree() {
   Content linkContent =
       classdoc.containingPackage().isIncluded()
           ? getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), treeLabel)
           : getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), treeLabel);
   Content li = HtmlTree.LI(linkContent);
   return li;
 }
 /**
  * Get class page link.
  *
  * @return a content tree for the class page link
  */
 protected Content getNavLinkClass() {
   Content linkContent =
       getLink(
           new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)
               .label(configuration.getText("doclet.Class")));
   Content li = HtmlTree.LI(linkContent);
   return li;
 }
 /**
  * Add the class list that use the given class.
  *
  * @param contentTree the content tree to which the class list will be added
  */
 protected void addClassList(Content contentTree) throws IOException {
   HtmlTree ul = new HtmlTree(HtmlTag.UL);
   ul.addStyle(HtmlStyle.blockList);
   for (PackageDoc pkg : pkgSet) {
     Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name()));
     Content link =
         getResource(
             "doclet.ClassUse_Uses.of.0.in.1",
             getLink(
                 new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)),
             getPackageLink(pkg, Util.getPackageName(pkg)));
     Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
     li.addContent(heading);
     addClassUse(pkg, li);
     ul.addContent(li);
   }
   Content li = HtmlTree.LI(HtmlStyle.blockList, ul);
   contentTree.addContent(li);
 }
 /**
  * Add the package annotation list.
  *
  * @param contentTree the content tree to which the package annotation list will be added
  */
 protected void addPackageAnnotationList(Content contentTree) throws IOException {
   if ((!classdoc.isAnnotationType())
       || pkgToPackageAnnotations == null
       || pkgToPackageAnnotations.isEmpty()) {
     return;
   }
   Content table =
       HtmlTree.TABLE(
           HtmlStyle.useSummary,
           0,
           3,
           0,
           useTableSummary,
           getTableCaption(
               configuration.getResource(
                   "doclet.ClassUse_PackageAnnotation",
                   getLink(
                       new LinkInfoImpl(
                           configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)))));
   table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
   Content tbody = new HtmlTree(HtmlTag.TBODY);
   Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator();
   for (int i = 0; it.hasNext(); i++) {
     PackageDoc pkg = it.next();
     HtmlTree tr = new HtmlTree(HtmlTag.TR);
     if (i % 2 == 0) {
       tr.addStyle(HtmlStyle.altColor);
     } else {
       tr.addStyle(HtmlStyle.rowColor);
     }
     Content tdFirst =
         HtmlTree.TD(HtmlStyle.colFirst, getPackageLink(pkg, new StringContent(pkg.name())));
     tr.addContent(tdFirst);
     HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
     tdLast.addStyle(HtmlStyle.colLast);
     addSummaryComment(pkg, tdLast);
     tr.addContent(tdLast);
     tbody.addContent(tr);
   }
   table.addContent(tbody);
   Content li = HtmlTree.LI(HtmlStyle.blockList, table);
   contentTree.addContent(li);
 }
 /**
  * Get the use link.
  *
  * @return a content tree for the use link
  */
 protected Content getNavLinkClassUse() {
   Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, useLabel);
   return li;
 }
 /**
  * Get this package link.
  *
  * @return a content tree for the package link
  */
 protected Content getNavLinkPackage() {
   Content linkContent =
       getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), packageLabel);
   Content li = HtmlTree.LI(linkContent);
   return li;
 }
 /**
  * Get the tree link.
  *
  * @return a content tree for the tree link
  */
 protected Content getNavLinkTree() {
   Content linkContent = getHyperLink(DocPaths.PACKAGE_TREE, treeLabel);
   Content li = HtmlTree.LI(linkContent);
   return li;
 }
Beispiel #11
0
 /**
  * Get the deprecated label.
  *
  * @return a content tree for the deprecated label
  */
 protected Content getNavLinkDeprecated() {
   Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, deprecatedLabel);
   return li;
 }
Beispiel #12
0
 /**
  * Add the index link.
  *
  * @param builder the deprecated list builder
  * @param type the type of list being documented
  * @param contentTree the content tree to which the index link will be added
  */
 private void addIndexLink(DeprecatedAPIListBuilder builder, int type, Content contentTree) {
   if (builder.hasDocumentation(type)) {
     Content li = HtmlTree.LI(getHyperLink("#" + ANCHORS[type], getResource(HEADING_KEYS[type])));
     contentTree.addContent(li);
   }
 }