src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java
changeset 49551 0d4786e42471
parent 47850 4a28dc8a86c2
child 52644 43efb4ca6d6c
equal deleted inserted replaced
49550:dce997f9a93e 49551:0d4786e42471
    40 import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
    40 import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
    41 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
    41 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
    42 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
    42 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
    43 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
    43 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
    44 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
    44 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
       
    45 import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
       
    46 import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
    45 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
    47 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
    46 import jdk.javadoc.internal.doclets.toolkit.Content;
    48 import jdk.javadoc.internal.doclets.toolkit.Content;
    47 import jdk.javadoc.internal.doclets.toolkit.util.DeprecatedAPIListBuilder;
    49 import jdk.javadoc.internal.doclets.toolkit.util.DeprecatedAPIListBuilder;
    48 import jdk.javadoc.internal.doclets.toolkit.util.DeprecatedAPIListBuilder.DeprElementKind;
    50 import jdk.javadoc.internal.doclets.toolkit.util.DeprecatedAPIListBuilder.DeprElementKind;
    49 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
    51 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
   207 
   209 
   208     private EnumMap<DeprElementKind, AbstractMemberWriter> writerMap;
   210     private EnumMap<DeprElementKind, AbstractMemberWriter> writerMap;
   209 
   211 
   210     private HtmlConfiguration configuration;
   212     private HtmlConfiguration configuration;
   211 
   213 
       
   214     private final Navigation navBar;
       
   215 
   212     /**
   216     /**
   213      * Constructor.
   217      * Constructor.
   214      *
   218      *
   215      * @param configuration the configuration for this doclet
   219      * @param configuration the configuration for this doclet
   216      * @param filename the file to be generated
   220      * @param filename the file to be generated
   217      */
   221      */
   218 
   222 
   219     public DeprecatedListWriter(HtmlConfiguration configuration, DocPath filename) {
   223     public DeprecatedListWriter(HtmlConfiguration configuration, DocPath filename) {
   220         super(configuration, filename);
   224         super(configuration, filename);
   221         this.configuration = configuration;
   225         this.configuration = configuration;
       
   226         this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.DEPRECATED, path);
   222         NestedClassWriterImpl classW = new NestedClassWriterImpl(this);
   227         NestedClassWriterImpl classW = new NestedClassWriterImpl(this);
   223         writerMap = new EnumMap<>(DeprElementKind.class);
   228         writerMap = new EnumMap<>(DeprElementKind.class);
   224         for (DeprElementKind kind : DeprElementKind.values()) {
   229         for (DeprElementKind kind : DeprElementKind.values()) {
   225             switch (kind) {
   230             switch (kind) {
   226                 case REMOVAL:
   231                 case REMOVAL:
   305             body.addContent(div);
   310             body.addContent(div);
   306         }
   311         }
   307         htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
   312         htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
   308                 ? HtmlTree.FOOTER()
   313                 ? HtmlTree.FOOTER()
   309                 : body;
   314                 : body;
   310         addNavLinks(false, htmlTree);
   315         navBar.setUserFooter(getUserHeaderFooter(false));
       
   316         htmlTree.addContent(navBar.getContent(false));
   311         addBottom(htmlTree);
   317         addBottom(htmlTree);
   312         if (configuration.allowTag(HtmlTag.FOOTER)) {
   318         if (configuration.allowTag(HtmlTag.FOOTER)) {
   313             body.addContent(htmlTree);
   319             body.addContent(htmlTree);
   314         }
   320         }
   315         printHtmlDocument(null, true, body);
   321         printHtmlDocument(null, true, body);
   376         HtmlTree bodyTree = getBody(true, getWindowTitle(title));
   382         HtmlTree bodyTree = getBody(true, getWindowTitle(title));
   377         HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
   383         HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
   378                 ? HtmlTree.HEADER()
   384                 ? HtmlTree.HEADER()
   379                 : bodyTree;
   385                 : bodyTree;
   380         addTop(htmlTree);
   386         addTop(htmlTree);
   381         addNavLinks(true, htmlTree);
   387         navBar.setUserHeader(getUserHeaderFooter(true));
       
   388         htmlTree.addContent(navBar.getContent(true));
   382         if (configuration.allowTag(HtmlTag.HEADER)) {
   389         if (configuration.allowTag(HtmlTag.HEADER)) {
   383             bodyTree.addContent(htmlTree);
   390             bodyTree.addContent(htmlTree);
   384         }
   391         }
   385         return bodyTree;
   392         return bodyTree;
   386     }
       
   387 
       
   388     /**
       
   389      * Get the deprecated label.
       
   390      *
       
   391      * @return a content tree for the deprecated label
       
   392      */
       
   393     @Override
       
   394     protected Content getNavLinkDeprecated() {
       
   395         Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, contents.deprecatedLabel);
       
   396         return li;
       
   397     }
   393     }
   398 
   394 
   399     /**
   395     /**
   400      * Add deprecated information to the documentation tree
   396      * Add deprecated information to the documentation tree
   401      *
   397      *