duke@1: /* jjg@1735: * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. duke@1: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: * duke@1: * This code is free software; you can redistribute it and/or modify it duke@1: * under the terms of the GNU General Public License version 2 only, as ohair@554: * published by the Free Software Foundation. Oracle designates this duke@1: * particular file as subject to the "Classpath" exception as provided ohair@554: * by Oracle in the LICENSE file that accompanied this code. duke@1: * duke@1: * This code is distributed in the hope that it will be useful, but WITHOUT duke@1: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: * version 2 for more details (a copy is included in the LICENSE file that duke@1: * accompanied this code). duke@1: * duke@1: * You should have received a copy of the GNU General Public License version duke@1: * 2 along with this work; if not, write to the Free Software Foundation, duke@1: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: * ohair@554: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@554: * or visit www.oracle.com if you need additional information or have any ohair@554: * questions. duke@1: */ duke@1: duke@1: package com.sun.tools.doclets.formats.html; duke@1: jjg@1965: import java.io.IOException; jjg@1965: import java.util.ArrayList; jjg@1965: import java.util.Collections; jjg@1965: import java.util.HashMap; jjg@1965: import java.util.Iterator; jjg@1965: import java.util.List; jjg@1965: import java.util.Map; jjg@1965: import java.util.Set; jjg@1965: import java.util.SortedSet; jjg@1965: import java.util.TreeSet; jjg@1357: bpatel@766: import com.sun.javadoc.*; bpatel@766: import com.sun.tools.doclets.formats.html.markup.*; bpatel@766: import com.sun.tools.doclets.internal.toolkit.*; jjg@1357: import com.sun.tools.doclets.internal.toolkit.util.*; duke@1: duke@1: /** duke@1: * Generate class usage information. duke@1: * jjg@1359: *

This is NOT part of any supported API. jjg@1359: * If you write code that depends on this, you do so at your own risk. jjg@1359: * This code and its internal interfaces are subject to change or jjg@1359: * deletion without notice. jjg@1359: * duke@1: * @author Robert G. Field bpatel@243: * @author Bhavesh Patel (Modified) duke@1: */ duke@1: public class ClassUseWriter extends SubWriterHolderWriter { duke@1: duke@1: final ClassDoc classdoc; mcimadamore@184: Set pkgToPackageAnnotations = null; jjg@74: final Map> pkgToClassTypeParameter; jjg@74: final Map> pkgToClassAnnotations; jjg@74: final Map> pkgToMethodTypeParameter; jjg@74: final Map> pkgToMethodArgTypeParameter; jjg@74: final Map> pkgToMethodReturnTypeParameter; jjg@74: final Map> pkgToMethodAnnotations; jjg@74: final Map> pkgToMethodParameterAnnotations; jjg@74: final Map> pkgToFieldTypeParameter; jjg@74: final Map> pkgToFieldAnnotations; jjg@74: final Map> pkgToSubclass; jjg@74: final Map> pkgToSubinterface; jjg@74: final Map> pkgToImplementingClass; jjg@74: final Map> pkgToField; jjg@74: final Map> pkgToMethodReturn; jjg@74: final Map> pkgToMethodArgs; jjg@74: final Map> pkgToMethodThrows; jjg@74: final Map> pkgToConstructorAnnotations; jjg@74: final Map> pkgToConstructorParameterAnnotations; jjg@74: final Map> pkgToConstructorArgs; jjg@74: final Map> pkgToConstructorArgTypeParameter; jjg@74: final Map> pkgToConstructorThrows; jjg@74: final SortedSet pkgSet; duke@1: final MethodWriterImpl methodSubWriter; duke@1: final ConstructorWriterImpl constrSubWriter; duke@1: final FieldWriterImpl fieldSubWriter; duke@1: final NestedClassWriterImpl classSubWriter; bpatel@243: // Summary for various use tables. bpatel@243: final String classUseTableSummary; bpatel@243: final String subclassUseTableSummary; bpatel@243: final String subinterfaceUseTableSummary; bpatel@243: final String fieldUseTableSummary; bpatel@243: final String methodUseTableSummary; bpatel@243: final String constructorUseTableSummary; duke@1: duke@1: /** duke@1: * Constructor. duke@1: * duke@1: * @param filename the file to be generated. duke@1: * @throws IOException duke@1: * @throws DocletAbortException duke@1: */ duke@1: public ClassUseWriter(ConfigurationImpl configuration, jjg@1372: ClassUseMapper mapper, DocPath filename, duke@1: ClassDoc classdoc) throws IOException { jjg@1372: super(configuration, filename); duke@1: this.classdoc = classdoc; duke@1: if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName())) jjg@1965: pkgToPackageAnnotations = new TreeSet(mapper.classToPackageAnnotations.get(classdoc.qualifiedName())); duke@1: configuration.currentcd = classdoc; jjg@74: this.pkgSet = new TreeSet(); duke@1: this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam); duke@1: this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations); duke@1: this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam); duke@1: this.pkgToMethodArgTypeParameter = pkgDivide(mapper.classToExecMemberDocArgTypeParam); duke@1: this.pkgToFieldTypeParameter = pkgDivide(mapper.classToFieldDocTypeParam); duke@1: this.pkgToFieldAnnotations = pkgDivide(mapper.annotationToFieldDoc); duke@1: this.pkgToMethodReturnTypeParameter = pkgDivide(mapper.classToExecMemberDocReturnTypeParam); duke@1: this.pkgToMethodAnnotations = pkgDivide(mapper.classToExecMemberDocAnnotations); duke@1: this.pkgToMethodParameterAnnotations = pkgDivide(mapper.classToExecMemberDocParamAnnotation); duke@1: this.pkgToSubclass = pkgDivide(mapper.classToSubclass); duke@1: this.pkgToSubinterface = pkgDivide(mapper.classToSubinterface); duke@1: this.pkgToImplementingClass = pkgDivide(mapper.classToImplementingClass); duke@1: this.pkgToField = pkgDivide(mapper.classToField); duke@1: this.pkgToMethodReturn = pkgDivide(mapper.classToMethodReturn); duke@1: this.pkgToMethodArgs = pkgDivide(mapper.classToMethodArgs); duke@1: this.pkgToMethodThrows = pkgDivide(mapper.classToMethodThrows); duke@1: this.pkgToConstructorAnnotations = pkgDivide(mapper.classToConstructorAnnotations); duke@1: this.pkgToConstructorParameterAnnotations = pkgDivide(mapper.classToConstructorParamAnnotation); duke@1: this.pkgToConstructorArgs = pkgDivide(mapper.classToConstructorArgs); duke@1: this.pkgToConstructorArgTypeParameter = pkgDivide(mapper.classToConstructorDocArgTypeParam); duke@1: this.pkgToConstructorThrows = pkgDivide(mapper.classToConstructorThrows); duke@1: //tmp test duke@1: if (pkgSet.size() > 0 && duke@1: mapper.classToPackage.containsKey(classdoc.qualifiedName()) && duke@1: !pkgSet.equals(mapper.classToPackage.get(classdoc.qualifiedName()))) { duke@1: configuration.root.printWarning("Internal error: package sets don't match: " + pkgSet + " with: " + duke@1: mapper.classToPackage.get(classdoc.qualifiedName())); duke@1: } duke@1: methodSubWriter = new MethodWriterImpl(this); duke@1: constrSubWriter = new ConstructorWriterImpl(this); duke@1: fieldSubWriter = new FieldWriterImpl(this); duke@1: classSubWriter = new NestedClassWriterImpl(this); bpatel@243: classUseTableSummary = configuration.getText("doclet.Use_Table_Summary", bpatel@243: configuration.getText("doclet.classes")); bpatel@243: subclassUseTableSummary = configuration.getText("doclet.Use_Table_Summary", bpatel@243: configuration.getText("doclet.subclasses")); bpatel@243: subinterfaceUseTableSummary = configuration.getText("doclet.Use_Table_Summary", bpatel@243: configuration.getText("doclet.subinterfaces")); bpatel@243: fieldUseTableSummary = configuration.getText("doclet.Use_Table_Summary", bpatel@243: configuration.getText("doclet.fields")); bpatel@243: methodUseTableSummary = configuration.getText("doclet.Use_Table_Summary", bpatel@243: configuration.getText("doclet.methods")); bpatel@243: constructorUseTableSummary = configuration.getText("doclet.Use_Table_Summary", bpatel@243: configuration.getText("doclet.constructors")); duke@1: } duke@1: duke@1: /** duke@1: * Write out class use pages. duke@1: * @throws DocletAbortException duke@1: */ duke@1: public static void generate(ConfigurationImpl configuration, duke@1: ClassTree classtree) { duke@1: ClassUseMapper mapper = new ClassUseMapper(configuration.root, classtree); duke@1: ClassDoc[] classes = configuration.root.classes(); duke@1: for (int i = 0; i < classes.length; i++) { bpatel@995: // If -nodeprecated option is set and the containing package is marked bpatel@995: // as deprecated, do not generate the class-use page. We will still generate bpatel@995: // the class-use page if the class is marked as deprecated but the containing bpatel@995: // package is not since it could still be linked from that package-use page. bpatel@995: if (!(configuration.nodeprecated && bpatel@995: Util.isDeprecated(classes[i].containingPackage()))) bpatel@995: ClassUseWriter.generate(configuration, mapper, classes[i]); duke@1: } duke@1: PackageDoc[] pkgs = configuration.packages; duke@1: for (int i = 0; i < pkgs.length; i++) { bpatel@995: // If -nodeprecated option is set and the package is marked bpatel@995: // as deprecated, do not generate the package-use page. bpatel@995: if (!(configuration.nodeprecated && Util.isDeprecated(pkgs[i]))) bpatel@995: PackageUseWriter.generate(configuration, mapper, pkgs[i]); duke@1: } duke@1: } duke@1: jjg@74: private Map> pkgDivide(Map> classMap) { jjg@74: Map> map = new HashMap>(); jjg@74: List list= classMap.get(classdoc.qualifiedName()); duke@1: if (list != null) { duke@1: Collections.sort(list); jjg@74: Iterator it = list.iterator(); duke@1: while (it.hasNext()) { jjg@74: ProgramElementDoc doc = it.next(); duke@1: PackageDoc pkg = doc.containingPackage(); duke@1: pkgSet.add(pkg); jjg@74: List inPkg = map.get(pkg.name()); duke@1: if (inPkg == null) { jjg@74: inPkg = new ArrayList(); duke@1: map.put(pkg.name(), inPkg); duke@1: } duke@1: inPkg.add(doc); duke@1: } duke@1: } duke@1: return map; duke@1: } duke@1: duke@1: /** duke@1: * Generate a class page. duke@1: */ duke@1: public static void generate(ConfigurationImpl configuration, duke@1: ClassUseMapper mapper, ClassDoc classdoc) { duke@1: ClassUseWriter clsgen; jjg@1372: DocPath path = DocPath.forPackage(classdoc) jjg@1372: .resolve(DocPaths.CLASS_USE) jjg@1372: .resolve(DocPath.forName(classdoc)); duke@1: try { duke@1: clsgen = new ClassUseWriter(configuration, jjg@1372: mapper, path, jjg@1372: classdoc); duke@1: clsgen.generateClassUseFile(); duke@1: clsgen.close(); duke@1: } catch (IOException exc) { duke@1: configuration.standardmessage. duke@1: error("doclet.exception_encountered", jjg@1372: exc.toString(), path.getPath()); jjg@1985: throw new DocletAbortException(exc); duke@1: } duke@1: } duke@1: duke@1: /** bpatel@766: * Generate the class use list. duke@1: */ duke@1: protected void generateClassUseFile() throws IOException { bpatel@766: Content body = getClassUseHeader(); bpatel@766: HtmlTree div = new HtmlTree(HtmlTag.DIV); bpatel@766: div.addStyle(HtmlStyle.classUseContainer); duke@1: if (pkgSet.size() > 0) { bpatel@766: addClassUse(div); duke@1: } else { bpatel@766: div.addContent(getResource("doclet.ClassUse_No.usage.of.0", bpatel@766: classdoc.qualifiedName())); duke@1: } bpatel@766: body.addContent(div); bpatel@766: addNavLinks(false, body); bpatel@766: addBottom(body); bpatel@766: printHtmlDocument(null, true, body); duke@1: } duke@1: duke@1: /** bpatel@766: * Add the class use documentation. bpatel@766: * bpatel@766: * @param contentTree the content tree to which the class use information will be added duke@1: */ bpatel@766: protected void addClassUse(Content contentTree) throws IOException { bpatel@766: HtmlTree ul = new HtmlTree(HtmlTag.UL); bpatel@766: ul.addStyle(HtmlStyle.blockList); bpatel@766: if (configuration.packages.length > 1) { bpatel@766: addPackageList(ul); bpatel@766: addPackageAnnotationList(ul); bpatel@766: } bpatel@766: addClassList(ul); bpatel@766: contentTree.addContent(ul); duke@1: } duke@1: duke@1: /** bpatel@766: * Add the packages list that use the given class. bpatel@766: * bpatel@766: * @param contentTree the content tree to which the packages list will be added duke@1: */ bpatel@766: protected void addPackageList(Content contentTree) throws IOException { bpatel@2084: Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, useTableSummary, jjg@1747: getTableCaption(configuration.getResource( bpatel@766: "doclet.ClassUse_Packages.that.use.0", jjg@1738: getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc jjg@1747: ))))); bpatel@766: table.addContent(getSummaryTableHeader(packageTableHeader, "col")); bpatel@766: Content tbody = new HtmlTree(HtmlTag.TBODY); bpatel@766: Iterator it = pkgSet.iterator(); bpatel@766: for (int i = 0; it.hasNext(); i++) { bpatel@766: PackageDoc pkg = it.next(); bpatel@766: HtmlTree tr = new HtmlTree(HtmlTag.TR); bpatel@766: if (i % 2 == 0) { bpatel@766: tr.addStyle(HtmlStyle.altColor); bpatel@766: } else { bpatel@766: tr.addStyle(HtmlStyle.rowColor); bpatel@766: } bpatel@766: addPackageUse(pkg, tr); bpatel@766: tbody.addContent(tr); bpatel@766: } bpatel@766: table.addContent(tbody); bpatel@766: Content li = HtmlTree.LI(HtmlStyle.blockList, table); bpatel@766: contentTree.addContent(li); duke@1: } duke@1: duke@1: /** bpatel@766: * Add the package annotation list. bpatel@766: * bpatel@766: * @param contentTree the content tree to which the package annotation list will be added duke@1: */ bpatel@766: protected void addPackageAnnotationList(Content contentTree) throws IOException { bpatel@766: if ((!classdoc.isAnnotationType()) || bpatel@766: pkgToPackageAnnotations == null || jjg@1410: pkgToPackageAnnotations.isEmpty()) { bpatel@766: return; bpatel@766: } bpatel@2084: Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, useTableSummary, jjg@1747: getTableCaption(configuration.getResource( bpatel@766: "doclet.ClassUse_PackageAnnotation", jjg@1410: getLink(new LinkInfoImpl(configuration, jjg@1747: LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc))))); bpatel@766: table.addContent(getSummaryTableHeader(packageTableHeader, "col")); bpatel@766: Content tbody = new HtmlTree(HtmlTag.TBODY); bpatel@766: Iterator it = pkgToPackageAnnotations.iterator(); bpatel@766: for (int i = 0; it.hasNext(); i++) { bpatel@766: PackageDoc pkg = it.next(); bpatel@766: HtmlTree tr = new HtmlTree(HtmlTag.TR); bpatel@766: if (i % 2 == 0) { bpatel@766: tr.addStyle(HtmlStyle.altColor); bpatel@766: } else { bpatel@766: tr.addStyle(HtmlStyle.rowColor); bpatel@766: } bpatel@766: Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst, bpatel@766: getPackageLink(pkg, new StringContent(pkg.name()))); bpatel@766: tr.addContent(tdFirst); bpatel@766: HtmlTree tdLast = new HtmlTree(HtmlTag.TD); bpatel@766: tdLast.addStyle(HtmlStyle.colLast); bpatel@927: addSummaryComment(pkg, tdLast); bpatel@766: tr.addContent(tdLast); bpatel@766: tbody.addContent(tr); bpatel@766: } bpatel@766: table.addContent(tbody); bpatel@766: Content li = HtmlTree.LI(HtmlStyle.blockList, table); bpatel@766: contentTree.addContent(li); duke@1: } duke@1: duke@1: /** bpatel@766: * Add the class list that use the given class. bpatel@766: * bpatel@766: * @param contentTree the content tree to which the class list will be added duke@1: */ bpatel@766: protected void addClassList(Content contentTree) throws IOException { bpatel@766: HtmlTree ul = new HtmlTree(HtmlTag.UL); bpatel@766: ul.addStyle(HtmlStyle.blockList); bpatel@766: for (Iterator it = pkgSet.iterator(); it.hasNext();) { bpatel@766: PackageDoc pkg = it.next(); bpatel@766: Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name())); jjg@1740: Content link = getResource("doclet.ClassUse_Uses.of.0.in.1", jjg@1735: getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, jjg@1740: classdoc)), jjg@1740: getPackageLink(pkg, Util.getPackageName(pkg))); bpatel@766: Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link); bpatel@766: li.addContent(heading); bpatel@766: addClassUse(pkg, li); bpatel@766: ul.addContent(li); bpatel@766: } bpatel@766: Content li = HtmlTree.LI(HtmlStyle.blockList, ul); bpatel@766: contentTree.addContent(li); duke@1: } duke@1: duke@1: /** bpatel@766: * Add the package use information. bpatel@766: * bpatel@766: * @param pkg the package that uses the given class bpatel@766: * @param contentTree the content tree to which the package use information will be added duke@1: */ bpatel@766: protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException { bpatel@766: Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst, jjg@1372: getHyperLink(pkg.name(), new StringContent(Util.getPackageName(pkg)))); bpatel@766: contentTree.addContent(tdFirst); bpatel@766: HtmlTree tdLast = new HtmlTree(HtmlTag.TD); bpatel@766: tdLast.addStyle(HtmlStyle.colLast); bpatel@927: addSummaryComment(pkg, tdLast); bpatel@766: contentTree.addContent(tdLast); duke@1: } duke@1: duke@1: /** bpatel@766: * Add the class use information. bpatel@766: * bpatel@766: * @param pkg the package that uses the given class bpatel@766: * @param contentTree the content tree to which the class use information will be added duke@1: */ bpatel@766: protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException { jjg@1747: Content classLink = getLink(new LinkInfoImpl(configuration, jjg@1747: LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)); jjg@1747: Content pkgLink = getPackageLink(pkg, Util.getPackageName(pkg)); bpatel@766: classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_Annotation", classLink, bpatel@766: pkgLink), classUseTableSummary, contentTree); bpatel@766: classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_TypeParameter", classLink, bpatel@766: pkgLink), classUseTableSummary, contentTree); bpatel@766: classSubWriter.addUseInfo(pkgToSubclass.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_Subclass", classLink, bpatel@766: pkgLink), subclassUseTableSummary, contentTree); bpatel@766: classSubWriter.addUseInfo(pkgToSubinterface.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_Subinterface", classLink, bpatel@766: pkgLink), subinterfaceUseTableSummary, contentTree); bpatel@766: classSubWriter.addUseInfo(pkgToImplementingClass.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_ImplementingClass", classLink, bpatel@766: pkgLink), classUseTableSummary, contentTree); bpatel@766: fieldSubWriter.addUseInfo(pkgToField.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_Field", classLink, bpatel@766: pkgLink), fieldUseTableSummary, contentTree); bpatel@766: fieldSubWriter.addUseInfo(pkgToFieldAnnotations.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_FieldAnnotations", classLink, bpatel@766: pkgLink), fieldUseTableSummary, contentTree); bpatel@766: fieldSubWriter.addUseInfo(pkgToFieldTypeParameter.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_FieldTypeParameter", classLink, bpatel@766: pkgLink), fieldUseTableSummary, contentTree); bpatel@766: methodSubWriter.addUseInfo(pkgToMethodAnnotations.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_MethodAnnotations", classLink, bpatel@766: pkgLink), methodUseTableSummary, contentTree); bpatel@766: methodSubWriter.addUseInfo(pkgToMethodParameterAnnotations.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_MethodParameterAnnotations", classLink, bpatel@766: pkgLink), methodUseTableSummary, contentTree); bpatel@766: methodSubWriter.addUseInfo(pkgToMethodTypeParameter.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_MethodTypeParameter", classLink, bpatel@766: pkgLink), methodUseTableSummary, contentTree); bpatel@766: methodSubWriter.addUseInfo(pkgToMethodReturn.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_MethodReturn", classLink, bpatel@766: pkgLink), methodUseTableSummary, contentTree); bpatel@766: methodSubWriter.addUseInfo(pkgToMethodReturnTypeParameter.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_MethodReturnTypeParameter", classLink, bpatel@766: pkgLink), methodUseTableSummary, contentTree); bpatel@766: methodSubWriter.addUseInfo(pkgToMethodArgs.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_MethodArgs", classLink, bpatel@766: pkgLink), methodUseTableSummary, contentTree); bpatel@766: methodSubWriter.addUseInfo(pkgToMethodArgTypeParameter.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_MethodArgsTypeParameters", classLink, bpatel@766: pkgLink), methodUseTableSummary, contentTree); bpatel@766: methodSubWriter.addUseInfo(pkgToMethodThrows.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_MethodThrows", classLink, bpatel@766: pkgLink), methodUseTableSummary, contentTree); bpatel@766: constrSubWriter.addUseInfo(pkgToConstructorAnnotations.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_ConstructorAnnotations", classLink, bpatel@766: pkgLink), constructorUseTableSummary, contentTree); bpatel@766: constrSubWriter.addUseInfo(pkgToConstructorParameterAnnotations.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_ConstructorParameterAnnotations", classLink, bpatel@766: pkgLink), constructorUseTableSummary, contentTree); bpatel@766: constrSubWriter.addUseInfo(pkgToConstructorArgs.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_ConstructorArgs", classLink, bpatel@766: pkgLink), constructorUseTableSummary, contentTree); bpatel@766: constrSubWriter.addUseInfo(pkgToConstructorArgTypeParameter.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_ConstructorArgsTypeParameters", classLink, bpatel@766: pkgLink), constructorUseTableSummary, contentTree); bpatel@766: constrSubWriter.addUseInfo(pkgToConstructorThrows.get(pkg.name()), jjg@1747: configuration.getResource("doclet.ClassUse_ConstructorThrows", classLink, bpatel@766: pkgLink), constructorUseTableSummary, contentTree); duke@1: } duke@1: bpatel@766: /** bpatel@766: * Get the header for the class use Listing. bpatel@766: * bpatel@766: * @return a content tree representing the class use header bpatel@766: */ bpatel@766: protected Content getClassUseHeader() { bpatel@766: String cltype = configuration.getText(classdoc.isInterface()? bpatel@766: "doclet.Interface":"doclet.Class"); bpatel@766: String clname = classdoc.qualifiedName(); bpatel@766: String title = configuration.getText("doclet.Window_ClassUse_Header", bpatel@766: cltype, clname); bpatel@766: Content bodyTree = getBody(true, getWindowTitle(title)); bpatel@766: addTop(bodyTree); bpatel@766: addNavLinks(true, bodyTree); jjg@1739: ContentBuilder headContent = new ContentBuilder(); jjg@1739: headContent.addContent(getResource("doclet.ClassUse_Title", cltype)); jjg@1739: headContent.addContent(new HtmlTree(HtmlTag.BR)); jjg@1739: headContent.addContent(clname); bpatel@766: Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, bpatel@766: true, HtmlStyle.title, headContent); bpatel@766: Content div = HtmlTree.DIV(HtmlStyle.header, heading); bpatel@766: bodyTree.addContent(div); bpatel@766: return bodyTree; duke@1: } duke@1: bpatel@766: /** bpatel@766: * Get this package link. bpatel@766: * bpatel@766: * @return a content tree for the package link bpatel@766: */ bpatel@766: protected Content getNavLinkPackage() { jjg@1372: Content linkContent = jjg@1373: getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), packageLabel); bpatel@766: Content li = HtmlTree.LI(linkContent); bpatel@766: return li; bpatel@766: } bpatel@766: bpatel@766: /** bpatel@766: * Get class page link. bpatel@766: * bpatel@766: * @return a content tree for the class page link bpatel@766: */ bpatel@766: protected Content getNavLinkClass() { jjg@1736: Content linkContent = getLink(new LinkInfoImpl( jjg@1738: configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc) jjg@1738: .label(configuration.getText("doclet.Class"))); bpatel@766: Content li = HtmlTree.LI(linkContent); bpatel@766: return li; bpatel@766: } bpatel@766: bpatel@766: /** bpatel@766: * Get the use link. bpatel@766: * bpatel@766: * @return a content tree for the use link bpatel@766: */ bpatel@766: protected Content getNavLinkClassUse() { bpatel@766: Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, useLabel); bpatel@766: return li; bpatel@766: } bpatel@766: bpatel@766: /** bpatel@766: * Get the tree link. bpatel@766: * bpatel@766: * @return a content tree for the tree link bpatel@766: */ bpatel@766: protected Content getNavLinkTree() { bpatel@766: Content linkContent = classdoc.containingPackage().isIncluded() ? jjg@1373: getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), treeLabel) : jjg@1373: getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), treeLabel); bpatel@766: Content li = HtmlTree.LI(linkContent); bpatel@766: return li; bpatel@766: } duke@1: }