src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java
changeset 59294 48b88b9c11eb
parent 54350 4f9772f4403d
equal deleted inserted replaced
59293:5af9fa90cd7b 59294:48b88b9c11eb
   220      */
   220      */
   221 
   221 
   222     public DeprecatedListWriter(HtmlConfiguration configuration, DocPath filename) {
   222     public DeprecatedListWriter(HtmlConfiguration configuration, DocPath filename) {
   223         super(configuration, filename);
   223         super(configuration, filename);
   224         this.configuration = configuration;
   224         this.configuration = configuration;
   225         this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.DEPRECATED, path);
   225         this.navBar = new Navigation(null, configuration, PageMode.DEPRECATED, path);
   226         NestedClassWriterImpl classW = new NestedClassWriterImpl(this);
   226         NestedClassWriterImpl classW = new NestedClassWriterImpl(this);
   227         writerMap = new EnumMap<>(DeprElementKind.class);
   227         writerMap = new EnumMap<>(DeprElementKind.class);
   228         for (DeprElementKind kind : DeprElementKind.values()) {
   228         for (DeprElementKind kind : DeprElementKind.values()) {
   229             switch (kind) {
   229             switch (kind) {
   230                 case REMOVAL:
   230                 case REMOVAL:
   281      * @throws DocFileIOException if there is a problem writing the deprecated list
   281      * @throws DocFileIOException if there is a problem writing the deprecated list
   282      */
   282      */
   283     protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi)
   283     protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi)
   284             throws DocFileIOException {
   284             throws DocFileIOException {
   285         HtmlTree body = getHeader();
   285         HtmlTree body = getHeader();
   286         HtmlTree htmlTree = HtmlTree.MAIN();
   286         bodyContents.addMainContent(getContentsList(deprapi));
   287         htmlTree.add(getContentsList(deprapi));
       
   288         String memberTableSummary;
   287         String memberTableSummary;
   289         HtmlTree div = new HtmlTree(HtmlTag.DIV);
   288         HtmlTree div = new HtmlTree(HtmlTag.DIV);
   290         div.setStyle(HtmlStyle.contentContainer);
   289         div.setStyle(HtmlStyle.contentContainer);
   291         for (DeprElementKind kind : DeprElementKind.values()) {
   290         for (DeprElementKind kind : DeprElementKind.values()) {
   292             if (deprapi.hasDocumentation(kind)) {
   291             if (deprapi.hasDocumentation(kind)) {
   298                         contents.getContent(getHeaderKey(kind)), contents.descriptionLabel);
   297                         contents.getContent(getHeaderKey(kind)), contents.descriptionLabel);
   299                 addDeprecatedAPI(deprapi.getSet(kind),
   298                 addDeprecatedAPI(deprapi.getSet(kind),
   300                             getHeadingKey(kind), memberTableSummary, memberTableHeader, div);
   299                             getHeadingKey(kind), memberTableSummary, memberTableHeader, div);
   301             }
   300             }
   302         }
   301         }
   303         htmlTree.add(div);
   302         bodyContents.addMainContent(div);
   304         body.add(htmlTree);
   303         HtmlTree htmlTree = HtmlTree.FOOTER();
   305         htmlTree = HtmlTree.FOOTER();
       
   306         navBar.setUserFooter(getUserHeaderFooter(false));
   304         navBar.setUserFooter(getUserHeaderFooter(false));
   307         htmlTree.add(navBar.getContent(false));
   305         htmlTree.add(navBar.getContent(false));
   308         addBottom(htmlTree);
   306         addBottom(htmlTree);
   309         body.add(htmlTree);
   307         bodyContents.setFooter(htmlTree);
   310         String description = "deprecated elements";
   308         String description = "deprecated elements";
       
   309         body.add(bodyContents.toContent());
   311         printHtmlDocument(null, description, body);
   310         printHtmlDocument(null, description, body);
   312     }
   311     }
   313 
   312 
   314     /**
   313     /**
   315      * Add the index link.
   314      * Add the index link.
   316      *
   315      *
   317      * @param builder the deprecated list builder
   316      * @param builder the deprecated list builder
   318      * @param type the type of list being documented
   317      * @param kind the kind of list being documented
   319      * @param contentTree the content tree to which the index link will be added
   318      * @param contentTree the content tree to which the index link will be added
   320      */
   319      */
   321     private void addIndexLink(DeprecatedAPIListBuilder builder,
   320     private void addIndexLink(DeprecatedAPIListBuilder builder,
   322             DeprElementKind kind, Content contentTree) {
   321             DeprElementKind kind, Content contentTree) {
   323         if (builder.hasDocumentation(kind)) {
   322         if (builder.hasDocumentation(kind)) {
   351 
   350 
   352     /**
   351     /**
   353      * Add the anchor.
   352      * Add the anchor.
   354      *
   353      *
   355      * @param builder the deprecated list builder
   354      * @param builder the deprecated list builder
   356      * @param type the type of list being documented
   355      * @param kind the kind of list being documented
   357      * @param htmlTree the content tree to which the anchor will be added
   356      * @param htmlTree the content tree to which the anchor will be added
   358      */
   357      */
   359     private void addAnchor(DeprecatedAPIListBuilder builder, DeprElementKind kind, Content htmlTree) {
   358     private void addAnchor(DeprecatedAPIListBuilder builder, DeprElementKind kind, Content htmlTree) {
   360         if (builder.hasDocumentation(kind)) {
   359         if (builder.hasDocumentation(kind)) {
   361             htmlTree.add(links.createAnchor(getAnchorName(kind)));
   360             htmlTree.add(links.createAnchor(getAnchorName(kind)));
   368      * @return a content tree for the header
   367      * @return a content tree for the header
   369      */
   368      */
   370     public HtmlTree getHeader() {
   369     public HtmlTree getHeader() {
   371         String title = resources.getText("doclet.Window_Deprecated_List");
   370         String title = resources.getText("doclet.Window_Deprecated_List");
   372         HtmlTree bodyTree = getBody(getWindowTitle(title));
   371         HtmlTree bodyTree = getBody(getWindowTitle(title));
   373         HtmlTree htmlTree = HtmlTree.HEADER();
   372         Content headerContent = new ContentBuilder();
   374         addTop(htmlTree);
   373         addTop(headerContent);
   375         navBar.setUserHeader(getUserHeaderFooter(true));
   374         navBar.setUserHeader(getUserHeaderFooter(true));
   376         htmlTree.add(navBar.getContent(true));
   375         headerContent.add(navBar.getContent(true));
   377         bodyTree.add(htmlTree);
   376         bodyContents.setHeader(headerContent);
   378         return bodyTree;
   377         return bodyTree;
   379     }
   378     }
   380 
   379 
   381     /**
   380     /**
   382      * Add deprecated information to the documentation tree
   381      * Add deprecated information to the documentation tree