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

Tue, 28 Dec 2010 15:54:52 -0800

author
ohair
date
Tue, 28 Dec 2010 15:54:52 -0800
changeset 798
4868a36f6fd8
parent 766
90af8d87741f
child 927
b60754fe206d
permissions
-rw-r--r--

6962318: Update copyright year
Reviewed-by: xdono

     1 /*
     2  * Copyright (c) 1998, 2010, 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.*;
    30 import com.sun.javadoc.*;
    31 import com.sun.tools.doclets.internal.toolkit.util.*;
    32 import com.sun.tools.doclets.formats.html.markup.*;
    33 import com.sun.tools.doclets.internal.toolkit.*;
    35 /**
    36  * Generate class usage information.
    37  *
    38  * @author Robert G. Field
    39  * @author Bhavesh Patel (Modified)
    40  */
    41 public class ClassUseWriter extends SubWriterHolderWriter {
    43     final ClassDoc classdoc;
    44     Set<PackageDoc> pkgToPackageAnnotations = null;
    45     final Map<String,List<ProgramElementDoc>> pkgToClassTypeParameter;
    46     final Map<String,List<ProgramElementDoc>> pkgToClassAnnotations;
    47     final Map<String,List<ProgramElementDoc>> pkgToMethodTypeParameter;
    48     final Map<String,List<ProgramElementDoc>> pkgToMethodArgTypeParameter;
    49     final Map<String,List<ProgramElementDoc>> pkgToMethodReturnTypeParameter;
    50     final Map<String,List<ProgramElementDoc>> pkgToMethodAnnotations;
    51     final Map<String,List<ProgramElementDoc>> pkgToMethodParameterAnnotations;
    52     final Map<String,List<ProgramElementDoc>> pkgToFieldTypeParameter;
    53     final Map<String,List<ProgramElementDoc>> pkgToFieldAnnotations;
    54     final Map<String,List<ProgramElementDoc>> pkgToSubclass;
    55     final Map<String,List<ProgramElementDoc>> pkgToSubinterface;
    56     final Map<String,List<ProgramElementDoc>> pkgToImplementingClass;
    57     final Map<String,List<ProgramElementDoc>> pkgToField;
    58     final Map<String,List<ProgramElementDoc>> pkgToMethodReturn;
    59     final Map<String,List<ProgramElementDoc>> pkgToMethodArgs;
    60     final Map<String,List<ProgramElementDoc>> pkgToMethodThrows;
    61     final Map<String,List<ProgramElementDoc>> pkgToConstructorAnnotations;
    62     final Map<String,List<ProgramElementDoc>> pkgToConstructorParameterAnnotations;
    63     final Map<String,List<ProgramElementDoc>> pkgToConstructorArgs;
    64     final Map<String,List<ProgramElementDoc>> pkgToConstructorArgTypeParameter;
    65     final Map<String,List<ProgramElementDoc>> pkgToConstructorThrows;
    66     final SortedSet<PackageDoc> pkgSet;
    67     final MethodWriterImpl methodSubWriter;
    68     final ConstructorWriterImpl constrSubWriter;
    69     final FieldWriterImpl fieldSubWriter;
    70     final NestedClassWriterImpl classSubWriter;
    71     // Summary for various use tables.
    72     final String classUseTableSummary;
    73     final String subclassUseTableSummary;
    74     final String subinterfaceUseTableSummary;
    75     final String fieldUseTableSummary;
    76     final String methodUseTableSummary;
    77     final String constructorUseTableSummary;
    80     /**
    81      * Constructor.
    82      *
    83      * @param filename the file to be generated.
    84      * @throws IOException
    85      * @throws DocletAbortException
    86      */
    87     public ClassUseWriter(ConfigurationImpl configuration,
    88                           ClassUseMapper mapper, String path,
    89                           String filename, String relpath,
    90                           ClassDoc classdoc) throws IOException {
    91         super(configuration, path, filename, relpath);
    92         this.classdoc = classdoc;
    93         if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName()))
    94                 pkgToPackageAnnotations = new HashSet<PackageDoc>(mapper.classToPackageAnnotations.get(classdoc.qualifiedName()));
    95         configuration.currentcd = classdoc;
    96         this.pkgSet = new TreeSet<PackageDoc>();
    97         this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam);
    98         this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations);
    99         this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam);
   100         this.pkgToMethodArgTypeParameter = pkgDivide(mapper.classToExecMemberDocArgTypeParam);
   101         this.pkgToFieldTypeParameter = pkgDivide(mapper.classToFieldDocTypeParam);
   102         this.pkgToFieldAnnotations = pkgDivide(mapper.annotationToFieldDoc);
   103         this.pkgToMethodReturnTypeParameter = pkgDivide(mapper.classToExecMemberDocReturnTypeParam);
   104         this.pkgToMethodAnnotations = pkgDivide(mapper.classToExecMemberDocAnnotations);
   105         this.pkgToMethodParameterAnnotations = pkgDivide(mapper.classToExecMemberDocParamAnnotation);
   106         this.pkgToSubclass = pkgDivide(mapper.classToSubclass);
   107         this.pkgToSubinterface = pkgDivide(mapper.classToSubinterface);
   108         this.pkgToImplementingClass = pkgDivide(mapper.classToImplementingClass);
   109         this.pkgToField = pkgDivide(mapper.classToField);
   110         this.pkgToMethodReturn = pkgDivide(mapper.classToMethodReturn);
   111         this.pkgToMethodArgs = pkgDivide(mapper.classToMethodArgs);
   112         this.pkgToMethodThrows = pkgDivide(mapper.classToMethodThrows);
   113         this.pkgToConstructorAnnotations = pkgDivide(mapper.classToConstructorAnnotations);
   114         this.pkgToConstructorParameterAnnotations = pkgDivide(mapper.classToConstructorParamAnnotation);
   115         this.pkgToConstructorArgs = pkgDivide(mapper.classToConstructorArgs);
   116         this.pkgToConstructorArgTypeParameter = pkgDivide(mapper.classToConstructorDocArgTypeParam);
   117         this.pkgToConstructorThrows = pkgDivide(mapper.classToConstructorThrows);
   118         //tmp test
   119         if (pkgSet.size() > 0 &&
   120             mapper.classToPackage.containsKey(classdoc.qualifiedName()) &&
   121             !pkgSet.equals(mapper.classToPackage.get(classdoc.qualifiedName()))) {
   122             configuration.root.printWarning("Internal error: package sets don't match: " + pkgSet + " with: " +
   123                                    mapper.classToPackage.get(classdoc.qualifiedName()));
   124         }
   125         methodSubWriter = new MethodWriterImpl(this);
   126         constrSubWriter = new ConstructorWriterImpl(this);
   127         fieldSubWriter = new FieldWriterImpl(this);
   128         classSubWriter = new NestedClassWriterImpl(this);
   129         classUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
   130                 configuration.getText("doclet.classes"));
   131         subclassUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
   132                 configuration.getText("doclet.subclasses"));
   133         subinterfaceUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
   134                 configuration.getText("doclet.subinterfaces"));
   135         fieldUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
   136                 configuration.getText("doclet.fields"));
   137         methodUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
   138                 configuration.getText("doclet.methods"));
   139         constructorUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
   140                 configuration.getText("doclet.constructors"));
   141     }
   143     /**
   144      * Write out class use pages.
   145      * @throws DocletAbortException
   146      */
   147     public static void generate(ConfigurationImpl configuration,
   148                                 ClassTree classtree)  {
   149         ClassUseMapper mapper = new ClassUseMapper(configuration.root, classtree);
   150         ClassDoc[] classes = configuration.root.classes();
   151         for (int i = 0; i < classes.length; i++) {
   152             ClassUseWriter.generate(configuration, mapper, classes[i]);
   153         }
   154         PackageDoc[] pkgs = configuration.packages;
   155         for (int i = 0; i < pkgs.length; i++) {
   156             PackageUseWriter.generate(configuration, mapper, pkgs[i]);
   157         }
   158     }
   160     private Map<String,List<ProgramElementDoc>> pkgDivide(Map<String,? extends List<? extends ProgramElementDoc>> classMap) {
   161         Map<String,List<ProgramElementDoc>> map = new HashMap<String,List<ProgramElementDoc>>();
   162         List<? extends ProgramElementDoc> list= classMap.get(classdoc.qualifiedName());
   163         if (list != null) {
   164             Collections.sort(list);
   165             Iterator<? extends ProgramElementDoc> it = list.iterator();
   166             while (it.hasNext()) {
   167                 ProgramElementDoc doc = it.next();
   168                 PackageDoc pkg = doc.containingPackage();
   169                 pkgSet.add(pkg);
   170                 List<ProgramElementDoc> inPkg = map.get(pkg.name());
   171                 if (inPkg == null) {
   172                     inPkg = new ArrayList<ProgramElementDoc>();
   173                     map.put(pkg.name(), inPkg);
   174                 }
   175                 inPkg.add(doc);
   176             }
   177         }
   178         return map;
   179     }
   181     /**
   182      * Generate a class page.
   183      */
   184     public static void generate(ConfigurationImpl configuration,
   185                                 ClassUseMapper mapper, ClassDoc classdoc) {
   186         ClassUseWriter clsgen;
   187         String path = DirectoryManager.getDirectoryPath(classdoc.
   188                                                             containingPackage());
   189         if (path.length() > 0) {
   190             path += File.separator;
   191         }
   192         path += "class-use";
   193         String filename = classdoc.name() + ".html";
   194         String pkgname = classdoc.containingPackage().name();
   195         pkgname += (pkgname.length() > 0)? ".class-use": "class-use";
   196         String relpath = DirectoryManager.getRelativePath(pkgname);
   197         try {
   198             clsgen = new ClassUseWriter(configuration,
   199                                         mapper, path, filename,
   200                                         relpath, classdoc);
   201             clsgen.generateClassUseFile();
   202             clsgen.close();
   203         } catch (IOException exc) {
   204             configuration.standardmessage.
   205                 error("doclet.exception_encountered",
   206                       exc.toString(), filename);
   207             throw new DocletAbortException();
   208         }
   209     }
   211     /**
   212      * Generate the class use list.
   213      */
   214     protected void generateClassUseFile() throws IOException {
   215         Content body = getClassUseHeader();
   216         HtmlTree div = new HtmlTree(HtmlTag.DIV);
   217         div.addStyle(HtmlStyle.classUseContainer);
   218         if (pkgSet.size() > 0) {
   219             addClassUse(div);
   220         } else {
   221             div.addContent(getResource("doclet.ClassUse_No.usage.of.0",
   222                     classdoc.qualifiedName()));
   223         }
   224         body.addContent(div);
   225         addNavLinks(false, body);
   226         addBottom(body);
   227         printHtmlDocument(null, true, body);
   228     }
   230     /**
   231      * Add the class use documentation.
   232      *
   233      * @param contentTree the content tree to which the class use information will be added
   234      */
   235     protected void addClassUse(Content contentTree) throws IOException {
   236         HtmlTree ul = new HtmlTree(HtmlTag.UL);
   237         ul.addStyle(HtmlStyle.blockList);
   238         if (configuration.packages.length > 1) {
   239             addPackageList(ul);
   240             addPackageAnnotationList(ul);
   241         }
   242         addClassList(ul);
   243         contentTree.addContent(ul);
   244     }
   246     /**
   247      * Add the packages list that use the given class.
   248      *
   249      * @param contentTree the content tree to which the packages list will be added
   250      */
   251     protected void addPackageList(Content contentTree) throws IOException {
   252         Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary,
   253                 getTableCaption(configuration().getText(
   254                 "doclet.ClassUse_Packages.that.use.0",
   255                 getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc,
   256                 false)))));
   257         table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
   258         Content tbody = new HtmlTree(HtmlTag.TBODY);
   259         Iterator<PackageDoc> it = pkgSet.iterator();
   260         for (int i = 0; it.hasNext(); i++) {
   261             PackageDoc pkg = it.next();
   262             HtmlTree tr = new HtmlTree(HtmlTag.TR);
   263             if (i % 2 == 0) {
   264                 tr.addStyle(HtmlStyle.altColor);
   265             } else {
   266                 tr.addStyle(HtmlStyle.rowColor);
   267             }
   268             addPackageUse(pkg, tr);
   269             tbody.addContent(tr);
   270         }
   271         table.addContent(tbody);
   272         Content li = HtmlTree.LI(HtmlStyle.blockList, table);
   273         contentTree.addContent(li);
   274     }
   276     /**
   277      * Add the package annotation list.
   278      *
   279      * @param contentTree the content tree to which the package annotation list will be added
   280      */
   281     protected void addPackageAnnotationList(Content contentTree) throws IOException {
   282         if ((!classdoc.isAnnotationType()) ||
   283                 pkgToPackageAnnotations == null ||
   284                 pkgToPackageAnnotations.size() == 0) {
   285             return;
   286         }
   287         Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary,
   288                 getTableCaption(configuration().getText(
   289                 "doclet.ClassUse_PackageAnnotation",
   290                 getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc,
   291                 false)))));
   292         table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
   293         Content tbody = new HtmlTree(HtmlTag.TBODY);
   294         Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator();
   295         for (int i = 0; it.hasNext(); i++) {
   296             PackageDoc pkg = it.next();
   297             HtmlTree tr = new HtmlTree(HtmlTag.TR);
   298             if (i % 2 == 0) {
   299                 tr.addStyle(HtmlStyle.altColor);
   300             } else {
   301                 tr.addStyle(HtmlStyle.rowColor);
   302             }
   303             Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
   304                     getPackageLink(pkg, new StringContent(pkg.name())));
   305             tr.addContent(tdFirst);
   306             HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
   307             tdLast.addStyle(HtmlStyle.colLast);
   308             if (pkg != null) {
   309                 addSummaryComment(pkg, tdLast);
   310             } else {
   311                 tdLast.addContent(getSpace());
   312             }
   313             tr.addContent(tdLast);
   314             tbody.addContent(tr);
   315         }
   316         table.addContent(tbody);
   317         Content li = HtmlTree.LI(HtmlStyle.blockList, table);
   318         contentTree.addContent(li);
   319     }
   321     /**
   322      * Add the class list that use the given class.
   323      *
   324      * @param contentTree the content tree to which the class list will be added
   325      */
   326     protected void addClassList(Content contentTree) throws IOException {
   327         HtmlTree ul = new HtmlTree(HtmlTag.UL);
   328         ul.addStyle(HtmlStyle.blockList);
   329         for (Iterator<PackageDoc> it = pkgSet.iterator(); it.hasNext();) {
   330             PackageDoc pkg = it.next();
   331             Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name()));
   332             Content link = new RawHtml(
   333                     configuration.getText("doclet.ClassUse_Uses.of.0.in.1",
   334                     getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER,
   335                     classdoc, false)),
   336                     getPackageLinkString(pkg, Util.getPackageName(pkg), false)));
   337             Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
   338             li.addContent(heading);
   339             addClassUse(pkg, li);
   340             ul.addContent(li);
   341         }
   342         Content li = HtmlTree.LI(HtmlStyle.blockList, ul);
   343         contentTree.addContent(li);
   344     }
   346     /**
   347      * Add the package use information.
   348      *
   349      * @param pkg the package that uses the given class
   350      * @param contentTree the content tree to which the package use information will be added
   351      */
   352     protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException {
   353         Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
   354                 getHyperLink("", pkg.name(), new StringContent(Util.getPackageName(pkg))));
   355         contentTree.addContent(tdFirst);
   356         HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
   357         tdLast.addStyle(HtmlStyle.colLast);
   358         if (pkg != null)
   359             addSummaryComment(pkg, tdLast);
   360         else
   361             tdLast.addContent(getSpace());
   362         contentTree.addContent(tdLast);
   363     }
   365     /**
   366      * Add the class use information.
   367      *
   368      * @param pkg the package that uses the given class
   369      * @param contentTree the content tree to which the class use information will be added
   370      */
   371     protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException {
   372         String classLink = getLink(new LinkInfoImpl(
   373             LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, false));
   374         String pkgLink = getPackageLinkString(pkg, Util.getPackageName(pkg), false);
   375         classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()),
   376                 configuration.getText("doclet.ClassUse_Annotation", classLink,
   377                 pkgLink), classUseTableSummary, contentTree);
   378         classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg.name()),
   379                 configuration.getText("doclet.ClassUse_TypeParameter", classLink,
   380                 pkgLink), classUseTableSummary, contentTree);
   381         classSubWriter.addUseInfo(pkgToSubclass.get(pkg.name()),
   382                 configuration.getText("doclet.ClassUse_Subclass", classLink,
   383                 pkgLink), subclassUseTableSummary, contentTree);
   384         classSubWriter.addUseInfo(pkgToSubinterface.get(pkg.name()),
   385                 configuration.getText("doclet.ClassUse_Subinterface", classLink,
   386                 pkgLink), subinterfaceUseTableSummary, contentTree);
   387         classSubWriter.addUseInfo(pkgToImplementingClass.get(pkg.name()),
   388                 configuration.getText("doclet.ClassUse_ImplementingClass", classLink,
   389                 pkgLink), classUseTableSummary, contentTree);
   390         fieldSubWriter.addUseInfo(pkgToField.get(pkg.name()),
   391                 configuration.getText("doclet.ClassUse_Field", classLink,
   392                 pkgLink), fieldUseTableSummary, contentTree);
   393         fieldSubWriter.addUseInfo(pkgToFieldAnnotations.get(pkg.name()),
   394                 configuration.getText("doclet.ClassUse_FieldAnnotations", classLink,
   395                 pkgLink), fieldUseTableSummary, contentTree);
   396         fieldSubWriter.addUseInfo(pkgToFieldTypeParameter.get(pkg.name()),
   397                 configuration.getText("doclet.ClassUse_FieldTypeParameter", classLink,
   398                 pkgLink), fieldUseTableSummary, contentTree);
   399         methodSubWriter.addUseInfo(pkgToMethodAnnotations.get(pkg.name()),
   400                 configuration.getText("doclet.ClassUse_MethodAnnotations", classLink,
   401                 pkgLink), methodUseTableSummary, contentTree);
   402         methodSubWriter.addUseInfo(pkgToMethodParameterAnnotations.get(pkg.name()),
   403                 configuration.getText("doclet.ClassUse_MethodParameterAnnotations", classLink,
   404                 pkgLink), methodUseTableSummary, contentTree);
   405         methodSubWriter.addUseInfo(pkgToMethodTypeParameter.get(pkg.name()),
   406                 configuration.getText("doclet.ClassUse_MethodTypeParameter", classLink,
   407                 pkgLink), methodUseTableSummary, contentTree);
   408         methodSubWriter.addUseInfo(pkgToMethodReturn.get(pkg.name()),
   409                 configuration.getText("doclet.ClassUse_MethodReturn", classLink,
   410                 pkgLink), methodUseTableSummary, contentTree);
   411         methodSubWriter.addUseInfo(pkgToMethodReturnTypeParameter.get(pkg.name()),
   412                 configuration.getText("doclet.ClassUse_MethodReturnTypeParameter", classLink,
   413                 pkgLink), methodUseTableSummary, contentTree);
   414         methodSubWriter.addUseInfo(pkgToMethodArgs.get(pkg.name()),
   415                 configuration.getText("doclet.ClassUse_MethodArgs", classLink,
   416                 pkgLink), methodUseTableSummary, contentTree);
   417         methodSubWriter.addUseInfo(pkgToMethodArgTypeParameter.get(pkg.name()),
   418                 configuration.getText("doclet.ClassUse_MethodArgsTypeParameters", classLink,
   419                 pkgLink), methodUseTableSummary, contentTree);
   420         methodSubWriter.addUseInfo(pkgToMethodThrows.get(pkg.name()),
   421                 configuration.getText("doclet.ClassUse_MethodThrows", classLink,
   422                 pkgLink), methodUseTableSummary, contentTree);
   423         constrSubWriter.addUseInfo(pkgToConstructorAnnotations.get(pkg.name()),
   424                 configuration.getText("doclet.ClassUse_ConstructorAnnotations", classLink,
   425                 pkgLink), constructorUseTableSummary, contentTree);
   426         constrSubWriter.addUseInfo(pkgToConstructorParameterAnnotations.get(pkg.name()),
   427                 configuration.getText("doclet.ClassUse_ConstructorParameterAnnotations", classLink,
   428                 pkgLink), constructorUseTableSummary, contentTree);
   429         constrSubWriter.addUseInfo(pkgToConstructorArgs.get(pkg.name()),
   430                 configuration.getText("doclet.ClassUse_ConstructorArgs", classLink,
   431                 pkgLink), constructorUseTableSummary, contentTree);
   432         constrSubWriter.addUseInfo(pkgToConstructorArgTypeParameter.get(pkg.name()),
   433                 configuration.getText("doclet.ClassUse_ConstructorArgsTypeParameters", classLink,
   434                 pkgLink), constructorUseTableSummary, contentTree);
   435         constrSubWriter.addUseInfo(pkgToConstructorThrows.get(pkg.name()),
   436                 configuration.getText("doclet.ClassUse_ConstructorThrows", classLink,
   437                 pkgLink), constructorUseTableSummary, contentTree);
   438     }
   440     /**
   441      * Get the header for the class use Listing.
   442      *
   443      * @return a content tree representing the class use header
   444      */
   445     protected Content getClassUseHeader() {
   446         String cltype = configuration.getText(classdoc.isInterface()?
   447             "doclet.Interface":"doclet.Class");
   448         String clname = classdoc.qualifiedName();
   449         String title = configuration.getText("doclet.Window_ClassUse_Header",
   450                 cltype, clname);
   451         Content bodyTree = getBody(true, getWindowTitle(title));
   452         addTop(bodyTree);
   453         addNavLinks(true, bodyTree);
   454         Content headContent = getResource("doclet.ClassUse_Title", cltype, clname);
   455         Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING,
   456                 true, HtmlStyle.title, headContent);
   457         Content div = HtmlTree.DIV(HtmlStyle.header, heading);
   458         bodyTree.addContent(div);
   459         return bodyTree;
   460     }
   462     /**
   463      * Get this package link.
   464      *
   465      * @return a content tree for the package link
   466      */
   467     protected Content getNavLinkPackage() {
   468         Content linkContent = getHyperLink("../package-summary.html", "",
   469                 packageLabel);
   470         Content li = HtmlTree.LI(linkContent);
   471         return li;
   472     }
   474     /**
   475      * Get class page link.
   476      *
   477      * @return a content tree for the class page link
   478      */
   479     protected Content getNavLinkClass() {
   480         Content linkContent = new RawHtml(getLink(new LinkInfoImpl(
   481                 LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, "",
   482                 configuration.getText("doclet.Class"), false)));
   483         Content li = HtmlTree.LI(linkContent);
   484         return li;
   485     }
   487     /**
   488      * Get the use link.
   489      *
   490      * @return a content tree for the use link
   491      */
   492     protected Content getNavLinkClassUse() {
   493         Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, useLabel);
   494         return li;
   495     }
   497     /**
   498      * Get the tree link.
   499      *
   500      * @return a content tree for the tree link
   501      */
   502     protected Content getNavLinkTree() {
   503         Content linkContent = classdoc.containingPackage().isIncluded() ?
   504             getHyperLink("../package-tree.html", "", treeLabel) :
   505             getHyperLink(relativePath + "overview-tree.html", "", treeLabel);
   506         Content li = HtmlTree.LI(linkContent);
   507         return li;
   508     }
   509 }

mercurial