< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java

Print this page

        

@@ -50,16 +50,11 @@
  *  deletion without notice.</b>
  *
  * @author Atul M Dambalkar
  * @author Bhavesh Patel (Modified)
  */
-public class PackageIndexWriter extends AbstractOverviewIndexWriter {
-
-    /**
-     * A Set of Packages to be documented.
-     */
-    protected SortedSet<PackageElement> packages;
+public class PackageIndexWriter extends AbstractPackageIndexWriter {
 
     /**
      * Construct the PackageIndexWriter. Also constructs the grouping
      * information as provided on the command line by "-group" option. Stores
      * the order of groups specified by the user.

@@ -68,11 +63,10 @@
      * @param filename the path of the page to be generated
      * @see Group
      */
     public PackageIndexWriter(HtmlConfiguration configuration, DocPath filename) {
         super(configuration, filename);
-        packages = configuration.packages;
     }
 
     /**
      * Generate the package index page.
      *

@@ -80,20 +74,30 @@
      * @throws DocFileIOException if there is a problem generating the package index page
      */
     public static void generate(HtmlConfiguration configuration) throws DocFileIOException {
         DocPath filename = DocPaths.INDEX;
         PackageIndexWriter packgen = new PackageIndexWriter(configuration, filename);
-        packgen.buildOverviewIndexFile("doclet.Window_Overview_Summary", "package index");
+        packgen.buildPackageIndexFile("doclet.Window_Overview_Summary", "package index");
     }
 
     /**
-     * Adds the packages list to the documentation tree.
+     * Depending upon the grouping information and their titles, add
+     * separate table indices for each package group.
      *
+     * @param header the documentation tree to which the navigational links will be added
      * @param main the documentation tree to which the packages list will be added
      */
     @Override
-    protected void addIndex(Content main) {
+    protected void addIndex(Content header, Content main) {
+        addIndexContents(header, main);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void addPackagesList(Content main) {
         Map<String, SortedSet<PackageElement>> groupPackageMap
                 = configuration.group.groupPackages(packages);
 
         if (!groupPackageMap.keySet().isEmpty()) {
             Table table =  new Table(HtmlStyle.overviewSummary)

@@ -128,6 +132,64 @@
             if (table.needsScript()) {
                 getMainBodyScript().append(table.getScript());
             }
         }
     }
+
+    /**
+     * Adds the overview summary comment for this documentation. Add one line
+     * summary at the top of the page and generate a link to the description,
+     * which is added at the end of this page.
+     *
+     * @param main the documentation tree to which the overview header will be added
+     */
+    @Override
+    protected void addOverviewHeader(Content main) {
+        addConfigurationTitle(main);
+        if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
+            HtmlTree div = new HtmlTree(HtmlTag.DIV);
+            div.setStyle(HtmlStyle.contentContainer);
+            addOverviewComment(div);
+            main.add(div);
+        }
+    }
+
+    /**
+     * Adds the overview comment as provided in the file specified by the
+     * "-overview" option on the command line.
+     *
+     * @param htmltree the documentation tree to which the overview comment will
+     *                 be added
+     */
+    protected void addOverviewComment(Content htmltree) {
+        if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
+            addInlineComment(configuration.overviewElement, htmltree);
+        }
+    }
+
+    /**
+     * Adds the top text (from the -top option), the upper
+     * navigation bar, and then the title (from the"-title"
+     * option), at the top of page.
+     *
+     * @param header the documentation tree to which the navigation bar header will be added
+     */
+    @Override
+    protected void addNavigationBarHeader(Content header) {
+        addTop(header);
+        navBar.setUserHeader(getUserHeaderFooter(true));
+        header.add(navBar.getContent(true));
+    }
+
+    /**
+     * Adds the lower navigation bar and the bottom text
+     * (from the -bottom option) at the bottom of page.
+     *
+     * @param footer the documentation tree to which the navigation bar footer will be added
+     */
+    @Override
+    protected void addNavigationBarFooter(Content footer) {
+        navBar.setUserFooter(getUserHeaderFooter(false));
+        footer.add(navBar.getContent(false));
+        addBottom(footer);
+    }
 }
< prev index next >