aoqi@0: /*
aoqi@0: * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0: *
aoqi@0: * This code is free software; you can redistribute it and/or modify it
aoqi@0: * under the terms of the GNU General Public License version 2 only, as
aoqi@0: * published by the Free Software Foundation. Oracle designates this
aoqi@0: * particular file as subject to the "Classpath" exception as provided
aoqi@0: * by Oracle in the LICENSE file that accompanied this code.
aoqi@0: *
aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0: * accompanied this code).
aoqi@0: *
aoqi@0: * You should have received a copy of the GNU General Public License version
aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0: *
aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0: * or visit www.oracle.com if you need additional information or have any
aoqi@0: * questions.
aoqi@0: */
aoqi@0:
aoqi@0: package com.sun.tools.doclets.formats.html;
aoqi@0:
aoqi@0: import java.io.IOException;
aoqi@0: import java.util.ArrayList;
aoqi@0: import java.util.Collections;
aoqi@0: import java.util.HashMap;
aoqi@0: import java.util.Iterator;
aoqi@0: import java.util.List;
aoqi@0: import java.util.Map;
aoqi@0: import java.util.Set;
aoqi@0: import java.util.SortedSet;
aoqi@0: import java.util.TreeSet;
aoqi@0:
aoqi@0: import com.sun.javadoc.*;
aoqi@0: import com.sun.tools.doclets.formats.html.markup.*;
aoqi@0: import com.sun.tools.doclets.internal.toolkit.*;
aoqi@0: import com.sun.tools.doclets.internal.toolkit.util.*;
aoqi@0:
aoqi@0: /**
aoqi@0: * Generate class usage information.
aoqi@0: *
aoqi@0: *
This is NOT part of any supported API.
aoqi@0: * If you write code that depends on this, you do so at your own risk.
aoqi@0: * This code and its internal interfaces are subject to change or
aoqi@0: * deletion without notice.
aoqi@0: *
aoqi@0: * @author Robert G. Field
aoqi@0: * @author Bhavesh Patel (Modified)
aoqi@0: */
aoqi@0: public class ClassUseWriter extends SubWriterHolderWriter {
aoqi@0:
aoqi@0: final ClassDoc classdoc;
aoqi@0: Set pkgToPackageAnnotations = null;
aoqi@0: final Map> pkgToClassTypeParameter;
aoqi@0: final Map> pkgToClassAnnotations;
aoqi@0: final Map> pkgToMethodTypeParameter;
aoqi@0: final Map> pkgToMethodArgTypeParameter;
aoqi@0: final Map> pkgToMethodReturnTypeParameter;
aoqi@0: final Map> pkgToMethodAnnotations;
aoqi@0: final Map> pkgToMethodParameterAnnotations;
aoqi@0: final Map> pkgToFieldTypeParameter;
aoqi@0: final Map> pkgToFieldAnnotations;
aoqi@0: final Map> pkgToSubclass;
aoqi@0: final Map> pkgToSubinterface;
aoqi@0: final Map> pkgToImplementingClass;
aoqi@0: final Map> pkgToField;
aoqi@0: final Map> pkgToMethodReturn;
aoqi@0: final Map> pkgToMethodArgs;
aoqi@0: final Map> pkgToMethodThrows;
aoqi@0: final Map> pkgToConstructorAnnotations;
aoqi@0: final Map> pkgToConstructorParameterAnnotations;
aoqi@0: final Map> pkgToConstructorArgs;
aoqi@0: final Map> pkgToConstructorArgTypeParameter;
aoqi@0: final Map> pkgToConstructorThrows;
aoqi@0: final SortedSet pkgSet;
aoqi@0: final MethodWriterImpl methodSubWriter;
aoqi@0: final ConstructorWriterImpl constrSubWriter;
aoqi@0: final FieldWriterImpl fieldSubWriter;
aoqi@0: final NestedClassWriterImpl classSubWriter;
aoqi@0: // Summary for various use tables.
aoqi@0: final String classUseTableSummary;
aoqi@0: final String subclassUseTableSummary;
aoqi@0: final String subinterfaceUseTableSummary;
aoqi@0: final String fieldUseTableSummary;
aoqi@0: final String methodUseTableSummary;
aoqi@0: final String constructorUseTableSummary;
aoqi@0:
aoqi@0: /**
aoqi@0: * Constructor.
aoqi@0: *
aoqi@0: * @param filename the file to be generated.
aoqi@0: * @throws IOException
aoqi@0: * @throws DocletAbortException
aoqi@0: */
aoqi@0: public ClassUseWriter(ConfigurationImpl configuration,
aoqi@0: ClassUseMapper mapper, DocPath filename,
aoqi@0: ClassDoc classdoc) throws IOException {
aoqi@0: super(configuration, filename);
aoqi@0: this.classdoc = classdoc;
aoqi@0: if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName()))
aoqi@0: pkgToPackageAnnotations = new TreeSet(mapper.classToPackageAnnotations.get(classdoc.qualifiedName()));
aoqi@0: configuration.currentcd = classdoc;
aoqi@0: this.pkgSet = new TreeSet();
aoqi@0: this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam);
aoqi@0: this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations);
aoqi@0: this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam);
aoqi@0: this.pkgToMethodArgTypeParameter = pkgDivide(mapper.classToExecMemberDocArgTypeParam);
aoqi@0: this.pkgToFieldTypeParameter = pkgDivide(mapper.classToFieldDocTypeParam);
aoqi@0: this.pkgToFieldAnnotations = pkgDivide(mapper.annotationToFieldDoc);
aoqi@0: this.pkgToMethodReturnTypeParameter = pkgDivide(mapper.classToExecMemberDocReturnTypeParam);
aoqi@0: this.pkgToMethodAnnotations = pkgDivide(mapper.classToExecMemberDocAnnotations);
aoqi@0: this.pkgToMethodParameterAnnotations = pkgDivide(mapper.classToExecMemberDocParamAnnotation);
aoqi@0: this.pkgToSubclass = pkgDivide(mapper.classToSubclass);
aoqi@0: this.pkgToSubinterface = pkgDivide(mapper.classToSubinterface);
aoqi@0: this.pkgToImplementingClass = pkgDivide(mapper.classToImplementingClass);
aoqi@0: this.pkgToField = pkgDivide(mapper.classToField);
aoqi@0: this.pkgToMethodReturn = pkgDivide(mapper.classToMethodReturn);
aoqi@0: this.pkgToMethodArgs = pkgDivide(mapper.classToMethodArgs);
aoqi@0: this.pkgToMethodThrows = pkgDivide(mapper.classToMethodThrows);
aoqi@0: this.pkgToConstructorAnnotations = pkgDivide(mapper.classToConstructorAnnotations);
aoqi@0: this.pkgToConstructorParameterAnnotations = pkgDivide(mapper.classToConstructorParamAnnotation);
aoqi@0: this.pkgToConstructorArgs = pkgDivide(mapper.classToConstructorArgs);
aoqi@0: this.pkgToConstructorArgTypeParameter = pkgDivide(mapper.classToConstructorDocArgTypeParam);
aoqi@0: this.pkgToConstructorThrows = pkgDivide(mapper.classToConstructorThrows);
aoqi@0: //tmp test
aoqi@0: if (pkgSet.size() > 0 &&
aoqi@0: mapper.classToPackage.containsKey(classdoc.qualifiedName()) &&
aoqi@0: !pkgSet.equals(mapper.classToPackage.get(classdoc.qualifiedName()))) {
aoqi@0: configuration.root.printWarning("Internal error: package sets don't match: " + pkgSet + " with: " +
aoqi@0: mapper.classToPackage.get(classdoc.qualifiedName()));
aoqi@0: }
aoqi@0: methodSubWriter = new MethodWriterImpl(this);
aoqi@0: constrSubWriter = new ConstructorWriterImpl(this);
aoqi@0: fieldSubWriter = new FieldWriterImpl(this);
aoqi@0: classSubWriter = new NestedClassWriterImpl(this);
aoqi@0: classUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
aoqi@0: configuration.getText("doclet.classes"));
aoqi@0: subclassUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
aoqi@0: configuration.getText("doclet.subclasses"));
aoqi@0: subinterfaceUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
aoqi@0: configuration.getText("doclet.subinterfaces"));
aoqi@0: fieldUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
aoqi@0: configuration.getText("doclet.fields"));
aoqi@0: methodUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
aoqi@0: configuration.getText("doclet.methods"));
aoqi@0: constructorUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
aoqi@0: configuration.getText("doclet.constructors"));
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Write out class use pages.
aoqi@0: * @throws DocletAbortException
aoqi@0: */
aoqi@0: public static void generate(ConfigurationImpl configuration,
aoqi@0: ClassTree classtree) {
aoqi@0: ClassUseMapper mapper = new ClassUseMapper(configuration.root, classtree);
aoqi@0: ClassDoc[] classes = configuration.root.classes();
aoqi@0: for (int i = 0; i < classes.length; i++) {
aoqi@0: // If -nodeprecated option is set and the containing package is marked
aoqi@0: // as deprecated, do not generate the class-use page. We will still generate
aoqi@0: // the class-use page if the class is marked as deprecated but the containing
aoqi@0: // package is not since it could still be linked from that package-use page.
aoqi@0: if (!(configuration.nodeprecated &&
aoqi@0: Util.isDeprecated(classes[i].containingPackage())))
aoqi@0: ClassUseWriter.generate(configuration, mapper, classes[i]);
aoqi@0: }
aoqi@0: PackageDoc[] pkgs = configuration.packages;
aoqi@0: for (int i = 0; i < pkgs.length; i++) {
aoqi@0: // If -nodeprecated option is set and the package is marked
aoqi@0: // as deprecated, do not generate the package-use page.
aoqi@0: if (!(configuration.nodeprecated && Util.isDeprecated(pkgs[i])))
aoqi@0: PackageUseWriter.generate(configuration, mapper, pkgs[i]);
aoqi@0: }
aoqi@0: }
aoqi@0:
aoqi@0: private Map> pkgDivide(Map> classMap) {
aoqi@0: Map> map = new HashMap>();
aoqi@0: List extends ProgramElementDoc> list= classMap.get(classdoc.qualifiedName());
aoqi@0: if (list != null) {
aoqi@0: Collections.sort(list);
aoqi@0: Iterator extends ProgramElementDoc> it = list.iterator();
aoqi@0: while (it.hasNext()) {
aoqi@0: ProgramElementDoc doc = it.next();
aoqi@0: PackageDoc pkg = doc.containingPackage();
aoqi@0: pkgSet.add(pkg);
aoqi@0: List inPkg = map.get(pkg.name());
aoqi@0: if (inPkg == null) {
aoqi@0: inPkg = new ArrayList();
aoqi@0: map.put(pkg.name(), inPkg);
aoqi@0: }
aoqi@0: inPkg.add(doc);
aoqi@0: }
aoqi@0: }
aoqi@0: return map;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Generate a class page.
aoqi@0: */
aoqi@0: public static void generate(ConfigurationImpl configuration,
aoqi@0: ClassUseMapper mapper, ClassDoc classdoc) {
aoqi@0: ClassUseWriter clsgen;
aoqi@0: DocPath path = DocPath.forPackage(classdoc)
aoqi@0: .resolve(DocPaths.CLASS_USE)
aoqi@0: .resolve(DocPath.forName(classdoc));
aoqi@0: try {
aoqi@0: clsgen = new ClassUseWriter(configuration,
aoqi@0: mapper, path,
aoqi@0: classdoc);
aoqi@0: clsgen.generateClassUseFile();
aoqi@0: clsgen.close();
aoqi@0: } catch (IOException exc) {
aoqi@0: configuration.standardmessage.
aoqi@0: error("doclet.exception_encountered",
aoqi@0: exc.toString(), path.getPath());
aoqi@0: throw new DocletAbortException(exc);
aoqi@0: }
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Generate the class use list.
aoqi@0: */
aoqi@0: protected void generateClassUseFile() throws IOException {
aoqi@0: Content body = getClassUseHeader();
aoqi@0: HtmlTree div = new HtmlTree(HtmlTag.DIV);
aoqi@0: div.addStyle(HtmlStyle.classUseContainer);
aoqi@0: if (pkgSet.size() > 0) {
aoqi@0: addClassUse(div);
aoqi@0: } else {
aoqi@0: div.addContent(getResource("doclet.ClassUse_No.usage.of.0",
aoqi@0: classdoc.qualifiedName()));
aoqi@0: }
aoqi@0: body.addContent(div);
aoqi@0: addNavLinks(false, body);
aoqi@0: addBottom(body);
aoqi@0: printHtmlDocument(null, true, body);
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Add the class use documentation.
aoqi@0: *
aoqi@0: * @param contentTree the content tree to which the class use information will be added
aoqi@0: */
aoqi@0: protected void addClassUse(Content contentTree) throws IOException {
aoqi@0: HtmlTree ul = new HtmlTree(HtmlTag.UL);
aoqi@0: ul.addStyle(HtmlStyle.blockList);
aoqi@0: if (configuration.packages.length > 1) {
aoqi@0: addPackageList(ul);
aoqi@0: addPackageAnnotationList(ul);
aoqi@0: }
aoqi@0: addClassList(ul);
aoqi@0: contentTree.addContent(ul);
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Add the packages list that use the given class.
aoqi@0: *
aoqi@0: * @param contentTree the content tree to which the packages list will be added
aoqi@0: */
aoqi@0: protected void addPackageList(Content contentTree) throws IOException {
aoqi@0: Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, useTableSummary,
aoqi@0: getTableCaption(configuration.getResource(
aoqi@0: "doclet.ClassUse_Packages.that.use.0",
aoqi@0: getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc
aoqi@0: )))));
aoqi@0: table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
aoqi@0: Content tbody = new HtmlTree(HtmlTag.TBODY);
aoqi@0: Iterator it = pkgSet.iterator();
aoqi@0: for (int i = 0; it.hasNext(); i++) {
aoqi@0: PackageDoc pkg = it.next();
aoqi@0: HtmlTree tr = new HtmlTree(HtmlTag.TR);
aoqi@0: if (i % 2 == 0) {
aoqi@0: tr.addStyle(HtmlStyle.altColor);
aoqi@0: } else {
aoqi@0: tr.addStyle(HtmlStyle.rowColor);
aoqi@0: }
aoqi@0: addPackageUse(pkg, tr);
aoqi@0: tbody.addContent(tr);
aoqi@0: }
aoqi@0: table.addContent(tbody);
aoqi@0: Content li = HtmlTree.LI(HtmlStyle.blockList, table);
aoqi@0: contentTree.addContent(li);
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Add the package annotation list.
aoqi@0: *
aoqi@0: * @param contentTree the content tree to which the package annotation list will be added
aoqi@0: */
aoqi@0: protected void addPackageAnnotationList(Content contentTree) throws IOException {
aoqi@0: if ((!classdoc.isAnnotationType()) ||
aoqi@0: pkgToPackageAnnotations == null ||
aoqi@0: pkgToPackageAnnotations.isEmpty()) {
aoqi@0: return;
aoqi@0: }
aoqi@0: Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, useTableSummary,
aoqi@0: getTableCaption(configuration.getResource(
aoqi@0: "doclet.ClassUse_PackageAnnotation",
aoqi@0: getLink(new LinkInfoImpl(configuration,
aoqi@0: LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)))));
aoqi@0: table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
aoqi@0: Content tbody = new HtmlTree(HtmlTag.TBODY);
aoqi@0: Iterator it = pkgToPackageAnnotations.iterator();
aoqi@0: for (int i = 0; it.hasNext(); i++) {
aoqi@0: PackageDoc pkg = it.next();
aoqi@0: HtmlTree tr = new HtmlTree(HtmlTag.TR);
aoqi@0: if (i % 2 == 0) {
aoqi@0: tr.addStyle(HtmlStyle.altColor);
aoqi@0: } else {
aoqi@0: tr.addStyle(HtmlStyle.rowColor);
aoqi@0: }
aoqi@0: Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
aoqi@0: getPackageLink(pkg, new StringContent(pkg.name())));
aoqi@0: tr.addContent(tdFirst);
aoqi@0: HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
aoqi@0: tdLast.addStyle(HtmlStyle.colLast);
aoqi@0: addSummaryComment(pkg, tdLast);
aoqi@0: tr.addContent(tdLast);
aoqi@0: tbody.addContent(tr);
aoqi@0: }
aoqi@0: table.addContent(tbody);
aoqi@0: Content li = HtmlTree.LI(HtmlStyle.blockList, table);
aoqi@0: contentTree.addContent(li);
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Add the class list that use the given class.
aoqi@0: *
aoqi@0: * @param contentTree the content tree to which the class list will be added
aoqi@0: */
aoqi@0: protected void addClassList(Content contentTree) throws IOException {
aoqi@0: HtmlTree ul = new HtmlTree(HtmlTag.UL);
aoqi@0: ul.addStyle(HtmlStyle.blockList);
aoqi@0: for (Iterator it = pkgSet.iterator(); it.hasNext();) {
aoqi@0: PackageDoc pkg = it.next();
aoqi@0: Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name()));
aoqi@0: Content link = getResource("doclet.ClassUse_Uses.of.0.in.1",
aoqi@0: getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
aoqi@0: classdoc)),
aoqi@0: getPackageLink(pkg, Util.getPackageName(pkg)));
aoqi@0: Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
aoqi@0: li.addContent(heading);
aoqi@0: addClassUse(pkg, li);
aoqi@0: ul.addContent(li);
aoqi@0: }
aoqi@0: Content li = HtmlTree.LI(HtmlStyle.blockList, ul);
aoqi@0: contentTree.addContent(li);
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Add the package use information.
aoqi@0: *
aoqi@0: * @param pkg the package that uses the given class
aoqi@0: * @param contentTree the content tree to which the package use information will be added
aoqi@0: */
aoqi@0: protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException {
aoqi@0: Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
aoqi@0: getHyperLink(pkg.name(), new StringContent(Util.getPackageName(pkg))));
aoqi@0: contentTree.addContent(tdFirst);
aoqi@0: HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
aoqi@0: tdLast.addStyle(HtmlStyle.colLast);
aoqi@0: addSummaryComment(pkg, tdLast);
aoqi@0: contentTree.addContent(tdLast);
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Add the class use information.
aoqi@0: *
aoqi@0: * @param pkg the package that uses the given class
aoqi@0: * @param contentTree the content tree to which the class use information will be added
aoqi@0: */
aoqi@0: protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException {
aoqi@0: Content classLink = getLink(new LinkInfoImpl(configuration,
aoqi@0: LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc));
aoqi@0: Content pkgLink = getPackageLink(pkg, Util.getPackageName(pkg));
aoqi@0: classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_Annotation", classLink,
aoqi@0: pkgLink), classUseTableSummary, contentTree);
aoqi@0: classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_TypeParameter", classLink,
aoqi@0: pkgLink), classUseTableSummary, contentTree);
aoqi@0: classSubWriter.addUseInfo(pkgToSubclass.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_Subclass", classLink,
aoqi@0: pkgLink), subclassUseTableSummary, contentTree);
aoqi@0: classSubWriter.addUseInfo(pkgToSubinterface.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_Subinterface", classLink,
aoqi@0: pkgLink), subinterfaceUseTableSummary, contentTree);
aoqi@0: classSubWriter.addUseInfo(pkgToImplementingClass.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_ImplementingClass", classLink,
aoqi@0: pkgLink), classUseTableSummary, contentTree);
aoqi@0: fieldSubWriter.addUseInfo(pkgToField.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_Field", classLink,
aoqi@0: pkgLink), fieldUseTableSummary, contentTree);
aoqi@0: fieldSubWriter.addUseInfo(pkgToFieldAnnotations.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_FieldAnnotations", classLink,
aoqi@0: pkgLink), fieldUseTableSummary, contentTree);
aoqi@0: fieldSubWriter.addUseInfo(pkgToFieldTypeParameter.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_FieldTypeParameter", classLink,
aoqi@0: pkgLink), fieldUseTableSummary, contentTree);
aoqi@0: methodSubWriter.addUseInfo(pkgToMethodAnnotations.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_MethodAnnotations", classLink,
aoqi@0: pkgLink), methodUseTableSummary, contentTree);
aoqi@0: methodSubWriter.addUseInfo(pkgToMethodParameterAnnotations.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_MethodParameterAnnotations", classLink,
aoqi@0: pkgLink), methodUseTableSummary, contentTree);
aoqi@0: methodSubWriter.addUseInfo(pkgToMethodTypeParameter.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_MethodTypeParameter", classLink,
aoqi@0: pkgLink), methodUseTableSummary, contentTree);
aoqi@0: methodSubWriter.addUseInfo(pkgToMethodReturn.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_MethodReturn", classLink,
aoqi@0: pkgLink), methodUseTableSummary, contentTree);
aoqi@0: methodSubWriter.addUseInfo(pkgToMethodReturnTypeParameter.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_MethodReturnTypeParameter", classLink,
aoqi@0: pkgLink), methodUseTableSummary, contentTree);
aoqi@0: methodSubWriter.addUseInfo(pkgToMethodArgs.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_MethodArgs", classLink,
aoqi@0: pkgLink), methodUseTableSummary, contentTree);
aoqi@0: methodSubWriter.addUseInfo(pkgToMethodArgTypeParameter.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_MethodArgsTypeParameters", classLink,
aoqi@0: pkgLink), methodUseTableSummary, contentTree);
aoqi@0: methodSubWriter.addUseInfo(pkgToMethodThrows.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_MethodThrows", classLink,
aoqi@0: pkgLink), methodUseTableSummary, contentTree);
aoqi@0: constrSubWriter.addUseInfo(pkgToConstructorAnnotations.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_ConstructorAnnotations", classLink,
aoqi@0: pkgLink), constructorUseTableSummary, contentTree);
aoqi@0: constrSubWriter.addUseInfo(pkgToConstructorParameterAnnotations.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_ConstructorParameterAnnotations", classLink,
aoqi@0: pkgLink), constructorUseTableSummary, contentTree);
aoqi@0: constrSubWriter.addUseInfo(pkgToConstructorArgs.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_ConstructorArgs", classLink,
aoqi@0: pkgLink), constructorUseTableSummary, contentTree);
aoqi@0: constrSubWriter.addUseInfo(pkgToConstructorArgTypeParameter.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_ConstructorArgsTypeParameters", classLink,
aoqi@0: pkgLink), constructorUseTableSummary, contentTree);
aoqi@0: constrSubWriter.addUseInfo(pkgToConstructorThrows.get(pkg.name()),
aoqi@0: configuration.getResource("doclet.ClassUse_ConstructorThrows", classLink,
aoqi@0: pkgLink), constructorUseTableSummary, contentTree);
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Get the header for the class use Listing.
aoqi@0: *
aoqi@0: * @return a content tree representing the class use header
aoqi@0: */
aoqi@0: protected Content getClassUseHeader() {
aoqi@0: String cltype = configuration.getText(classdoc.isInterface()?
aoqi@0: "doclet.Interface":"doclet.Class");
aoqi@0: String clname = classdoc.qualifiedName();
aoqi@0: String title = configuration.getText("doclet.Window_ClassUse_Header",
aoqi@0: cltype, clname);
aoqi@0: Content bodyTree = getBody(true, getWindowTitle(title));
aoqi@0: addTop(bodyTree);
aoqi@0: addNavLinks(true, bodyTree);
aoqi@0: ContentBuilder headContent = new ContentBuilder();
aoqi@0: headContent.addContent(getResource("doclet.ClassUse_Title", cltype));
aoqi@0: headContent.addContent(new HtmlTree(HtmlTag.BR));
aoqi@0: headContent.addContent(clname);
aoqi@0: Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING,
aoqi@0: true, HtmlStyle.title, headContent);
aoqi@0: Content div = HtmlTree.DIV(HtmlStyle.header, heading);
aoqi@0: bodyTree.addContent(div);
aoqi@0: return bodyTree;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Get this package link.
aoqi@0: *
aoqi@0: * @return a content tree for the package link
aoqi@0: */
aoqi@0: protected Content getNavLinkPackage() {
aoqi@0: Content linkContent =
aoqi@0: getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), packageLabel);
aoqi@0: Content li = HtmlTree.LI(linkContent);
aoqi@0: return li;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Get class page link.
aoqi@0: *
aoqi@0: * @return a content tree for the class page link
aoqi@0: */
aoqi@0: protected Content getNavLinkClass() {
aoqi@0: Content linkContent = getLink(new LinkInfoImpl(
aoqi@0: configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)
aoqi@0: .label(configuration.getText("doclet.Class")));
aoqi@0: Content li = HtmlTree.LI(linkContent);
aoqi@0: return li;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Get the use link.
aoqi@0: *
aoqi@0: * @return a content tree for the use link
aoqi@0: */
aoqi@0: protected Content getNavLinkClassUse() {
aoqi@0: Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, useLabel);
aoqi@0: return li;
aoqi@0: }
aoqi@0:
aoqi@0: /**
aoqi@0: * Get the tree link.
aoqi@0: *
aoqi@0: * @return a content tree for the tree link
aoqi@0: */
aoqi@0: protected Content getNavLinkTree() {
aoqi@0: Content linkContent = classdoc.containingPackage().isIncluded() ?
aoqi@0: getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), treeLabel) :
aoqi@0: getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), treeLabel);
aoqi@0: Content li = HtmlTree.LI(linkContent);
aoqi@0: return li;
aoqi@0: }
aoqi@0: }