src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java

Wed, 10 Oct 2012 16:48:21 -0700

author
jjg
date
Wed, 10 Oct 2012 16:48:21 -0700
changeset 1359
25e14ad23cef
parent 1357
c75be5bc5283
child 1372
78962d89f283
permissions
-rw-r--r--

8000665: fix "internal API" comments on javadoc files
Reviewed-by: darcy

     1 /*
     2  * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Oracle in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  * or visit www.oracle.com if you need additional information or have any
    23  * questions.
    24  */
    26 package com.sun.tools.doclets.formats.html;
    28 import java.io.*;
    29 import java.util.*;
    31 import com.sun.javadoc.*;
    32 import com.sun.tools.doclets.formats.html.markup.*;
    33 import com.sun.tools.doclets.internal.toolkit.*;
    34 import com.sun.tools.doclets.internal.toolkit.util.*;
    36 /**
    37  * Generate class usage information.
    38  *
    39  *  <p><b>This is NOT part of any supported API.
    40  *  If you write code that depends on this, you do so at your own risk.
    41  *  This code and its internal interfaces are subject to change or
    42  *  deletion without notice.</b>
    43  *
    44  * @author Robert G. Field
    45  * @author Bhavesh Patel (Modified)
    46  */
    47 public class ClassUseWriter extends SubWriterHolderWriter {
    49     final ClassDoc classdoc;
    50     Set<PackageDoc> pkgToPackageAnnotations = null;
    51     final Map<String,List<ProgramElementDoc>> pkgToClassTypeParameter;
    52     final Map<String,List<ProgramElementDoc>> pkgToClassAnnotations;
    53     final Map<String,List<ProgramElementDoc>> pkgToMethodTypeParameter;
    54     final Map<String,List<ProgramElementDoc>> pkgToMethodArgTypeParameter;
    55     final Map<String,List<ProgramElementDoc>> pkgToMethodReturnTypeParameter;
    56     final Map<String,List<ProgramElementDoc>> pkgToMethodAnnotations;
    57     final Map<String,List<ProgramElementDoc>> pkgToMethodParameterAnnotations;
    58     final Map<String,List<ProgramElementDoc>> pkgToFieldTypeParameter;
    59     final Map<String,List<ProgramElementDoc>> pkgToFieldAnnotations;
    60     final Map<String,List<ProgramElementDoc>> pkgToSubclass;
    61     final Map<String,List<ProgramElementDoc>> pkgToSubinterface;
    62     final Map<String,List<ProgramElementDoc>> pkgToImplementingClass;
    63     final Map<String,List<ProgramElementDoc>> pkgToField;
    64     final Map<String,List<ProgramElementDoc>> pkgToMethodReturn;
    65     final Map<String,List<ProgramElementDoc>> pkgToMethodArgs;
    66     final Map<String,List<ProgramElementDoc>> pkgToMethodThrows;
    67     final Map<String,List<ProgramElementDoc>> pkgToConstructorAnnotations;
    68     final Map<String,List<ProgramElementDoc>> pkgToConstructorParameterAnnotations;
    69     final Map<String,List<ProgramElementDoc>> pkgToConstructorArgs;
    70     final Map<String,List<ProgramElementDoc>> pkgToConstructorArgTypeParameter;
    71     final Map<String,List<ProgramElementDoc>> pkgToConstructorThrows;
    72     final SortedSet<PackageDoc> pkgSet;
    73     final MethodWriterImpl methodSubWriter;
    74     final ConstructorWriterImpl constrSubWriter;
    75     final FieldWriterImpl fieldSubWriter;
    76     final NestedClassWriterImpl classSubWriter;
    77     // Summary for various use tables.
    78     final String classUseTableSummary;
    79     final String subclassUseTableSummary;
    80     final String subinterfaceUseTableSummary;
    81     final String fieldUseTableSummary;
    82     final String methodUseTableSummary;
    83     final String constructorUseTableSummary;
    86     /**
    87      * Constructor.
    88      *
    89      * @param filename the file to be generated.
    90      * @throws IOException
    91      * @throws DocletAbortException
    92      */
    93     public ClassUseWriter(ConfigurationImpl configuration,
    94                           ClassUseMapper mapper, String path,
    95                           String filename, String relpath,
    96                           ClassDoc classdoc) throws IOException {
    97         super(configuration, path, filename, relpath);
    98         this.classdoc = classdoc;
    99         if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName()))
   100                 pkgToPackageAnnotations = new HashSet<PackageDoc>(mapper.classToPackageAnnotations.get(classdoc.qualifiedName()));
   101         configuration.currentcd = classdoc;
   102         this.pkgSet = new TreeSet<PackageDoc>();
   103         this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam);
   104         this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations);
   105         this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam);
   106         this.pkgToMethodArgTypeParameter = pkgDivide(mapper.classToExecMemberDocArgTypeParam);
   107         this.pkgToFieldTypeParameter = pkgDivide(mapper.classToFieldDocTypeParam);
   108         this.pkgToFieldAnnotations = pkgDivide(mapper.annotationToFieldDoc);
   109         this.pkgToMethodReturnTypeParameter = pkgDivide(mapper.classToExecMemberDocReturnTypeParam);
   110         this.pkgToMethodAnnotations = pkgDivide(mapper.classToExecMemberDocAnnotations);
   111         this.pkgToMethodParameterAnnotations = pkgDivide(mapper.classToExecMemberDocParamAnnotation);
   112         this.pkgToSubclass = pkgDivide(mapper.classToSubclass);
   113         this.pkgToSubinterface = pkgDivide(mapper.classToSubinterface);
   114         this.pkgToImplementingClass = pkgDivide(mapper.classToImplementingClass);
   115         this.pkgToField = pkgDivide(mapper.classToField);
   116         this.pkgToMethodReturn = pkgDivide(mapper.classToMethodReturn);
   117         this.pkgToMethodArgs = pkgDivide(mapper.classToMethodArgs);
   118         this.pkgToMethodThrows = pkgDivide(mapper.classToMethodThrows);
   119         this.pkgToConstructorAnnotations = pkgDivide(mapper.classToConstructorAnnotations);
   120         this.pkgToConstructorParameterAnnotations = pkgDivide(mapper.classToConstructorParamAnnotation);
   121         this.pkgToConstructorArgs = pkgDivide(mapper.classToConstructorArgs);
   122         this.pkgToConstructorArgTypeParameter = pkgDivide(mapper.classToConstructorDocArgTypeParam);
   123         this.pkgToConstructorThrows = pkgDivide(mapper.classToConstructorThrows);
   124         //tmp test
   125         if (pkgSet.size() > 0 &&
   126             mapper.classToPackage.containsKey(classdoc.qualifiedName()) &&
   127             !pkgSet.equals(mapper.classToPackage.get(classdoc.qualifiedName()))) {
   128             configuration.root.printWarning("Internal error: package sets don't match: " + pkgSet + " with: " +
   129                                    mapper.classToPackage.get(classdoc.qualifiedName()));
   130         }
   131         methodSubWriter = new MethodWriterImpl(this);
   132         constrSubWriter = new ConstructorWriterImpl(this);
   133         fieldSubWriter = new FieldWriterImpl(this);
   134         classSubWriter = new NestedClassWriterImpl(this);
   135         classUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
   136                 configuration.getText("doclet.classes"));
   137         subclassUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
   138                 configuration.getText("doclet.subclasses"));
   139         subinterfaceUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
   140                 configuration.getText("doclet.subinterfaces"));
   141         fieldUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
   142                 configuration.getText("doclet.fields"));
   143         methodUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
   144                 configuration.getText("doclet.methods"));
   145         constructorUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
   146                 configuration.getText("doclet.constructors"));
   147     }
   149     /**
   150      * Write out class use pages.
   151      * @throws DocletAbortException
   152      */
   153     public static void generate(ConfigurationImpl configuration,
   154                                 ClassTree classtree)  {
   155         ClassUseMapper mapper = new ClassUseMapper(configuration.root, classtree);
   156         ClassDoc[] classes = configuration.root.classes();
   157         for (int i = 0; i < classes.length; i++) {
   158             // If -nodeprecated option is set and the containing package is marked
   159             // as deprecated, do not generate the class-use page. We will still generate
   160             // the class-use page if the class is marked as deprecated but the containing
   161             // package is not since it could still be linked from that package-use page.
   162             if (!(configuration.nodeprecated &&
   163                     Util.isDeprecated(classes[i].containingPackage())))
   164                 ClassUseWriter.generate(configuration, mapper, classes[i]);
   165         }
   166         PackageDoc[] pkgs = configuration.packages;
   167         for (int i = 0; i < pkgs.length; i++) {
   168             // If -nodeprecated option is set and the package is marked
   169             // as deprecated, do not generate the package-use page.
   170             if (!(configuration.nodeprecated && Util.isDeprecated(pkgs[i])))
   171                 PackageUseWriter.generate(configuration, mapper, pkgs[i]);
   172         }
   173     }
   175     private Map<String,List<ProgramElementDoc>> pkgDivide(Map<String,? extends List<? extends ProgramElementDoc>> classMap) {
   176         Map<String,List<ProgramElementDoc>> map = new HashMap<String,List<ProgramElementDoc>>();
   177         List<? extends ProgramElementDoc> list= classMap.get(classdoc.qualifiedName());
   178         if (list != null) {
   179             Collections.sort(list);
   180             Iterator<? extends ProgramElementDoc> it = list.iterator();
   181             while (it.hasNext()) {
   182                 ProgramElementDoc doc = it.next();
   183                 PackageDoc pkg = doc.containingPackage();
   184                 pkgSet.add(pkg);
   185                 List<ProgramElementDoc> inPkg = map.get(pkg.name());
   186                 if (inPkg == null) {
   187                     inPkg = new ArrayList<ProgramElementDoc>();
   188                     map.put(pkg.name(), inPkg);
   189                 }
   190                 inPkg.add(doc);
   191             }
   192         }
   193         return map;
   194     }
   196     /**
   197      * Generate a class page.
   198      */
   199     public static void generate(ConfigurationImpl configuration,
   200                                 ClassUseMapper mapper, ClassDoc classdoc) {
   201         ClassUseWriter clsgen;
   202         String path = DirectoryManager.getDirectoryPath(classdoc.
   203                                                             containingPackage());
   204         path += "class-use" + DirectoryManager.URL_FILE_SEPARATOR;
   205         String filename = classdoc.name() + ".html";
   206         String pkgname = classdoc.containingPackage().name();
   207         pkgname += (pkgname.length() > 0)? ".class-use": "class-use";
   208         String relpath = DirectoryManager.getRelativePath(pkgname);
   209         try {
   210             clsgen = new ClassUseWriter(configuration,
   211                                         mapper, path, filename,
   212                                         relpath, classdoc);
   213             clsgen.generateClassUseFile();
   214             clsgen.close();
   215         } catch (IOException exc) {
   216             configuration.standardmessage.
   217                 error("doclet.exception_encountered",
   218                       exc.toString(), filename);
   219             throw new DocletAbortException();
   220         }
   221     }
   223     /**
   224      * Generate the class use list.
   225      */
   226     protected void generateClassUseFile() throws IOException {
   227         Content body = getClassUseHeader();
   228         HtmlTree div = new HtmlTree(HtmlTag.DIV);
   229         div.addStyle(HtmlStyle.classUseContainer);
   230         if (pkgSet.size() > 0) {
   231             addClassUse(div);
   232         } else {
   233             div.addContent(getResource("doclet.ClassUse_No.usage.of.0",
   234                     classdoc.qualifiedName()));
   235         }
   236         body.addContent(div);
   237         addNavLinks(false, body);
   238         addBottom(body);
   239         printHtmlDocument(null, true, body);
   240     }
   242     /**
   243      * Add the class use documentation.
   244      *
   245      * @param contentTree the content tree to which the class use information will be added
   246      */
   247     protected void addClassUse(Content contentTree) throws IOException {
   248         HtmlTree ul = new HtmlTree(HtmlTag.UL);
   249         ul.addStyle(HtmlStyle.blockList);
   250         if (configuration.packages.length > 1) {
   251             addPackageList(ul);
   252             addPackageAnnotationList(ul);
   253         }
   254         addClassList(ul);
   255         contentTree.addContent(ul);
   256     }
   258     /**
   259      * Add the packages list that use the given class.
   260      *
   261      * @param contentTree the content tree to which the packages list will be added
   262      */
   263     protected void addPackageList(Content contentTree) throws IOException {
   264         Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary,
   265                 getTableCaption(configuration().getText(
   266                 "doclet.ClassUse_Packages.that.use.0",
   267                 getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc,
   268                 false)))));
   269         table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
   270         Content tbody = new HtmlTree(HtmlTag.TBODY);
   271         Iterator<PackageDoc> it = pkgSet.iterator();
   272         for (int i = 0; it.hasNext(); i++) {
   273             PackageDoc pkg = it.next();
   274             HtmlTree tr = new HtmlTree(HtmlTag.TR);
   275             if (i % 2 == 0) {
   276                 tr.addStyle(HtmlStyle.altColor);
   277             } else {
   278                 tr.addStyle(HtmlStyle.rowColor);
   279             }
   280             addPackageUse(pkg, tr);
   281             tbody.addContent(tr);
   282         }
   283         table.addContent(tbody);
   284         Content li = HtmlTree.LI(HtmlStyle.blockList, table);
   285         contentTree.addContent(li);
   286     }
   288     /**
   289      * Add the package annotation list.
   290      *
   291      * @param contentTree the content tree to which the package annotation list will be added
   292      */
   293     protected void addPackageAnnotationList(Content contentTree) throws IOException {
   294         if ((!classdoc.isAnnotationType()) ||
   295                 pkgToPackageAnnotations == null ||
   296                 pkgToPackageAnnotations.size() == 0) {
   297             return;
   298         }
   299         Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary,
   300                 getTableCaption(configuration().getText(
   301                 "doclet.ClassUse_PackageAnnotation",
   302                 getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc,
   303                 false)))));
   304         table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
   305         Content tbody = new HtmlTree(HtmlTag.TBODY);
   306         Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator();
   307         for (int i = 0; it.hasNext(); i++) {
   308             PackageDoc pkg = it.next();
   309             HtmlTree tr = new HtmlTree(HtmlTag.TR);
   310             if (i % 2 == 0) {
   311                 tr.addStyle(HtmlStyle.altColor);
   312             } else {
   313                 tr.addStyle(HtmlStyle.rowColor);
   314             }
   315             Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
   316                     getPackageLink(pkg, new StringContent(pkg.name())));
   317             tr.addContent(tdFirst);
   318             HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
   319             tdLast.addStyle(HtmlStyle.colLast);
   320             addSummaryComment(pkg, tdLast);
   321             tr.addContent(tdLast);
   322             tbody.addContent(tr);
   323         }
   324         table.addContent(tbody);
   325         Content li = HtmlTree.LI(HtmlStyle.blockList, table);
   326         contentTree.addContent(li);
   327     }
   329     /**
   330      * Add the class list that use the given class.
   331      *
   332      * @param contentTree the content tree to which the class list will be added
   333      */
   334     protected void addClassList(Content contentTree) throws IOException {
   335         HtmlTree ul = new HtmlTree(HtmlTag.UL);
   336         ul.addStyle(HtmlStyle.blockList);
   337         for (Iterator<PackageDoc> it = pkgSet.iterator(); it.hasNext();) {
   338             PackageDoc pkg = it.next();
   339             Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name()));
   340             Content link = new RawHtml(
   341                     configuration.getText("doclet.ClassUse_Uses.of.0.in.1",
   342                     getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER,
   343                     classdoc, false)),
   344                     getPackageLinkString(pkg, Util.getPackageName(pkg), false)));
   345             Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
   346             li.addContent(heading);
   347             addClassUse(pkg, li);
   348             ul.addContent(li);
   349         }
   350         Content li = HtmlTree.LI(HtmlStyle.blockList, ul);
   351         contentTree.addContent(li);
   352     }
   354     /**
   355      * Add the package use information.
   356      *
   357      * @param pkg the package that uses the given class
   358      * @param contentTree the content tree to which the package use information will be added
   359      */
   360     protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException {
   361         Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
   362                 getHyperLink("", pkg.name(), new StringContent(Util.getPackageName(pkg))));
   363         contentTree.addContent(tdFirst);
   364         HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
   365         tdLast.addStyle(HtmlStyle.colLast);
   366         addSummaryComment(pkg, tdLast);
   367         contentTree.addContent(tdLast);
   368     }
   370     /**
   371      * Add the class use information.
   372      *
   373      * @param pkg the package that uses the given class
   374      * @param contentTree the content tree to which the class use information will be added
   375      */
   376     protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException {
   377         String classLink = getLink(new LinkInfoImpl(
   378             LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, false));
   379         String pkgLink = getPackageLinkString(pkg, Util.getPackageName(pkg), false);
   380         classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()),
   381                 configuration.getText("doclet.ClassUse_Annotation", classLink,
   382                 pkgLink), classUseTableSummary, contentTree);
   383         classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg.name()),
   384                 configuration.getText("doclet.ClassUse_TypeParameter", classLink,
   385                 pkgLink), classUseTableSummary, contentTree);
   386         classSubWriter.addUseInfo(pkgToSubclass.get(pkg.name()),
   387                 configuration.getText("doclet.ClassUse_Subclass", classLink,
   388                 pkgLink), subclassUseTableSummary, contentTree);
   389         classSubWriter.addUseInfo(pkgToSubinterface.get(pkg.name()),
   390                 configuration.getText("doclet.ClassUse_Subinterface", classLink,
   391                 pkgLink), subinterfaceUseTableSummary, contentTree);
   392         classSubWriter.addUseInfo(pkgToImplementingClass.get(pkg.name()),
   393                 configuration.getText("doclet.ClassUse_ImplementingClass", classLink,
   394                 pkgLink), classUseTableSummary, contentTree);
   395         fieldSubWriter.addUseInfo(pkgToField.get(pkg.name()),
   396                 configuration.getText("doclet.ClassUse_Field", classLink,
   397                 pkgLink), fieldUseTableSummary, contentTree);
   398         fieldSubWriter.addUseInfo(pkgToFieldAnnotations.get(pkg.name()),
   399                 configuration.getText("doclet.ClassUse_FieldAnnotations", classLink,
   400                 pkgLink), fieldUseTableSummary, contentTree);
   401         fieldSubWriter.addUseInfo(pkgToFieldTypeParameter.get(pkg.name()),
   402                 configuration.getText("doclet.ClassUse_FieldTypeParameter", classLink,
   403                 pkgLink), fieldUseTableSummary, contentTree);
   404         methodSubWriter.addUseInfo(pkgToMethodAnnotations.get(pkg.name()),
   405                 configuration.getText("doclet.ClassUse_MethodAnnotations", classLink,
   406                 pkgLink), methodUseTableSummary, contentTree);
   407         methodSubWriter.addUseInfo(pkgToMethodParameterAnnotations.get(pkg.name()),
   408                 configuration.getText("doclet.ClassUse_MethodParameterAnnotations", classLink,
   409                 pkgLink), methodUseTableSummary, contentTree);
   410         methodSubWriter.addUseInfo(pkgToMethodTypeParameter.get(pkg.name()),
   411                 configuration.getText("doclet.ClassUse_MethodTypeParameter", classLink,
   412                 pkgLink), methodUseTableSummary, contentTree);
   413         methodSubWriter.addUseInfo(pkgToMethodReturn.get(pkg.name()),
   414                 configuration.getText("doclet.ClassUse_MethodReturn", classLink,
   415                 pkgLink), methodUseTableSummary, contentTree);
   416         methodSubWriter.addUseInfo(pkgToMethodReturnTypeParameter.get(pkg.name()),
   417                 configuration.getText("doclet.ClassUse_MethodReturnTypeParameter", classLink,
   418                 pkgLink), methodUseTableSummary, contentTree);
   419         methodSubWriter.addUseInfo(pkgToMethodArgs.get(pkg.name()),
   420                 configuration.getText("doclet.ClassUse_MethodArgs", classLink,
   421                 pkgLink), methodUseTableSummary, contentTree);
   422         methodSubWriter.addUseInfo(pkgToMethodArgTypeParameter.get(pkg.name()),
   423                 configuration.getText("doclet.ClassUse_MethodArgsTypeParameters", classLink,
   424                 pkgLink), methodUseTableSummary, contentTree);
   425         methodSubWriter.addUseInfo(pkgToMethodThrows.get(pkg.name()),
   426                 configuration.getText("doclet.ClassUse_MethodThrows", classLink,
   427                 pkgLink), methodUseTableSummary, contentTree);
   428         constrSubWriter.addUseInfo(pkgToConstructorAnnotations.get(pkg.name()),
   429                 configuration.getText("doclet.ClassUse_ConstructorAnnotations", classLink,
   430                 pkgLink), constructorUseTableSummary, contentTree);
   431         constrSubWriter.addUseInfo(pkgToConstructorParameterAnnotations.get(pkg.name()),
   432                 configuration.getText("doclet.ClassUse_ConstructorParameterAnnotations", classLink,
   433                 pkgLink), constructorUseTableSummary, contentTree);
   434         constrSubWriter.addUseInfo(pkgToConstructorArgs.get(pkg.name()),
   435                 configuration.getText("doclet.ClassUse_ConstructorArgs", classLink,
   436                 pkgLink), constructorUseTableSummary, contentTree);
   437         constrSubWriter.addUseInfo(pkgToConstructorArgTypeParameter.get(pkg.name()),
   438                 configuration.getText("doclet.ClassUse_ConstructorArgsTypeParameters", classLink,
   439                 pkgLink), constructorUseTableSummary, contentTree);
   440         constrSubWriter.addUseInfo(pkgToConstructorThrows.get(pkg.name()),
   441                 configuration.getText("doclet.ClassUse_ConstructorThrows", classLink,
   442                 pkgLink), constructorUseTableSummary, contentTree);
   443     }
   445     /**
   446      * Get the header for the class use Listing.
   447      *
   448      * @return a content tree representing the class use header
   449      */
   450     protected Content getClassUseHeader() {
   451         String cltype = configuration.getText(classdoc.isInterface()?
   452             "doclet.Interface":"doclet.Class");
   453         String clname = classdoc.qualifiedName();
   454         String title = configuration.getText("doclet.Window_ClassUse_Header",
   455                 cltype, clname);
   456         Content bodyTree = getBody(true, getWindowTitle(title));
   457         addTop(bodyTree);
   458         addNavLinks(true, bodyTree);
   459         Content headContent = getResource("doclet.ClassUse_Title", cltype, clname);
   460         Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING,
   461                 true, HtmlStyle.title, headContent);
   462         Content div = HtmlTree.DIV(HtmlStyle.header, heading);
   463         bodyTree.addContent(div);
   464         return bodyTree;
   465     }
   467     /**
   468      * Get this package link.
   469      *
   470      * @return a content tree for the package link
   471      */
   472     protected Content getNavLinkPackage() {
   473         Content linkContent = getHyperLink("../package-summary.html", "",
   474                 packageLabel);
   475         Content li = HtmlTree.LI(linkContent);
   476         return li;
   477     }
   479     /**
   480      * Get class page link.
   481      *
   482      * @return a content tree for the class page link
   483      */
   484     protected Content getNavLinkClass() {
   485         Content linkContent = new RawHtml(getLink(new LinkInfoImpl(
   486                 LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, "",
   487                 configuration.getText("doclet.Class"), false)));
   488         Content li = HtmlTree.LI(linkContent);
   489         return li;
   490     }
   492     /**
   493      * Get the use link.
   494      *
   495      * @return a content tree for the use link
   496      */
   497     protected Content getNavLinkClassUse() {
   498         Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, useLabel);
   499         return li;
   500     }
   502     /**
   503      * Get the tree link.
   504      *
   505      * @return a content tree for the tree link
   506      */
   507     protected Content getNavLinkTree() {
   508         Content linkContent = classdoc.containingPackage().isIncluded() ?
   509             getHyperLink("../package-tree.html", "", treeLabel) :
   510             getHyperLink(relativePath + "overview-tree.html", "", treeLabel);
   511         Content li = HtmlTree.LI(linkContent);
   512         return li;
   513     }
   514 }

mercurial