--- old/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java 2020-01-21 10:51:08.560526016 -0800 +++ new/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java 2020-01-21 10:51:08.232511523 -0800 @@ -25,7 +25,6 @@ package jdk.javadoc.internal.doclets.formats.html.markup; import java.util.ArrayList; -import java.util.Deque; import java.util.List; import java.util.Set; import java.util.SortedSet; @@ -39,6 +38,7 @@ import jdk.javadoc.internal.doclets.formats.html.AbstractMemberWriter; import jdk.javadoc.internal.doclets.formats.html.Contents; import jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration; +import jdk.javadoc.internal.doclets.formats.html.HtmlOptions; import jdk.javadoc.internal.doclets.formats.html.MarkerComments; import jdk.javadoc.internal.doclets.formats.html.SectionName; import jdk.javadoc.internal.doclets.toolkit.Content; @@ -62,6 +62,7 @@ public class Navigation { private final HtmlConfiguration configuration; + private final HtmlOptions options; private final Element element; private final Contents contents; private final DocPath path; @@ -133,6 +134,7 @@ */ public Navigation(Element element, HtmlConfiguration configuration, PageMode page, DocPath path) { this.configuration = configuration; + this.options = configuration.getOptions(); this.element = element; this.contents = configuration.contents; this.documentedPage = page; @@ -201,11 +203,11 @@ private void addMainNavLinks(Content tree) { switch (documentedPage) { case OVERVIEW: - addActivePageLink(tree, contents.overviewLabel, configuration.createoverview); + addActivePageLink(tree, contents.overviewLabel, options.createOverview); addModuleLink(tree); addPackageLink(tree); addPageLabel(tree, contents.classLabel, true); - addPageLabel(tree, contents.useLabel, configuration.classuse); + addPageLabel(tree, contents.useLabel, options.classUse); addTreeLink(tree); addDeprecatedLink(tree); addIndexLink(tree); @@ -216,7 +218,7 @@ addActivePageLink(tree, contents.moduleLabel, configuration.showModules); addPackageLink(tree); addPageLabel(tree, contents.classLabel, true); - addPageLabel(tree, contents.useLabel, configuration.classuse); + addPageLabel(tree, contents.useLabel, options.classUse); addTreeLink(tree); addDeprecatedLink(tree); addIndexLink(tree); @@ -227,11 +229,11 @@ addModuleOfElementLink(tree); addActivePageLink(tree, contents.packageLabel, true); addPageLabel(tree, contents.classLabel, true); - if (configuration.classuse) { + if (options.classUse) { addContentToTree(tree, links.createLink(DocPaths.PACKAGE_USE, contents.useLabel, "", "")); } - if (configuration.createtree) { + if (options.createTree) { addContentToTree(tree, links.createLink(DocPaths.PACKAGE_TREE, contents.treeLabel, "", "")); } @@ -244,11 +246,11 @@ addModuleOfElementLink(tree); addPackageSummaryLink(tree); addActivePageLink(tree, contents.classLabel, true); - if (configuration.classuse) { + if (options.classUse) { addContentToTree(tree, links.createLink(DocPaths.CLASS_USE.resolve(path.basename()), contents.useLabel)); } - if (configuration.createtree) { + if (options.createTree) { addContentToTree(tree, links.createLink(DocPaths.PACKAGE_TREE, contents.treeLabel, "", "")); } @@ -266,7 +268,7 @@ addPackageOfElementLink(tree); addContentToTree(tree, navLinkClass); } - addActivePageLink(tree, contents.useLabel, configuration.classuse); + addActivePageLink(tree, contents.useLabel, options.classUse); if (element instanceof PackageElement) { addContentToTree(tree, links.createLink(DocPaths.PACKAGE_TREE, contents.treeLabel)); } else { @@ -288,8 +290,8 @@ addPackageSummaryLink(tree); } addPageLabel(tree, contents.classLabel, true); - addPageLabel(tree, contents.useLabel, configuration.classuse); - addActivePageLink(tree, contents.treeLabel, configuration.createtree); + addPageLabel(tree, contents.useLabel, options.classUse); + addActivePageLink(tree, contents.treeLabel, options.createTree); addDeprecatedLink(tree); addIndexLink(tree); addHelpLink(tree); @@ -301,21 +303,21 @@ addModuleLink(tree); addPackageLink(tree); addPageLabel(tree, contents.classLabel, true); - addPageLabel(tree, contents.useLabel, configuration.classuse); + addPageLabel(tree, contents.useLabel, options.classUse); addTreeLink(tree); if (documentedPage == PageMode.DEPRECATED) { - addActivePageLink(tree, contents.deprecatedLabel, !(configuration.nodeprecated - || configuration.nodeprecatedlist)); + addActivePageLink(tree, contents.deprecatedLabel, !(options.noDeprecated + || options.noDeprecatedList)); } else { addDeprecatedLink(tree); } if (documentedPage == PageMode.INDEX) { - addActivePageLink(tree, contents.indexLabel, configuration.createindex); + addActivePageLink(tree, contents.indexLabel, options.createIndex); } else { addIndexLink(tree); } if (documentedPage == PageMode.HELP) { - addActivePageLink(tree, contents.helpLabel, !configuration.nohelp); + addActivePageLink(tree, contents.helpLabel, !options.noHelp); } else { addHelpLink(tree); } @@ -329,7 +331,7 @@ addModuleLink(tree); addPackageLink(tree); addPageLabel(tree, contents.classLabel, true); - addPageLabel(tree, contents.useLabel, configuration.classuse); + addPageLabel(tree, contents.useLabel, options.classUse); addTreeLink(tree); addDeprecatedLink(tree); addIndexLink(tree); @@ -340,7 +342,7 @@ addModuleOfElementLink(tree); addContentToTree(tree, navLinkPackage); addPageLabel(tree, contents.classLabel, true); - addPageLabel(tree, contents.useLabel, configuration.classuse); + addPageLabel(tree, contents.useLabel, options.classUse); addTreeLink(tree); addDeprecatedLink(tree); addIndexLink(tree); @@ -783,7 +785,7 @@ } private void addOverviewLink(Content tree) { - if (configuration.createoverview) { + if (options.createOverview) { tree.add(HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.INDEX), contents.overviewLabel, "", ""))); } @@ -849,7 +851,7 @@ } private void addTreeLink(Content tree) { - if (configuration.createtree) { + if (options.createTree) { List packages = new ArrayList<>(configuration.getSpecifiedPackageElements()); DocPath docPath = packages.size() == 1 && configuration.getSpecifiedTypeElements().isEmpty() ? pathToRoot.resolve(configuration.docPaths.forPackage(packages.get(0)).resolve(DocPaths.PACKAGE_TREE)) @@ -859,16 +861,16 @@ } private void addDeprecatedLink(Content tree) { - if (!(configuration.nodeprecated || configuration.nodeprecatedlist)) { + if (!(options.noDeprecated || options.noDeprecatedList)) { tree.add(HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST), contents.deprecatedLabel, "", ""))); } } private void addIndexLink(Content tree) { - if (configuration.createindex) { + if (options.createIndex) { tree.add(HtmlTree.LI(links.createLink(pathToRoot.resolve( - (configuration.splitindex + (options.splitIndex ? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)) : DocPaths.INDEX_ALL)), contents.indexLabel, "", ""))); @@ -876,8 +878,8 @@ } private void addHelpLink(Content tree) { - if (!configuration.nohelp) { - String helpfile = configuration.helpfile; + if (!options.noHelp) { + String helpfile = options.helpFile; DocPath helpfilenm; if (helpfile.isEmpty()) { helpfilenm = DocPaths.HELP_DOC; @@ -908,7 +910,7 @@ * @return the navigation contents */ public Content getContent(boolean top) { - if (configuration.nonavbar) { + if (options.noNavbar) { return new ContentBuilder(); } Content tree = HtmlTree.NAV(); @@ -953,7 +955,7 @@ addDetailLinks(ulNavDetail); div.add(ulNavDetail); subDiv.add(div); - if (top && configuration.createindex) { + if (top && options.createIndex) { addSearch(subDiv); } tree.add(subDiv);