/** * 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); }
/** * Add the list of classes that use the given package. * * @param contentTree the content tree to which the class list will be added */ protected void addClassList(Content contentTree) throws IOException { String[] classTableHeader = new String[] { configuration.getText( "doclet.0_and_1", configuration.getText("doclet.Class"), configuration.getText("doclet.Description")) }; Iterator<String> itp = usingPackageToUsedClasses.keySet().iterator(); while (itp.hasNext()) { String packageName = itp.next(); PackageDoc usingPackage = configuration.root.packageNamed(packageName); HtmlTree li = new HtmlTree(HtmlTag.LI); li.addStyle(HtmlStyle.blockList); if (usingPackage != null) { li.addContent(getMarkerAnchor(usingPackage.name())); } String tableSummary = configuration.getText( "doclet.Use_Table_Summary", configuration.getText("doclet.classes")); Content table = HtmlTree.TABLE( HtmlStyle.useSummary, 0, 3, 0, tableSummary, getTableCaption( configuration.getResource( "doclet.ClassUse_Classes.in.0.used.by.1", getPackageLink(pkgdoc, Util.getPackageName(pkgdoc)), getPackageLink(usingPackage, Util.getPackageName(usingPackage))))); table.addContent(getSummaryTableHeader(classTableHeader, "col")); Content tbody = new HtmlTree(HtmlTag.TBODY); Iterator<ClassDoc> itc = usingPackageToUsedClasses.get(packageName).iterator(); for (int i = 0; itc.hasNext(); i++) { HtmlTree tr = new HtmlTree(HtmlTag.TR); if (i % 2 == 0) { tr.addStyle(HtmlStyle.altColor); } else { tr.addStyle(HtmlStyle.rowColor); } addClassRow(itc.next(), packageName, tr); tbody.addContent(tr); } table.addContent(tbody); li.addContent(table); contentTree.addContent(li); } }
/** * Generate the deprecated API list. * * @param deprapi list of deprecated API built already. */ protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi) throws IOException { Content body = getHeader(); body.addContent(getContentsList(deprapi)); String memberTableSummary; String[] memberTableHeader = new String[1]; HtmlTree div = new HtmlTree(HtmlTag.DIV); div.addStyle(HtmlStyle.contentContainer); for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) { if (deprapi.hasDocumentation(i)) { addAnchor(deprapi, i, div); memberTableSummary = configuration.getText( "doclet.Member_Table_Summary", configuration.getText(HEADING_KEYS[i]), configuration.getText(SUMMARY_KEYS[i])); memberTableHeader[0] = configuration.getText( "doclet.0_and_1", configuration.getText(HEADER_KEYS[i]), configuration.getText("doclet.Description")); writers[i].addDeprecatedAPI( deprapi.getList(i), HEADING_KEYS[i], memberTableSummary, memberTableHeader, div); } } body.addContent(div); addNavLinks(false, body); addBottom(body); printHtmlDocument(null, true, body); }
/** * Add the package use information. * * @param contentTree the content tree to which the package use information will be added */ protected void addPackageUse(Content contentTree) throws IOException { HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.addStyle(HtmlStyle.blockList); if (configuration.packages.length > 1) { addPackageList(ul); } addClassList(ul); contentTree.addContent(ul); }
/** * Add the line numbers for the source code. * * @param pre the content tree to which the line number will be added * @param lineno The line number */ private static void addLineNo(Content pre, int lineno) { HtmlTree span = new HtmlTree(HtmlTag.SPAN); span.addStyle(HtmlStyle.sourceLineNo); if (lineno < 10) { span.addContent("00" + Integer.toString(lineno)); } else if (lineno < 100) { span.addContent("0" + Integer.toString(lineno)); } else { span.addContent(Integer.toString(lineno)); } pre.addContent(span); }
/** Generate the package use list. */ protected void generatePackageUseFile() throws IOException { Content body = getPackageUseHeader(); HtmlTree div = new HtmlTree(HtmlTag.DIV); div.addStyle(HtmlStyle.contentContainer); if (usingPackageToUsedClasses.isEmpty()) { div.addContent(getResource("doclet.ClassUse_No.usage.of.0", pkgdoc.name())); } else { addPackageUse(div); } body.addContent(div); addNavLinks(false, body); addBottom(body); printHtmlDocument(null, true, body); }
/** * Add the package use information. * * @param pkg the package that used the given package * @param contentTree the content tree to which the information will be added */ protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException { Content tdFirst = HtmlTree.TD( HtmlStyle.colFirst, getHyperLink(Util.getPackageName(pkg), new StringContent(Util.getPackageName(pkg)))); contentTree.addContent(tdFirst); HtmlTree tdLast = new HtmlTree(HtmlTag.TD); tdLast.addStyle(HtmlStyle.colLast); if (pkg != null && pkg.name().length() != 0) { addSummaryComment(pkg, tdLast); } else { tdLast.addContent(getSpace()); } contentTree.addContent(tdLast); }
/** {@inheritDoc} */ @Override public void setSummaryColumnStyle(HtmlTree tdTree) { if (foundNonPubConstructor) tdTree.addStyle(HtmlStyle.colLast); else tdTree.addStyle(HtmlStyle.colOne); }