changeset 50751:cc705c956798

8196201: Generate pages to list all classes and all packages in javadoc output Reviewed-by: jjg
author bpatel
date Thu, 17 May 2018 12:59:53 -0700
parents 1d683e243d8d
children 2f59dc95847d
files src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SearchIndexItem.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Table.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Resources.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPaths.java test/langtools/jdk/javadoc/doclet/testGroupName/TestGroupName.java test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java test/langtools/jdk/javadoc/doclet/testModules/TestModules.java test/langtools/jdk/javadoc/doclet/testPackagePage/TestPackagePage.java test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java test/langtools/jdk/javadoc/tool/api/basic/APITest.java test/langtools/tools/javadoc/api/basic/APITest.java
diffstat 30 files changed, 716 insertions(+), 215 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractIndexWriter.java	Thu May 17 12:59:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -437,8 +437,20 @@
             createSearchIndexFile(DocPaths.MODULE_SEARCH_INDEX_JSON, DocPaths.MODULE_SEARCH_INDEX_ZIP,
                     DocPaths.MODULE_SEARCH_INDEX_JS, configuration.moduleSearchIndex, "moduleSearchIndex");
         }
+        if (!configuration.packages.isEmpty()) {
+            SearchIndexItem si = new SearchIndexItem();
+            si.setCategory(resources.getText("doclet.Packages"));
+            si.setLabel(configuration.getText("doclet.All_Packages"));
+            si.setUrl(DocPaths.ALLPACKAGES_INDEX.getPath());
+            configuration.packageSearchIndex.add(si);
+        }
         createSearchIndexFile(DocPaths.PACKAGE_SEARCH_INDEX_JSON, DocPaths.PACKAGE_SEARCH_INDEX_ZIP,
                 DocPaths.PACKAGE_SEARCH_INDEX_JS, configuration.packageSearchIndex, "packageSearchIndex");
+        SearchIndexItem si = new SearchIndexItem();
+        si.setCategory(resources.getText("doclet.Types"));
+        si.setLabel(configuration.getText("doclet.All_Classes"));
+        si.setUrl(DocPaths.ALLCLASSES_INDEX.getPath());
+        configuration.typeSearchIndex.add(si);
         createSearchIndexFile(DocPaths.TYPE_SEARCH_INDEX_JSON, DocPaths.TYPE_SEARCH_INDEX_ZIP,
                 DocPaths.TYPE_SEARCH_INDEX_JS, configuration.typeSearchIndex, "typeSearchIndex");
         createSearchIndexFile(DocPaths.MEMBER_SEARCH_INDEX_JSON, DocPaths.MEMBER_SEARCH_INDEX_ZIP,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java	Thu May 17 12:59:53 2018 -0700
@@ -0,0 +1,207 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.javadoc.internal.doclets.formats.html;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.lang.model.element.Element;
+import javax.lang.model.element.TypeElement;
+
+import com.sun.source.doctree.DocTree;
+import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
+import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
+import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
+import jdk.javadoc.internal.doclets.toolkit.Content;
+import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
+import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
+import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
+import jdk.javadoc.internal.doclets.toolkit.util.IndexBuilder;
+
+/**
+ * Generate the file with list of all the classes in this run.
+ */
+public class AllClassesIndexWriter extends HtmlDocletWriter {
+
+    /**
+     * Index of all the classes.
+     */
+    protected IndexBuilder indexbuilder;
+
+    /**
+     * The HTML tree for main tag.
+     */
+    protected HtmlTree mainTree = HtmlTree.MAIN();
+
+    private final Navigation navBar;
+
+    /**
+     * Construct AllClassesFrameWriter object. Also initializes the indexbuilder variable in this
+     * class.
+     *
+     * @param configuration The current configuration
+     * @param filename Path to the file which is getting generated.
+     * @param indexbuilder Unicode based Index from {@link IndexBuilder}
+     */
+    public AllClassesIndexWriter(HtmlConfiguration configuration,
+            DocPath filename, IndexBuilder indexbuilder) {
+        super(configuration, filename);
+        this.indexbuilder = indexbuilder;
+        this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.ALLCLASSES, path);
+    }
+
+    /**
+     * Create AllClassesIndexWriter object.
+     *
+     * @param configuration The current configuration
+     * @param indexBuilder IndexBuilder object for all classes index.
+     * @throws DocFileIOException
+     */
+    public static void generate(HtmlConfiguration configuration,
+            IndexBuilder indexBuilder) throws DocFileIOException {
+        generate(configuration, indexBuilder, DocPaths.ALLCLASSES_INDEX);
+    }
+
+    private static void generate(HtmlConfiguration configuration, IndexBuilder indexBuilder,
+            DocPath fileName) throws DocFileIOException {
+        AllClassesIndexWriter allClassGen = new AllClassesIndexWriter(configuration,
+                fileName, indexBuilder);
+        allClassGen.buildAllClassesFile();
+    }
+
+    /**
+     * Print all the classes in the file.
+     */
+    protected void buildAllClassesFile() throws DocFileIOException {
+        String label = configuration.getText("doclet.All_Classes");
+        HtmlTree bodyTree = getBody(true, getWindowTitle(label));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        navBar.setUserHeader(getUserHeaderFooter(true));
+        htmlTree.addContent(navBar.getContent(true));
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
+        Content allClassesContent = new ContentBuilder();
+        addContents(allClassesContent);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(allClassesContent);
+            bodyTree.addContent(mainTree);
+        } else {
+            bodyTree.addContent(allClassesContent);
+        }
+        Content tree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : bodyTree;
+        navBar.setUserFooter(getUserHeaderFooter(false));
+        tree.addContent(navBar.getContent(false));
+        addBottom(tree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            bodyTree.addContent(tree);
+        }
+        printHtmlDocument(null, true, bodyTree);
+    }
+
+    /**
+     * Add all types to the content tree.
+     *
+     * @param content HtmlTree content to which the links will be added
+     */
+    protected void addContents(Content content) {
+        Table table = new Table(configuration.htmlVersion, HtmlStyle.typeSummary)
+                .setSummary(resources.classTableSummary)
+                .setHeader(new TableHeader(contents.classLabel, contents.descriptionLabel))
+                .setRowScopeColumn(1)
+                .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast)
+                .setDefaultTab(resources.getText("doclet.All_Classes"))
+                .addTab(resources.interfaceSummary, utils::isInterface)
+                .addTab(resources.classSummary, e -> utils.isOrdinaryClass((TypeElement)e))
+                .addTab(resources.enumSummary, utils::isEnum)
+                .addTab(resources.exceptionSummary, e -> utils.isException((TypeElement)e))
+                .addTab(resources.errorSummary, e -> utils.isError((TypeElement)e))
+                .addTab(resources.annotationTypeSummary, utils::isAnnotationType)
+                .setTabScript(i -> "show(" + i + ");")
+                .setUseTBody(false)
+                .setPutIdFirst(true);
+        for (Character unicode : indexbuilder.index()) {
+            for (Element element : indexbuilder.getMemberList(unicode)) {
+                TypeElement typeElement = (TypeElement) element;
+                if (!utils.isCoreClass(typeElement)) {
+                    continue;
+                }
+                addTableRow(table, typeElement);
+            }
+        }
+        Content titleContent = contents.allClassesLabel;
+        Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+                HtmlStyle.title, titleContent);
+        Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading);
+        content.addContent(headerDiv);
+        if (!table.isEmpty()) {
+            HtmlTree li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
+            HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
+            HtmlTree div = new HtmlTree(HtmlTag.DIV);
+            div.setStyle(HtmlStyle.allClassesContainer);
+            div.addContent(ul);
+            content.addContent(div);
+            if (table.needsScript()) {
+                getMainBodyScript().append(table.getScript());
+            }
+        }
+    }
+
+    /**
+     * Add table row.
+     *
+     * @param table the table to which the row will be added
+     * @param klass the type to be added to the table
+     */
+    protected void addTableRow(Table table, TypeElement klass) {
+        List<Content> rowContents = new ArrayList<>();
+        Content classLink = getLink(new LinkInfoImpl(
+                configuration, LinkInfoImpl.Kind.INDEX, klass));
+        ContentBuilder description = new ContentBuilder();
+        if (utils.isDeprecated(klass)) {
+            description.addContent(getDeprecatedPhrase(klass));
+            List<? extends DocTree> tags = utils.getDeprecatedTrees(klass);
+            if (!tags.isEmpty()) {
+                addSummaryDeprecatedComment(klass, tags.get(0), description);
+            }
+        } else {
+            addSummaryComment(klass, description);
+        }
+        rowContents.add(classLink);
+        rowContents.add(description);
+        table.addRow(klass, rowContents);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java	Thu May 17 12:59:53 2018 -0700
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package jdk.javadoc.internal.doclets.formats.html;
+
+import javax.lang.model.element.PackageElement;
+
+import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
+import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
+import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
+import jdk.javadoc.internal.doclets.formats.html.markup.Navigation.PageMode;
+import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
+import jdk.javadoc.internal.doclets.toolkit.Content;
+import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
+import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
+import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
+
+/**
+ * Generate the file with list of all the packages in this run.
+ */
+public class AllPackagesIndexWriter extends HtmlDocletWriter {
+
+    /**
+     * The HTML tree for main tag.
+     */
+    protected HtmlTree mainTree = HtmlTree.MAIN();
+
+    private final Navigation navBar;
+
+    /**
+     * Construct AllPackagesIndexWriter object.
+     *
+     * @param configuration The current configuration
+     * @param filename Path to the file which is getting generated.
+     */
+    public AllPackagesIndexWriter(HtmlConfiguration configuration, DocPath filename) {
+        super(configuration, filename);
+        this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.ALLPACKAGES, path);
+    }
+
+    /**
+     * Create AllPackagesIndexWriter object.
+     *
+     * @param configuration The current configuration
+     * @throws DocFileIOException
+     */
+    public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
+        generate(configuration, DocPaths.ALLPACKAGES_INDEX);
+    }
+
+    private static void generate(HtmlConfiguration configuration, DocPath fileName) throws DocFileIOException {
+        AllPackagesIndexWriter allPkgGen = new AllPackagesIndexWriter(configuration, fileName);
+        allPkgGen.buildAllPackagesFile();
+    }
+
+    /**
+     * Print all the packages in the file.
+     */
+    protected void buildAllPackagesFile() throws DocFileIOException {
+        String label = configuration.getText("doclet.All_Packages");
+        HtmlTree bodyTree = getBody(true, getWindowTitle(label));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        navBar.setUserHeader(getUserHeaderFooter(true));
+        htmlTree.addContent(navBar.getContent(true));
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
+        HtmlTree div = new HtmlTree(HtmlTag.DIV);
+        div.setStyle(HtmlStyle.allPackagesContainer);
+        addPackages(div);
+        Content titleContent = contents.allPackagesLabel;
+        Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+                HtmlStyle.title, titleContent);
+        Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(headerDiv);
+            mainTree.addContent(div);
+            bodyTree.addContent(mainTree);
+        } else {
+            bodyTree.addContent(headerDiv);
+            bodyTree.addContent(div);
+        }
+        Content tree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : bodyTree;
+        navBar.setUserFooter(getUserHeaderFooter(false));
+        tree.addContent(navBar.getContent(false));
+        addBottom(tree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            bodyTree.addContent(tree);
+        }
+        printHtmlDocument(null, true, bodyTree);
+    }
+
+    /**
+     * Add all the packages to the content tree.
+     *
+     * @param content HtmlTree content to which the links will be added
+     */
+    protected void addPackages(Content content) {
+        Table table = new Table(configuration.htmlVersion, HtmlStyle.packagesSummary)
+                .setSummary(resources.packageTableSummary)
+                .setCaption(getTableCaption(new StringContent(resources.packageSummary)))
+                .setHeader(new TableHeader(contents.packageLabel, contents.descriptionLabel))
+                .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
+        for (PackageElement pkg : configuration.packages) {
+            if (!(configuration.nodeprecated && utils.isDeprecated(pkg))) {
+                Content packageLinkContent = getPackageLink(pkg, getPackageName(pkg));
+                Content summaryContent = new ContentBuilder();
+                addSummaryComment(pkg, summaryContent);
+                table.addRow(pkg, packageLinkContent, summaryContent);
+            }
+        }
+        HtmlTree li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
+        content.addContent(HtmlTree.UL(HtmlStyle.blockList, li));
+    }
+}
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java	Thu May 17 12:59:53 2018 -0700
@@ -146,6 +146,11 @@
             } else {
                 SingleIndexWriter.generate(configuration, indexbuilder);
             }
+            AllClassesIndexWriter.generate(configuration,
+                    new IndexBuilder(configuration, nodeprecated, true));
+            if (!configuration.packages.isEmpty()) {
+                AllPackagesIndexWriter.generate(configuration);
+            }
         }
 
         if (!(configuration.nodeprecatedlist || nodeprecated)) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java	Thu May 17 12:59:53 2018 -0700
@@ -266,7 +266,6 @@
                 .addTab(resources.getText("doclet.Default_Methods"), utils::isDefault)
                 .addTab(resources.getText("doclet.Deprecated_Methods"),
                         e -> utils.isDeprecated(e) || utils.isDeprecated(typeElement))
-                .setTabScriptVariable("methods")
                 .setTabScript(i -> "show(" + i + ");")
                 .setUseTBody(false)
                 .setPutIdFirst(true);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java	Thu May 17 12:59:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -131,8 +131,7 @@
                     .setHeader(header)
                     .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast)
                     .setDefaultTab(resources.getText("doclet.All_Modules"))
-                    .setTabScriptVariable("groups")
-                    .setTabScript(i -> "showGroups(" + i + ");")
+                    .setTabScript(i -> "show(" + i + ");")
                     .setTabId(i -> (i == 0) ? "t0" : ("t" + (1 << (i - 1))));
 
             // add the tabs in command-line order
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java	Thu May 17 12:59:53 2018 -0700
@@ -622,8 +622,7 @@
                 .addTab(resources.getText("doclet.Exported_Packages_Summary"), this::isExported)
                 .addTab(resources.getText("doclet.Opened_Packages_Summary"), this::isOpened)
                 .addTab(resources.getText("doclet.Concealed_Packages_Summary"), this::isConcealed)
-                .setTabScript(i -> String.format("showPkgs(%d);", i))
-                .setTabScriptVariable("packages");
+                .setTabScript(i -> String.format("show(%d);", i));
 
         // Determine whether to show the "Exported To" and "Opened To" columns,
         // based on whether such columns would provide "useful" info.
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java	Thu May 17 12:59:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -113,8 +113,7 @@
                     .setHeader(getPackageTableHeader())
                     .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast)
                     .setDefaultTab(resources.getText("doclet.All_Packages"))
-                    .setTabScriptVariable("groups")
-                    .setTabScript(i -> "showGroups(" + i + ");")
+                    .setTabScript(i -> "show(" + i + ");")
                     .setTabId(i -> (i == 0) ? "t0" : ("t" + (1 << (i - 1))));
 
             // add the tabs in command-line order
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java	Thu May 17 12:59:53 2018 -0700
@@ -195,13 +195,9 @@
      */
     @Override
     public void addInterfaceSummary(SortedSet<TypeElement> interfaces, Content summaryContentTree) {
-        String label = resources.getText("doclet.Interface_Summary");
-        String tableSummary = resources.getText("doclet.Member_Table_Summary",
-                        resources.getText("doclet.Interface_Summary"),
-                        resources.getText("doclet.interfaces"));
         TableHeader tableHeader= new TableHeader(contents.interfaceLabel, contents.descriptionLabel);
-
-        addClassesSummary(interfaces, label, tableSummary, tableHeader, summaryContentTree);
+        addClassesSummary(interfaces, resources.interfaceSummary, resources.interfaceTableSummary,
+                tableHeader, summaryContentTree);
     }
 
     /**
@@ -209,13 +205,9 @@
      */
     @Override
     public void addClassSummary(SortedSet<TypeElement> classes, Content summaryContentTree) {
-        String label = resources.getText("doclet.Class_Summary");
-        String tableSummary = resources.getText("doclet.Member_Table_Summary",
-                        resources.getText("doclet.Class_Summary"),
-                        resources.getText("doclet.classes"));
         TableHeader tableHeader= new TableHeader(contents.classLabel, contents.descriptionLabel);
-
-        addClassesSummary(classes, label, tableSummary, tableHeader, summaryContentTree);
+        addClassesSummary(classes, resources.classSummary, resources.classTableSummary,
+                tableHeader, summaryContentTree);
     }
 
     /**
@@ -223,13 +215,9 @@
      */
     @Override
     public void addEnumSummary(SortedSet<TypeElement> enums, Content summaryContentTree) {
-        String label = resources.getText("doclet.Enum_Summary");
-        String tableSummary = resources.getText("doclet.Member_Table_Summary",
-                        resources.getText("doclet.Enum_Summary"),
-                        resources.getText("doclet.enums"));
         TableHeader tableHeader= new TableHeader(contents.enum_, contents.descriptionLabel);
-
-        addClassesSummary(enums, label, tableSummary, tableHeader, summaryContentTree);
+        addClassesSummary(enums, resources.enumSummary, resources.enumTableSummary,
+                tableHeader, summaryContentTree);
     }
 
     /**
@@ -237,13 +225,9 @@
      */
     @Override
     public void addExceptionSummary(SortedSet<TypeElement> exceptions, Content summaryContentTree) {
-        String label = resources.getText("doclet.Exception_Summary");
-        String tableSummary = resources.getText("doclet.Member_Table_Summary",
-                        resources.getText("doclet.Exception_Summary"),
-                        resources.getText("doclet.exceptions"));
         TableHeader tableHeader= new TableHeader(contents.exception, contents.descriptionLabel);
-
-        addClassesSummary(exceptions, label, tableSummary, tableHeader, summaryContentTree);
+        addClassesSummary(exceptions, resources.exceptionSummary, resources.exceptionTableSummary,
+                tableHeader, summaryContentTree);
     }
 
     /**
@@ -251,13 +235,9 @@
      */
     @Override
     public void addErrorSummary(SortedSet<TypeElement> errors, Content summaryContentTree) {
-        String label = resources.getText("doclet.Error_Summary");
-        String tableSummary = resources.getText("doclet.Member_Table_Summary",
-                        resources.getText("doclet.Error_Summary"),
-                        resources.getText("doclet.errors"));
         TableHeader tableHeader= new TableHeader(contents.error, contents.descriptionLabel);
-
-        addClassesSummary(errors, label, tableSummary, tableHeader, summaryContentTree);
+        addClassesSummary(errors, resources.errorSummary, resources.errorTableSummary,
+                tableHeader, summaryContentTree);
     }
 
     /**
@@ -265,13 +245,9 @@
      */
     @Override
     public void addAnnotationTypeSummary(SortedSet<TypeElement> annoTypes, Content summaryContentTree) {
-        String label = resources.getText("doclet.Annotation_Types_Summary");
-        String tableSummary = resources.getText("doclet.Member_Table_Summary",
-                        resources.getText("doclet.Annotation_Types_Summary"),
-                        resources.getText("doclet.annotationtypes"));
         TableHeader tableHeader= new TableHeader(contents.annotationType, contents.descriptionLabel);
-
-        addClassesSummary(annoTypes, label, tableSummary, tableHeader, summaryContentTree);
+        addClassesSummary(annoTypes, resources.annotationTypeSummary, resources.annotationTypeTableSummary,
+                tableHeader, summaryContentTree);
     }
 
     public void addClassesSummary(SortedSet<TypeElement> classes, String label,
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SearchIndexItem.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SearchIndexItem.java	Thu May 17 12:59:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -103,13 +103,21 @@
             if (!containingModule.isEmpty()) {
                 item.append("\"m\":\"").append(containingModule).append("\",");
             }
-            item.append("\"l\":\"").append(label).append("\"")
-                    .append("}");
+            item.append("\"l\":\"").append(label).append("\"");
+            if (!url.equals("")) {
+                item.append(",\"url\":\"").append(url).append("\"");
+            }
+            item.append("}");
         } else if (category.equals("Types")) {
-            item.append("{")
-                    .append("\"p\":\"").append(containingPackage).append("\",")
-                    .append("\"l\":\"").append(label).append("\"")
-                    .append("}");
+            item.append("{");
+            if (!containingPackage.equals("")) {
+                item.append("\"p\":\"").append(containingPackage).append("\",");
+            }
+            item.append("\"l\":\"").append(label).append("\"");
+            if (!url.equals("")) {
+                item.append(",\"url\":\"").append(url).append("\"");
+            }
+            item.append("}");
         } else if (category.equals("Members")) {
             item.append("{")
                     .append("\"p\":\"").append(containingPackage).append("\",")
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SingleIndexWriter.java	Thu May 17 12:59:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -147,5 +147,13 @@
                             new StringContent(unicode)));
             contentTree.addContent(Contents.SPACE);
         }
+        contentTree.addContent(new HtmlTree(HtmlTag.BR));
+        contentTree.addContent(links.createLink(DocPaths.ALLCLASSES_INDEX,
+                contents.allClassesLabel));
+        if (!configuration.packages.isEmpty()) {
+            contentTree.addContent(Contents.SPACE);
+            contentTree.addContent(links.createLink(DocPaths.ALLPACKAGES_INDEX,
+                    contents.allPackagesLabel));
     }
 }
+}
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SplitIndexWriter.java	Thu May 17 12:59:53 2018 -0700
@@ -167,5 +167,13 @@
                     new StringContent(indexElements.get(i).toString())));
             contentTree.addContent(Contents.SPACE);
         }
+        contentTree.addContent(new HtmlTree(HtmlTag.BR));
+        contentTree.addContent(links.createLink(pathToRoot.resolve(DocPaths.ALLCLASSES_INDEX),
+                contents.allClassesLabel));
+        if (!configuration.packages.isEmpty()) {
+            contentTree.addContent(Contents.SPACE);
+            contentTree.addContent(links.createLink(pathToRoot.resolve(DocPaths.ALLPACKAGES_INDEX),
+                    contents.allPackagesLabel));
     }
 }
+}
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java	Thu May 17 12:59:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,8 @@
 public enum HtmlStyle {
     aboutLanguage,
     activeTableTab,
+    allClassesContainer,
+    allPackagesContainer,
     altColor,
     bar,
     block,
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java	Thu May 17 12:59:53 2018 -0700
@@ -89,6 +89,8 @@
             + "//-->\n");
 
     public enum PageMode {
+        ALLCLASSES,
+        ALLPACKAGES,
         CLASS,
         CONSTANTVALUES,
         DEPRECATED,
@@ -378,6 +380,8 @@
                     addHelpLink(tree);
                 }
                 break;
+            case ALLCLASSES:
+            case ALLPACKAGES:
             case CONSTANTVALUES:
             case SERIALIZEDFORM:
                 addOverviewLink(tree);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Table.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Table.java	Thu May 17 12:59:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -72,7 +72,6 @@
     private HtmlStyle tabStyle = HtmlStyle.tableTab;
     private HtmlStyle tabEnd = HtmlStyle.tabEnd;
     private IntFunction<String> tabScript;
-    private String tabScriptVariable;
     private Function<Integer, String> tabId = (i -> "t" + i);
     private TableHeader header;
     private List<HtmlStyle> columnStyles;
@@ -183,17 +182,6 @@
     }
 
     /**
-     * Sets the name of the JavaScript variable used to contain the data for each tab.
-     *
-     * @param name the name
-     * @return this object
-     */
-    public Table setTabScriptVariable(String name) {
-        tabScriptVariable = name;
-        return this;
-    }
-
-    /**
      * Sets the name of the styles used to display the tabs.
      *
      * @param activeTabStyle    the style for the active tab
@@ -537,7 +525,7 @@
         StringBuilder sb = new StringBuilder();
 
         // Add the variable defining the bitmask for each row
-        sb.append("var ").append(tabScriptVariable).append(" = {");
+        sb.append("var data").append(" = {");
         int rowIndex = 0;
         for (int mask : bodyRowMasks) {
             if (rowIndex > 0) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js	Thu May 17 12:59:53 2018 -0700
@@ -47,15 +47,17 @@
         var slash = "/";
         if (ui.item.category === catModules) {
             return ui.item.l + slash;
-        } else if (ui.item.category === catPackages) {
+        } else if (ui.item.category === catPackages && ui.item.m) {
             return ui.item.m + slash;
-        } else if (ui.item.category === catTypes || ui.item.category === catMembers) {
+        } else if ((ui.item.category === catTypes && ui.item.p) || ui.item.category === catMembers) {
             $.each(packageSearchIndex, function(index, item) {
                 if (ui.item.p == item.l) {
                     urlPrefix = item.m + slash;
                 }
             });
             return urlPrefix;
+        } else {
+            return urlPrefix;
         }
     }
     return urlPrefix;
@@ -116,7 +118,9 @@
                     ? getHighlightedText(item.m + "/" + item.l)
                     : getHighlightedText(item.l);
         } else if (item.category === catTypes) {
-            label = getHighlightedText(item.p + "." + item.l);
+            label = (item.p)
+                    ? getHighlightedText(item.p + "." + item.l)
+                    : getHighlightedText(item.l);
         } else if (item.category === catMembers) {
             label = getHighlightedText(item.p + "." + (item.c + "." + item.l));
         } else if (item.category === catSearchTags) {
@@ -306,9 +310,15 @@
                         url = ui.item.l + "-summary.html";
                     }
                 } else if (ui.item.category === catPackages) {
+                    if (ui.item.url) {
+                        url = ui.item.url;
+                    } else {
                     url += ui.item.l.replace(/\./g, '/') + "/package-summary.html";
+                    }
                 } else if (ui.item.category === catTypes) {
-                    if (ui.item.p === "<Unnamed>") {
+                    if (ui.item.url) {
+                        url = ui.item.url;
+                    } else if (ui.item.p === "<Unnamed>") {
                         url += ui.item.l + ".html";
                     } else {
                         url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.l + ".html";
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Resources.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/Resources.java	Thu May 17 12:59:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,9 +39,23 @@
  * HTML doclet.
  */
 public class Resources {
+    public final String annotationTypeSummary;
+    public final String annotationTypeTableSummary;
+    public final String classSummary;
+    public final String classTableSummary;
     private final BaseConfiguration configuration;
     private final String commonBundleName;
     private final String docletBundleName;
+    public final String enumSummary;
+    public final String enumTableSummary;
+    public final String errorSummary;
+    public final String errorTableSummary;
+    public final String exceptionSummary;
+    public final String exceptionTableSummary;
+    public final String interfaceSummary;
+    public final String interfaceTableSummary;
+    public final String packageSummary;
+    public final String packageTableSummary;
 
     protected ResourceBundle commonBundle;
     protected ResourceBundle docletBundle;
@@ -62,6 +76,27 @@
         this.configuration = configuration;
         this.commonBundleName = commonBundleName;
         this.docletBundleName = docletBundleName;
+        this.annotationTypeSummary = getText("doclet.Annotation_Types_Summary");
+        this.annotationTypeTableSummary = getText("doclet.Member_Table_Summary",
+                this.annotationTypeSummary, getText("doclet.annotationtypes"));
+        this.classSummary = getText("doclet.Class_Summary");
+        this.classTableSummary = getText("doclet.Member_Table_Summary",
+                this.classSummary, getText("doclet.classes"));
+        this.enumSummary = getText("doclet.Enum_Summary");
+        this.enumTableSummary = getText("doclet.Member_Table_Summary",
+                this.enumSummary, getText("doclet.enums"));
+        this.errorSummary = getText("doclet.Error_Summary");
+        this.errorTableSummary = getText("doclet.Member_Table_Summary",
+                this.errorSummary, getText("doclet.errors"));
+        this.exceptionSummary = getText("doclet.Exception_Summary");
+        this.exceptionTableSummary = getText("doclet.Member_Table_Summary",
+                this.exceptionSummary, getText("doclet.exceptions"));
+        this.interfaceSummary = getText("doclet.Interface_Summary");
+        this.interfaceTableSummary = getText("doclet.Member_Table_Summary",
+                this.interfaceSummary, getText("doclet.interfaces"));
+        this.packageSummary = getText("doclet.Package_Summary");
+        this.packageTableSummary = getText("doclet.Member_Table_Summary",
+                this.packageSummary, getText("doclet.packages"));
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js	Thu May 17 12:59:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -104,12 +104,11 @@
     scriptElement.parentNode.insertBefore(script, scriptElement);
 }
 
-function show(type)
-{
+function show(type) {
     count = 0;
-    for (var key in methods) {
+    for (var key in data) {
         var row = document.getElementById(key);
-        if ((methods[key] &  type) !== 0) {
+        if ((data[key] &  type) !== 0) {
             row.style.display = '';
             row.className = (count++ % 2) ? rowColor : altColor;
         }
@@ -119,38 +118,7 @@
     updateTabs(type);
 }
 
-function showPkgs(type)
-{
-    count = 0;
-    for (var key in packages) {
-        var row = document.getElementById(key);
-        if ((packages[key] &  type) !== 0) {
-            row.style.display = '';
-            row.className = (count++ % 2) ? rowColor : altColor;
-        }
-        else
-            row.style.display = 'none';
-    }
-    updatePkgsTabs(type);
-}
-
-function showGroups(type)
-{
-    count = 0;
-    for (var key in groups) {
-        var row = document.getElementById(key);
-        if ((groups[key] &  type) !== 0) {
-            row.style.display = '';
-            row.className = (count++ % 2) ? rowColor : altColor;
-        }
-        else
-            row.style.display = 'none';
-    }
-    updateGroupsTabs(type);
-}
-
-function updateTabs(type)
-{
+function updateTabs(type) {
     for (var value in tabs) {
         var sNode = document.getElementById(tabs[value][0]);
         var spanNode = sNode.firstChild;
@@ -165,40 +133,7 @@
     }
 }
 
-function updateModuleFrame(pFrame, cFrame)
-{
+function updateModuleFrame(pFrame, cFrame) {
     top.packageFrame.location = pFrame;
     top.classFrame.location = cFrame;
 }
-
-function updatePkgsTabs(type)
-{
-    for (var value in tabs) {
-        var sNode = document.getElementById(tabs[value][0]);
-        var spanNode = sNode.firstChild;
-        if (value == type) {
-            sNode.className = activeTableTab;
-            spanNode.innerHTML = tabs[value][1];
-        }
-        else {
-            sNode.className = tableTab;
-            spanNode.innerHTML = "<a href=\"javascript:showPkgs(" + value + ");\">" + tabs[value][1] + "</a>";
-        }
-    }
-}
-
-function updateGroupsTabs(type)
-{
-    for (var value in tabs) {
-        var sNode = document.getElementById(tabs[value][0]);
-        var spanNode = sNode.firstChild;
-        if (value == type) {
-            sNode.className = activeTableTab;
-            spanNode.innerHTML = tabs[value][1];
-        }
-        else {
-            sNode.className = tableTab;
-            spanNode.innerHTML = "<a href=\"javascript:showGroups(" + value + ");\">" + tabs[value][1] + "</a>";
-        }
-    }
-}
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Thu May 17 12:59:53 2018 -0700
@@ -311,7 +311,8 @@
 /*
  * Styles for page layout containers.
  */
-.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
+.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer,
+.allClassesContainer, .allPackagesContainer {
     clear:both;
     padding:10px 20px;
     position:relative;
@@ -480,7 +481,7 @@
     height:16px;
 }
 .memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span,
-.overviewSummary caption span.activeTableTab span {
+.overviewSummary caption span.activeTableTab span, .typeSummary caption span.activeTableTab span {
     white-space:nowrap;
     padding-top:5px;
     padding-left:12px;
@@ -492,7 +493,7 @@
     height:16px;
 }
 .memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span,
-.overviewSummary caption span.tableTab span {
+.overviewSummary caption span.tableTab span, .typeSummary caption span.tableTab span {
     white-space:nowrap;
     padding-top:5px;
     padding-left:12px;
@@ -505,7 +506,8 @@
 }
 .memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab,
 .packagesSummary caption span.tableTab, .packagesSummary caption span.activeTableTab,
-.overviewSummary caption span.tableTab, .overviewSummary caption span.activeTableTab {
+.overviewSummary caption span.tableTab, .overviewSummary caption span.activeTableTab,
+.typeSummary caption span.tableTab, .typeSummary caption span.activeTableTab {
     padding-top:0px;
     padding-left:0px;
     padding-right:0px;
@@ -523,7 +525,7 @@
     background-color:#F8981D;
 }
 .memberSummary .activeTableTab .tabEnd, .packagesSummary .activeTableTab .tabEnd,
-.overviewSummary .activeTableTab .tabEnd {
+.overviewSummary .activeTableTab .tabEnd, .typeSummary .activeTableTab .tabEnd {
     display:none;
     width:5px;
     margin-right:3px;
@@ -532,7 +534,7 @@
     background-color:#F8981D;
 }
 .memberSummary .tableTab .tabEnd, .packagesSummary .tableTab .tabEnd,
-.overviewSummary .tableTab .tabEnd {
+.overviewSummary .tableTab .tabEnd, .typeSummary .tableTab .tabEnd {
     display:none;
     width:5px;
     margin-right:3px;
@@ -585,7 +587,7 @@
 .providesSummary td.colFirst, .providesSummary th.colFirst,
 .memberSummary td.colFirst, .memberSummary th.colFirst,
 .memberSummary td.colSecond, .memberSummary th.colSecond, .memberSummary th.colConstructorName,
-.typeSummary td.colFirst {
+.typeSummary td.colFirst, .typeSummary th.colFirst {
     vertical-align:top;
 }
 .packagesSummary th.colLast, .packagesSummary td.colLast {
@@ -597,7 +599,9 @@
 th.colSecond a:link, th.colSecond a:visited,
 th.colConstructorName a:link, th.colConstructorName a:visited,
 th.colDeprecatedItemName a:link, th.colDeprecatedItemName a:visited, 
-.constantValuesContainer td a:link, .constantValuesContainer td a:visited {
+.constantValuesContainer td a:link, .constantValuesContainer td a:visited, 
+.allClassesContainer td a:link, .allClassesContainer td a:visited, 
+.allPackagesContainer td a:link, .allPackagesContainer td a:visited {
     font-weight:bold;
 }
 .tableSubHeadingColor {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPaths.java	Thu May 17 08:41:01 2018 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocPaths.java	Thu May 17 12:59:53 2018 -0700
@@ -57,6 +57,12 @@
     /** The name of the file for all classes, using frames. */
     public static final DocPath ALLCLASSES_FRAME = DocPath.create("allclasses-frame.html");
 
+    /** The name of the file for all classes index. */
+    public static final DocPath ALLCLASSES_INDEX = DocPath.create("allclasses-index.html");
+
+    /** The name of the file for all packages index. */
+    public static final DocPath ALLPACKAGES_INDEX = DocPath.create("allpackages-index.html");
+
     /** The name of the file for all classes, without using frames. */
     public static final DocPath ALLCLASSES_NOFRAME = DocPath.create("allclasses-noframe.html");
 
--- a/test/langtools/jdk/javadoc/doclet/testGroupName/TestGroupName.java	Thu May 17 08:41:01 2018 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testGroupName/TestGroupName.java	Thu May 17 12:59:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8190003
+ * @bug 8190003 8196201
  * @summary Special characters in group names should be escaped
  * @library /tools/lib ../lib
  * @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -64,7 +64,7 @@
         checkExit(Exit.OK);
 
         checkOutput("overview-summary.html", true,
-                "<span><a href=\"javascript:showGroups(1);\">abc &lt; &amp; &gt; def</a></span>",
+                "<span><a href=\"javascript:show(1);\">abc &lt; &amp; &gt; def</a></span>",
                 ",\"abc < & > def\"],");
     }
 
@@ -97,7 +97,7 @@
         checkExit(Exit.OK);
 
         checkOutput("overview-summary.html", true,
-                "<span><a href=\"javascript:showGroups(1);\">abc &lt; &amp; &gt; def</a></span>",
+                "<span><a href=\"javascript:show(1);\">abc &lt; &amp; &gt; def</a></span>",
                 ",\"abc < & > def\"],");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java	Thu May 17 08:41:01 2018 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java	Thu May 17 12:59:53 2018 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      8002304 8024096 8193671
+ * @bug      8002304 8024096 8193671 8196201
  * @summary  Test for various method type tabs in the method summary table
  * @author   Bhavesh Patel
  * @library  ../lib
@@ -47,7 +47,7 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg1/A.html", true,
-                "var methods = {",
+                "var data = {",
                 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All "
                 + "Methods</span><span class=\"tabEnd\">&nbsp;</span></span>"
                 + "<span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:show(1);\">"
@@ -62,7 +62,7 @@
                 "<tr id=\"i0\" class=\"altColor\">");
 
         checkOutput("pkg1/B.html", true,
-                "var methods = {\"i0\":6,\"i1\":18,\"i2\":18,\"i3\":1,\"i4\":1,"
+                "var data = {\"i0\":6,\"i1\":18,\"i2\":18,\"i3\":1,\"i4\":1,"
                 + "\"i5\":6,\"i6\":6,\"i7\":6,\"i8\":6};\n",
                 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Methods</span>"
                 + "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t1\" class=\"tableTab\">"
@@ -76,7 +76,7 @@
                 + "<span class=\"tabEnd\">&nbsp;</span></span></caption>\n");
 
         checkOutput("pkg1/D.html", true,
-                "var methods = {",
+                "var data = {",
                 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All "
                 + "Methods</span><span class=\"tabEnd\">&nbsp;</span></span>"
                 + "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">"
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java	Thu May 17 08:41:01 2018 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java	Thu May 17 12:59:53 2018 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8178070
+ * @bug 8178070 8196201
  * @summary Test packages table in module summary pages
  * @library /tools/lib ../lib
  * @modules jdk.compiler/com.sun.tools.javac.api
@@ -419,17 +419,17 @@
                         + "<span class=\"tabEnd\">&nbsp;</span></span>");
             if (kindSet.contains(TabKind.EXPORTS)) {
                 sb.append("<span id=\"t1\" class=\"tableTab\">"
-                        + "<span><a href=\"javascript:showPkgs(1);\">Exports</a></span>"
+                        + "<span><a href=\"javascript:show(1);\">Exports</a></span>"
                         + "<span class=\"tabEnd\">&nbsp;</span></span>");
             }
             if (kindSet.contains(TabKind.OPENS)) {
                 sb.append("<span id=\"t2\" class=\"tableTab\">"
-                        + "<span><a href=\"javascript:showPkgs(2);\">Opens</a></span>"
+                        + "<span><a href=\"javascript:show(2);\">Opens</a></span>"
                         + "<span class=\"tabEnd\">&nbsp;</span></span>");
             }
             if (kindSet.contains(TabKind.CONCEALED)) {
                 sb.append("<span id=\"t3\" class=\"tableTab\"><span>"
-                        + "<a href=\"javascript:showPkgs(4);\">Concealed</a></span>"
+                        + "<a href=\"javascript:show(4);\">Concealed</a></span>"
                         + "<span class=\"tabEnd\">&nbsp;</span></span>");
             }
             sb.append("</caption>");
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Thu May 17 08:41:01 2018 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Thu May 17 12:59:53 2018 -0700
@@ -26,7 +26,7 @@
  * @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363
  *      8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218
  *      8175823 8166306 8178043 8181622 8183511 8169819 8074407 8183037 8191464
-        8164407 8192007 8182765 8196200
+        8164407 8192007 8182765 8196200 8196201
  * @summary Test modules support in javadoc.
  * @author bpatel
  * @library ../lib
@@ -64,6 +64,7 @@
         checkModuleFilesAndLinks(true);
         checkModulesInSearch(true);
         checkOverviewFrame(true);
+        checkAllPkgsAllClasses(false);
     }
 
     /**
@@ -88,6 +89,7 @@
         checkModuleFilesAndLinks(true);
         checkModulesInSearch(true);
         checkOverviewFrame(true);
+        checkAllPkgsAllClasses(true);
     }
 
     /**
@@ -1086,8 +1088,7 @@
                 + "onclick=\"updateModuleFrame('moduleB/module-type-frame.html','moduleB/module-summary.html');"
                 + "\">moduleB</a></li>");
         checkOutput("script.js", true,
-                "function updateModuleFrame(pFrame, cFrame)\n"
-                + "{\n"
+                "function updateModuleFrame(pFrame, cFrame) {\n"
                 + "    top.packageFrame.location = pFrame;\n"
                 + "    top.classFrame.location = cFrame;\n"
                 + "}");
@@ -1332,8 +1333,8 @@
                 + "<td class=\"colSecond\">All Modules</td>\n"
                 + "<td class=\"colLast\">&nbsp;</td>",
                 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span class=\"tabEnd\">&nbsp;</span></span>"
-                + "<span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showPkgs(1);\">Exports</a></span>"
-                + "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:showPkgs(4);\">"
+                + "<span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:show(1);\">Exports</a></span>"
+                + "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">"
                 + "Concealed</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
                 "<th class=\"colFirst\" scope=\"row\"><a href=\"concealedpkgmdlA/package-summary.html\">concealedpkgmdlA</a></th>\n"
                 + "<td class=\"colSecond\">None</td>\n"
@@ -1359,8 +1360,8 @@
                 + "<td class=\"colLast\">&nbsp;<br>(<span class=\"implementationLabel\">Implementation(s):</span>&nbsp;<a href=\"testpkgmdlB/TestClassInModuleB.html\" "
                 + "title=\"class in testpkgmdlB\">TestClassInModuleB</a>)</td>",
                 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t1\" class=\"tableTab\"><span>"
-                + "<a href=\"javascript:showPkgs(1);\">Exports</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span>"
-                + "<a href=\"javascript:showPkgs(2);\">Opens</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>");
+                + "<a href=\"javascript:show(1);\">Exports</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span>"
+                + "<a href=\"javascript:show(2);\">Opens</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>");
         checkOutput("moduleC/module-summary.html", found,
                 "<caption><span>Exports</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
                 + "<tr>\n"
@@ -1444,12 +1445,12 @@
                 "<div class=\"contentContainer\">\n"
                 + "<table class=\"overviewSummary\">\n"
                 + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Modules</span><span class=\"tabEnd\">&nbsp;"
-                + "</span></span><span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showGroups(1);\">"
+                + "</span></span><span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:show(1);\">"
                 + "Module Group A</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" class=\"tableTab\">"
-                + "<span><a href=\"javascript:showGroups(2);\">Module Group B &amp; C</a></span><span class=\"tabEnd\">"
-                + "&nbsp;</span></span><span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:showGroups(4);\">"
+                + "<span><a href=\"javascript:show(2);\">Module Group B &amp; C</a></span><span class=\"tabEnd\">"
+                + "&nbsp;</span></span><span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">"
                 + "Other Modules</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
-                "var groups = {\"i0\":1,\"i1\":2,\"i2\":2,\"i3\":4};\n"
+                "var data = {\"i0\":1,\"i1\":2,\"i2\":2,\"i3\":4};\n"
                 + "var tabs = {65535:[\"t0\",\"All Modules\"],1:[\"t1\",\"Module Group A\"],2:[\"t2\",\"Module Group B & C\"],4:[\"t4\",\"Other Modules\"]};\n"
                 + "var altColor = \"altColor\";\n"
                 + "var rowColor = \"rowColor\";\n"
@@ -1466,12 +1467,12 @@
                 "<div class=\"contentContainer\">\n"
                 + "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
                 + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Modules</span><span class=\"tabEnd\">&nbsp;"
-                + "</span></span><span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showGroups(1);\">"
+                + "</span></span><span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:show(1);\">"
                 + "Module Group A</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" class=\"tableTab\">"
-                + "<span><a href=\"javascript:showGroups(2);\">Module Group B &amp; C</a></span><span class=\"tabEnd\">"
-                + "&nbsp;</span></span><span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:showGroups(4);\">"
+                + "<span><a href=\"javascript:show(2);\">Module Group B &amp; C</a></span><span class=\"tabEnd\">"
+                + "&nbsp;</span></span><span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">"
                 + "Other Modules</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
-                "var groups = {\"i0\":1,\"i1\":2,\"i2\":2,\"i3\":4};\n"
+                "var data = {\"i0\":1,\"i1\":2,\"i2\":2,\"i3\":4};\n"
                 + "var tabs = {65535:[\"t0\",\"All Modules\"],1:[\"t1\",\"Module Group A\"],2:[\"t2\",\"Module Group B & C\"],4:[\"t4\",\"Other Modules\"]};\n"
                 + "var altColor = \"altColor\";\n"
                 + "var rowColor = \"rowColor\";\n"
@@ -1487,22 +1488,22 @@
         checkOutput("overview-summary.html", true,
                 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Modules</span><span "
                 + "class=\"tabEnd\">&nbsp;</span></span><span id=\"t1\" class=\"tableTab\"><span>"
-                + "<a href=\"javascript:showGroups(1);\">B Group</a></span><span class=\"tabEnd\">"
-                + "&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:showGroups(2);\">"
+                + "<a href=\"javascript:show(1);\">B Group</a></span><span class=\"tabEnd\">"
+                + "&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">"
                 + "C Group</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t4\" class=\"tableTab\">"
-                + "<span><a href=\"javascript:showGroups(4);\">A Group</a></span><span class=\"tabEnd\">&nbsp;</span>"
-                + "</span><span id=\"t8\" class=\"tableTab\"><span><a href=\"javascript:showGroups(8);\">Other Modules"
+                + "<span><a href=\"javascript:show(4);\">A Group</a></span><span class=\"tabEnd\">&nbsp;</span>"
+                + "</span><span id=\"t8\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">Other Modules"
                 + "</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
                 "var tabs = {65535:[\"t0\",\"All Modules\"],1:[\"t1\",\"B Group\"],2:[\"t2\",\"C Group\"],"
                 + "4:[\"t4\",\"A Group\"],8:[\"t8\",\"Other Modules\"]};");
         checkOutput("overview-summary.html", false,
                 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Modules</span><span "
                 + "class=\"tabEnd\">&nbsp;</span></span><span id=\"t1\" class=\"tableTab\"><span>"
-                + "<a href=\"javascript:showGroups(1);\">A Group</a></span><span class=\"tabEnd\">"
-                + "&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:showGroups(2);\">"
+                + "<a href=\"javascript:show(1);\">A Group</a></span><span class=\"tabEnd\">"
+                + "&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">"
                 + "B Group</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t4\" class=\"tableTab\">"
-                + "<span><a href=\"javascript:showGroups(4);\">C Group</a></span><span class=\"tabEnd\">&nbsp;</span>"
-                + "</span><span id=\"t8\" class=\"tableTab\"><span><a href=\"javascript:showGroups(8);\">Other Modules"
+                + "<span><a href=\"javascript:show(4);\">C Group</a></span><span class=\"tabEnd\">&nbsp;</span>"
+                + "</span><span id=\"t8\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">Other Modules"
                 + "</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
                 "Java SE Modules");
     }
@@ -1515,11 +1516,11 @@
                 + "<div class=\"contentContainer\">\n"
                 + "<table class=\"overviewSummary\">\n"
                 + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span class=\"tabEnd\">&nbsp;"
-                + "</span></span><span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showGroups(1);\">"
+                + "</span></span><span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:show(1);\">"
                 + "Package Group 0</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" "
-                + "class=\"tableTab\"><span><a href=\"javascript:showGroups(2);\">Package Group 1</a></span>"
+                + "class=\"tableTab\"><span><a href=\"javascript:show(2);\">Package Group 1</a></span>"
                 + "<span class=\"tabEnd\">&nbsp;</span></span></caption>",
-                "var groups = {\"i0\":1,\"i1\":2};\n"
+                "var data = {\"i0\":1,\"i1\":2};\n"
                 + "var tabs = {65535:[\"t0\",\"All Packages\"],1:[\"t1\",\"Package Group 0\"],2:[\"t2\",\"Package Group 1\"]};\n"
                 + "var altColor = \"altColor\";\n"
                 + "var rowColor = \"rowColor\";\n"
@@ -1535,9 +1536,9 @@
                 + "<div class=\"contentContainer\">\n"
                 + "<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">\n"
                 + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span class=\"tabEnd\">&nbsp;"
-                + "</span></span><span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showGroups(1);\">"
+                + "</span></span><span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:show(1);\">"
                 + "Package Group 0</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" "
-                + "class=\"tableTab\"><span><a href=\"javascript:showGroups(2);\">Package Group 1</a></span>"
+                + "class=\"tableTab\"><span><a href=\"javascript:show(2);\">Package Group 1</a></span>"
                 + "<span class=\"tabEnd\">&nbsp;</span></span></caption>");
     }
 
@@ -1545,8 +1546,8 @@
         checkOutput("overview-summary.html", true,
                 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span "
                 + "class=\"tabEnd\">&nbsp;</span></span><span id=\"t1\" class=\"tableTab\"><span>"
-                + "<a href=\"javascript:showGroups(1);\">Z Group</a></span><span class=\"tabEnd\">"
-                + "&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:showGroups(2);\">"
+                + "<a href=\"javascript:show(1);\">Z Group</a></span><span class=\"tabEnd\">"
+                + "&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">"
                 + "A Group</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
                 "var tabs = {65535:[\"t0\",\"All Packages\"],1:[\"t1\",\"Z Group\"],2:[\"t2\",\"A Group\"]};");
     }
@@ -1613,4 +1614,38 @@
                 "<a href=\"https://docs.oracle.com/javase/9/docs/api/java.base/module-summary.html?is-external=true\" "
                 + "class=\"externalLink\"><code>Link to java.base module</code></a>");
 }
+
+    void checkAllPkgsAllClasses(boolean found) {
+        checkOutput("allclasses-index.html", true,
+                "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Classes</span>"
+                + "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" class=\"tableTab\">"
+                + "<span><a href=\"javascript:show(2);\">Class Summary</a></span><span class=\"tabEnd\">"
+                + "&nbsp;</span></span><span id=\"t6\" class=\"tableTab\"><span><a href=\"javascript:show(32);\">"
+                + "Annotation Types Summary</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Class</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>");
+        checkOutput("allpackages-index.html", true,
+                "<caption><span>Package Summary</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>\n");
+        checkOutput("allclasses-index.html", found,
+                "<table class=\"typeSummary\">\n");
+        checkOutput("allpackages-index.html", found,
+                "<table class=\"packagesSummary\">\n");
+        checkOutput("allclasses-index.html", !found,
+                "<table class=\"typeSummary\" summary=\"Class Summary table, listing classes, and an explanation\">");
+        checkOutput("allpackages-index.html", !found,
+                "<table class=\"packagesSummary\" summary=\"Package Summary table, listing packages, and an explanation\">");
+        checkOutput("type-search-index.js", true,
+                "{\"l\":\"All Classes\",\"url\":\"allclasses-index.html\"}");
+        checkOutput("package-search-index.js", true,
+                "{\"l\":\"All Packages\",\"url\":\"allpackages-index.html\"}");
+        checkOutput("index-all.html", true,
+                "<br><a href=\"allclasses-index.html\">All&nbsp;Classes</a>&nbsp;"
+                + "<a href=\"allpackages-index.html\">All&nbsp;Packages</a>");
 }
+}
--- a/test/langtools/jdk/javadoc/doclet/testPackagePage/TestPackagePage.java	Thu May 17 08:41:01 2018 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testPackagePage/TestPackagePage.java	Thu May 17 12:59:53 2018 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4492643 4689286
+ * @bug 4492643 4689286 8196201
  * @summary Test that a package page is properly generated when a .java file
  * passed to Javadoc.  Also test that the proper package links are generated
  * when single or multiple packages are documented.
@@ -82,5 +82,26 @@
             "<li>Package</li>");
         checkOutput("help-doc.html", true,
             "<li>Package</li>");
+        checkOutput("allclasses-index.html", true,
+                "<table class=\"typeSummary\">\n"
+                + "<caption><span>Class Summary</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Class</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>\n");
+        checkOutput("allpackages-index.html", true,
+                "<table class=\"packagesSummary\">\n"
+                + "<caption><span>Package Summary</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>\n");
+        checkOutput("type-search-index.js", true,
+                "{\"l\":\"All Classes\",\"url\":\"allclasses-index.html\"}");
+        checkOutput("package-search-index.js", true,
+                "{\"l\":\"All Packages\",\"url\":\"allpackages-index.html\"}");
+        checkOutput("index-all.html", true,
+                "<br><a href=\"allclasses-index.html\">All&nbsp;Classes</a>&nbsp;"
+                + "<a href=\"allpackages-index.html\">All&nbsp;Packages</a>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java	Thu May 17 08:41:01 2018 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java	Thu May 17 12:59:53 2018 -0700
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8141492 8071982 8141636 8147890 8166175 8168965 8176794 8175218 8147881
- *      8181622 8182263 8074407 8187521 8198522 8182765 8199278
+ *      8181622 8182263 8074407 8187521 8198522 8182765 8199278 8196201
  * @summary Test the search feature of javadoc.
  * @author bpatel
  * @library ../lib
@@ -50,13 +50,13 @@
         checkJqueryAndImageFiles(true);
         checkSearchJS();
         checkFiles(false,
-                "package-search-index.zip",
                 "tag-search-index.zip",
-                "package-search-index.js",
                 "tag-search-index.js");
         checkFiles(true,
+                "package-search-index.zip",
                 "member-search-index.zip",
                 "type-search-index.zip",
+                "package-search-index.js",
                 "member-search-index.js",
                 "type-search-index.js");
     }
@@ -75,6 +75,7 @@
         checkSingleIndexSearchTagDuplication();
         checkJqueryAndImageFiles(true);
         checkSearchJS();
+        checkAllPkgsAllClasses();
         checkFiles(true,
                 "member-search-index.zip",
                 "package-search-index.zip",
@@ -154,7 +155,9 @@
                 "package-search-index.js",
                 "tag-search-index.js",
                 "type-search-index.js",
-                "index-all.html");
+                "index-all.html",
+                "allpackages-index.html",
+                "allclasses-index.html");
     }
 
     @Test
@@ -471,7 +474,9 @@
                 "<dt><span class=\"searchTagLink\"><a href=\"../pkg2/TestError.html#SearchTagDeprecatedMethod\">"
                 + "SearchTagDeprecatedMethod</a></span> - Search tag in pkg2.TestError</dt>",
                 "<dt><span class=\"searchTagLink\"><a href=\"../pkg/package-summary.html#SingleWord\">"
-                + "SingleWord</a></span> - Search tag in pkg</dt>");
+                + "SingleWord</a></span> - Search tag in pkg</dt>",
+                "<br><a href=\"../allclasses-index.html\">All&nbsp;Classes</a>&nbsp;"
+                + "<a href=\"../allpackages-index.html\">All&nbsp;Packages</a>");
         checkOutput("index-files/index-10.html", true,
                 "<dt><span class=\"searchTagLink\"><a href=\"../pkg/package-summary.html#phrasewithspaces\">"
                 + "phrase with spaces</a></span> - Search tag in pkg</dt>",
@@ -628,15 +633,17 @@
                 + "        var slash = \"/\";\n"
                 + "        if (ui.item.category === catModules) {\n"
                 + "            return ui.item.l + slash;\n"
-                + "        } else if (ui.item.category === catPackages) {\n"
+                + "        } else if (ui.item.category === catPackages && ui.item.m) {\n"
                 + "            return ui.item.m + slash;\n"
-                + "        } else if (ui.item.category === catTypes || ui.item.category === catMembers) {\n"
+                + "        } else if ((ui.item.category === catTypes && ui.item.p) || ui.item.category === catMembers) {\n"
                 + "            $.each(packageSearchIndex, function(index, item) {\n"
                 + "                if (ui.item.p == item.l) {\n"
                 + "                    urlPrefix = item.m + slash;\n"
                 + "                }\n"
                 + "            });\n"
                 + "            return urlPrefix;\n"
+                + "        } else {\n"
+                + "            return urlPrefix;\n"
                 + "        }\n"
                 + "    }\n"
                 + "    return urlPrefix;\n"
@@ -673,4 +680,41 @@
                 + "SearchTagDeprecatedMethod</a></span> - Search tag in pkg2.TestError</dt>\n"
                 + "<dd>with description</dd>");
     }
+
+    void checkAllPkgsAllClasses() {
+        checkOutput("allclasses-index.html", true,
+                "<table class=\"typeSummary\">\n"
+                + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Classes</span>"
+                + "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t1\" class=\"tableTab\">"
+                + "<span><a href=\"javascript:show(1);\">Interface Summary</a></span><span class=\"tabEnd\">"
+                + "&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">"
+                + "Class Summary</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t3\" class=\"tableTab\">"
+                + "<span><a href=\"javascript:show(4);\">Enum Summary</a></span><span class=\"tabEnd\">&nbsp;"
+                + "</span></span><span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">"
+                + "Exception Summary</a></span><span class=\"tabEnd\">&nbsp;</span></span>"
+                + "<span id=\"t5\" class=\"tableTab\"><span><a href=\"javascript:show(16);\">"
+                + "Error Summary</a></span><span class=\"tabEnd\">&nbsp;</span></span>"
+                + "<span id=\"t6\" class=\"tableTab\"><span><a href=\"javascript:show(32);\">Annotation Types Summary"
+                + "</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Class</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>",
+                "var data = {\"i0\":32,\"i1\":2,\"i2\":4,\"i3\":2,\"i4\":2,\"i5\":1,\"i6\":2,\"i7\":32,"
+                + "\"i8\":2,\"i9\":4,\"i10\":16,\"i11\":16,\"i12\":8,\"i13\":8,\"i14\":1,\"i15\":2};");
+        checkOutput("allpackages-index.html", true,
+                "<table class=\"packagesSummary\">\n"
+                + "<caption><span>Package Summary</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>\n");
+        checkOutput("type-search-index.js", true,
+                "{\"l\":\"All Classes\",\"url\":\"allclasses-index.html\"}");
+        checkOutput("package-search-index.js", true,
+                "{\"l\":\"All Packages\",\"url\":\"allpackages-index.html\"}");
+        checkOutput("index-all.html", true,
+                "<br><a href=\"allclasses-index.html\">All&nbsp;Classes</a>&nbsp;"
+                + "<a href=\"allpackages-index.html\">All&nbsp;Packages</a>");
 }
+}
--- a/test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java	Thu May 17 08:41:01 2018 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java	Thu May 17 12:59:53 2018 -0700
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug      4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461 8154261 8162363 8160196 8151743 8177417
- *           8175218 8176452 8181215 8182263 8183511 8169819 8183037 8185369 8182765
+ *           8175218 8176452 8181215 8182263 8183511 8169819 8183037 8185369 8182765 8196201
  * @summary  Run tests on doclet stylesheet.
  * @author   jamieh
  * @library  ../lib
@@ -106,7 +106,7 @@
                 + "    height:16px;\n"
                 + "}",
                 ".memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span,\n"
-                + ".overviewSummary caption span.activeTableTab span {\n"
+                + ".overviewSummary caption span.activeTableTab span, .typeSummary caption span.activeTableTab span {\n"
                 + "    white-space:nowrap;\n"
                 + "    padding-top:5px;\n"
                 + "    padding-left:12px;\n"
@@ -118,7 +118,7 @@
                 + "    height:16px;\n"
                 + "}",
                 ".memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span,\n"
-                + ".overviewSummary caption span.tableTab span {\n"
+                + ".overviewSummary caption span.tableTab span, .typeSummary caption span.tableTab span {\n"
                 + "    white-space:nowrap;\n"
                 + "    padding-top:5px;\n"
                 + "    padding-left:12px;\n"
@@ -137,7 +137,7 @@
                 + ".providesSummary td.colFirst, .providesSummary th.colFirst,\n"
                 + ".memberSummary td.colFirst, .memberSummary th.colFirst,\n"
                 + ".memberSummary td.colSecond, .memberSummary th.colSecond, .memberSummary th.colConstructorName,\n"
-                + ".typeSummary td.colFirst {\n"
+                + ".typeSummary td.colFirst, .typeSummary th.colFirst {\n"
                 + "    vertical-align:top;\n"
                 + "}",
                 ".overviewSummary td, .memberSummary td, .typeSummary td,\n"
@@ -148,7 +148,8 @@
                 + "}",
                 ".memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab,\n"
                 + ".packagesSummary caption span.tableTab, .packagesSummary caption span.activeTableTab,\n"
-                + ".overviewSummary caption span.tableTab, .overviewSummary caption span.activeTableTab {\n"
+                + ".overviewSummary caption span.tableTab, .overviewSummary caption span.activeTableTab,\n"
+                + ".typeSummary caption span.tableTab, .typeSummary caption span.activeTableTab {\n"
                 + "    padding-top:0px;\n"
                 + "    padding-left:0px;\n"
                 + "    padding-right:0px;\n"
@@ -180,7 +181,9 @@
                 + "th.colSecond a:link, th.colSecond a:visited,\n"
                 + "th.colConstructorName a:link, th.colConstructorName a:visited,\n"
                 + "th.colDeprecatedItemName a:link, th.colDeprecatedItemName a:visited, \n"
-                + ".constantValuesContainer td a:link, .constantValuesContainer td a:visited {\n"
+                + ".constantValuesContainer td a:link, .constantValuesContainer td a:visited, \n"
+                + ".allClassesContainer td a:link, .allClassesContainer td a:visited, \n"
+                + ".allPackagesContainer td a:link, .allPackagesContainer td a:visited {\n"
                 + "    font-weight:bold;\n"
                 + "}",
                 ".deprecationBlock {\n"
--- a/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java	Thu May 17 08:41:01 2018 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java	Thu May 17 12:59:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4904075 4774450 5015144 8043698
+ * @bug      4904075 4774450 5015144 8043698 8196201
  * @summary  Reference unnamed package as "Unnamed", not empty string.
  *           Generate a package summary for the unnamed package.
  * @author   jamieh
@@ -64,6 +64,48 @@
         checkOutput("C.html", true,
                 "<a href=\"package-summary.html\">");
 
+        checkOutput("allclasses-index.html", true,
+                "<table class=\"typeSummary\">\n"
+                + "<caption><span>Class Summary</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Class</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>\n"
+                + "<tr id=\"i0\" class=\"altColor\">\n"
+                + "<td class=\"colFirst\"><a href=\"C.html\" title=\"class in &lt;Unnamed&gt;\">C</a></td>\n"
+                + "<th class=\"colLast\" scope=\"row\">\n"
+                + "<div class=\"block\">This is a class in the unnamed package.</div>\n"
+                + "</th>\n"
+                + "</tr>\n"
+                + "</table>");
+
+        checkOutput("allpackages-index.html", true,
+                "<table class=\"packagesSummary\">\n"
+                + "<caption><span>Package Summary</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>\n"
+                + "<tbody>\n"
+                + "<tr class=\"altColor\">\n"
+                + "<th class=\"colFirst\" scope=\"row\"><a href=\"package-summary.html\">&lt;Unnamed&gt;</a></th>\n"
+                + "<td class=\"colLast\">\n"
+                + "<div class=\"block\">This is a package comment for the unnamed package.</div>\n"
+                + "</td>\n"
+                + "</tr>\n"
+                + "</tbody>\n"
+                + "</table>");
+
+        checkOutput("type-search-index.js", true,
+                "{\"l\":\"All Classes\",\"url\":\"allclasses-index.html\"}");
+
+        checkOutput("package-search-index.js", true,
+                "{\"l\":\"All Packages\",\"url\":\"allpackages-index.html\"}");
+
+        checkOutput("index-all.html", true,
+                "<br><a href=\"allclasses-index.html\">All&nbsp;Classes</a>&nbsp;"
+                + "<a href=\"allpackages-index.html\">All&nbsp;Packages</a>");
+
         checkOutput(Output.OUT, false,
                 "BadSource");
     }
--- a/test/langtools/jdk/javadoc/tool/api/basic/APITest.java	Thu May 17 08:41:01 2018 -0700
+++ b/test/langtools/jdk/javadoc/tool/api/basic/APITest.java	Thu May 17 12:59:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -191,7 +191,9 @@
      */
     protected static Set<String> standardExpectFiles = new HashSet<>(Arrays.asList(
             "allclasses-frame.html",
+            "allclasses-index.html",
             "allclasses-noframe.html",
+            "allpackages-index.html",
             "constant-values.html",
             "deprecated-list.html",
             "help-doc.html",
@@ -245,7 +247,8 @@
 
     protected static Set<String> noIndexFiles = standardExpectFiles.stream()
             .filter(s -> !s.startsWith("jquery") && !s.startsWith("resources") && !s.endsWith("zip")
-                    && !s.equals("index-all.html") && !s.equals("search.js") && !s.endsWith("-search-index.js"))
+            && !s.equals("index-all.html") && !s.equals("search.js") && !s.endsWith("-search-index.js")
+            && !s.equals("allclasses-index.html") && !s.equals("allpackages-index.html"))
             .collect(Collectors.toSet());
 }
 
--- a/test/langtools/tools/javadoc/api/basic/APITest.java	Thu May 17 08:41:01 2018 -0700
+++ b/test/langtools/tools/javadoc/api/basic/APITest.java	Thu May 17 12:59:53 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -191,7 +191,9 @@
      */
     protected static Set<String> standardExpectFiles = new HashSet<>(Arrays.asList(
             "allclasses-frame.html",
+            "allclasses-index.html",
             "allclasses-noframe.html",
+            "allpackages-index.html",
             "constant-values.html",
             "deprecated-list.html",
             "help-doc.html",
@@ -245,7 +247,8 @@
 
     protected static Set<String> noIndexFiles = standardExpectFiles.stream()
             .filter(s -> !s.startsWith("jquery") && !s.startsWith("resources") && !s.endsWith("zip")
-                    && !s.equals("index-all.html") && !s.equals("search.js") && !s.endsWith("-search-index.js"))
+            && !s.equals("index-all.html") && !s.equals("search.js") && !s.endsWith("-search-index.js")
+            && !s.equals("allclasses-index.html") && !s.equals("allpackages-index.html"))
             .collect(Collectors.toSet());
 }