src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
changeset 54596 86c1da00dd6a
parent 54350 4f9772f4403d
child 59294 48b88b9c11eb
equal deleted inserted replaced
54595:a61da18408c1 54596:86c1da00dd6a
   247      * Add the class use documentation.
   247      * Add the class use documentation.
   248      *
   248      *
   249      * @param contentTree the content tree to which the class use information will be added
   249      * @param contentTree the content tree to which the class use information will be added
   250      */
   250      */
   251     protected void addClassUse(Content contentTree) {
   251     protected void addClassUse(Content contentTree) {
   252         HtmlTree ul = new HtmlTree(HtmlTag.UL);
   252         Content content = new ContentBuilder();
   253         ul.setStyle(HtmlStyle.blockList);
       
   254         if (configuration.packages.size() > 1) {
   253         if (configuration.packages.size() > 1) {
   255             addPackageList(ul);
   254             addPackageList(content);
   256             addPackageAnnotationList(ul);
   255             addPackageAnnotationList(content);
   257         }
   256         }
   258         addClassList(ul);
   257         addClassList(content);
   259         contentTree.add(ul);
   258         contentTree.add(content);
   260     }
   259     }
   261 
   260 
   262     /**
   261     /**
   263      * Add the packages elements that use the given class.
   262      * Add the packages elements that use the given class.
   264      *
   263      *
   274                 .setHeader(getPackageTableHeader())
   273                 .setHeader(getPackageTableHeader())
   275                 .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
   274                 .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
   276         for (PackageElement pkg : pkgSet) {
   275         for (PackageElement pkg : pkgSet) {
   277             addPackageUse(pkg, table);
   276             addPackageUse(pkg, table);
   278         }
   277         }
   279         Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
   278         contentTree.add(table.toContent());
   280         contentTree.add(li);
       
   281     }
   279     }
   282 
   280 
   283     /**
   281     /**
   284      * Add the package annotation elements.
   282      * Add the package annotation elements.
   285      *
   283      *
   303         for (PackageElement pkg : pkgToPackageAnnotations) {
   301         for (PackageElement pkg : pkgToPackageAnnotations) {
   304             Content summary = new ContentBuilder();
   302             Content summary = new ContentBuilder();
   305             addSummaryComment(pkg, summary);
   303             addSummaryComment(pkg, summary);
   306             table.addRow(getPackageLink(pkg), summary);
   304             table.addRow(getPackageLink(pkg), summary);
   307         }
   305         }
   308         Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
   306         contentTree.add(table.toContent());
   309         contentTree.add(li);
       
   310     }
   307     }
   311 
   308 
   312     /**
   309     /**
   313      * Add the class elements that use the given class.
   310      * Add the class elements that use the given class.
   314      *
   311      *
   317     protected void addClassList(Content contentTree) {
   314     protected void addClassList(Content contentTree) {
   318         HtmlTree ul = new HtmlTree(HtmlTag.UL);
   315         HtmlTree ul = new HtmlTree(HtmlTag.UL);
   319         ul.setStyle(HtmlStyle.blockList);
   316         ul.setStyle(HtmlStyle.blockList);
   320         for (PackageElement pkg : pkgSet) {
   317         for (PackageElement pkg : pkgSet) {
   321             Content markerAnchor = links.createAnchor(getPackageAnchorName(pkg));
   318             Content markerAnchor = links.createAnchor(getPackageAnchorName(pkg));
   322             HtmlTree htmlTree = HtmlTree.SECTION(markerAnchor);
   319             HtmlTree htmlTree = HtmlTree.SECTION(HtmlStyle.detail, markerAnchor);
   323             Content link = contents.getContent("doclet.ClassUse_Uses.of.0.in.1",
   320             Content link = contents.getContent("doclet.ClassUse_Uses.of.0.in.1",
   324                     getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
   321                     getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
   325                             typeElement)),
   322                             typeElement)),
   326                     getPackageLink(pkg, utils.getPackageName(pkg)));
   323                     getPackageLink(pkg, utils.getPackageName(pkg)));
   327             Content heading = HtmlTree.HEADING(Headings.TypeUse.SUMMARY_HEADING, link);
   324             Content heading = HtmlTree.HEADING(Headings.TypeUse.SUMMARY_HEADING, link);
   328             htmlTree.add(heading);
   325             htmlTree.add(heading);
   329             addClassUse(pkg, htmlTree);
   326             addClassUse(pkg, htmlTree);
   330             ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
   327             ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
   331         }
   328         }
   332         Content li = HtmlTree.LI(HtmlStyle.blockList, ul);
   329         Content li = HtmlTree.SECTION(HtmlStyle.classUses, ul);
   333         contentTree.add(li);
   330         contentTree.add(li);
   334     }
   331     }
   335 
   332 
   336     /**
   333     /**
   337      * Add the package use information.
   334      * Add the package use information.