8016921: Change the profiles table on overview-summary.html page to a list
authorbpatel
Wed, 14 Aug 2013 21:44:51 -0700
changeset 19499 23bc1014824b
parent 19498 bb90ed5cb5dd
child 19500 26d88d483764
8016921: Change the profiles table on overview-summary.html page to a list Reviewed-by: jjg
langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java
langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java
langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java	Wed Aug 14 18:58:39 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java	Wed Aug 14 21:44:51 2013 -0700
@@ -159,10 +159,7 @@
             body.addContent(div);
             if (configuration.showProfiles) {
                 Content profileSummary = configuration.getResource("doclet.Profiles");
-                Content profilesTableSummary = configuration.getResource("doclet.Member_Table_Summary",
-                        configuration.getResource("doclet.Profile_Summary"),
-                        configuration.getResource("doclet.profiles"));
-                addProfilesList(profileSummary, profilesTableSummary, body);
+                addProfilesList(profileSummary, body);
             }
             addPackagesList(packages, text, tableSummary, body);
         }
@@ -214,10 +211,8 @@
      * Do nothing. This will be overridden.
      *
      * @param profileSummary the profile summary heading
-     * @param profilesTableSummary the profiles table summary information
      * @param body the content tree to which the profiles list will be added
      */
-    protected void addProfilesList(Content profileSummary, Content profilesTableSummary,
-            Content body) {
+    protected void addProfilesList(Content profileSummary, Content body) {
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Wed Aug 14 18:58:39 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Wed Aug 14 21:44:51 2013 -0700
@@ -123,15 +123,20 @@
     /**
      * {@inheritDoc}
      */
-    protected void addProfilesList(Content profileSummary, String profilesTableSummary,
-            Content body) {
-        Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, profilesTableSummary,
-                getTableCaption(profileSummary));
-        table.addContent(getSummaryTableHeader(profileTableHeader, "col"));
-        Content tbody = new HtmlTree(HtmlTag.TBODY);
-        addProfilesList(tbody);
-        table.addContent(tbody);
-        Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table);
+    protected void addProfilesList(Content profileSummary, Content body) {
+        Content h2 = HtmlTree.HEADING(HtmlTag.H2, profileSummary);
+        Content profilesDiv = HtmlTree.DIV(h2);
+        Content ul = new HtmlTree(HtmlTag.UL);
+        String profileName;
+        for (int i = 1; i < configuration.profiles.getProfileCount(); i++) {
+            profileName = Profile.lookup(i).name;
+            Content profileLinkContent = getTargetProfileLink("classFrame",
+                    new StringContent(profileName), profileName);
+            Content li = HtmlTree.LI(profileLinkContent);
+            ul.addContent(li);
+        }
+        profilesDiv.addContent(ul);
+        Content div = HtmlTree.DIV(HtmlStyle.contentContainer, profilesDiv);
         body.addContent(div);
     }
 
@@ -151,31 +156,6 @@
     }
 
     /**
-     * Adds list of profiles in the index table. Generate link to each profile.
-     *
-     * @param tbody the documentation tree to which the list will be added
-     */
-    protected void addProfilesList(Content tbody) {
-        for (int i = 1; i < configuration.profiles.getProfileCount(); i++) {
-            String profileName = Profile.lookup(i).name;
-            Content profileLinkContent = getTargetProfileLink("classFrame",
-                    new StringContent(profileName), profileName);
-            Content tdProfile = HtmlTree.TD(HtmlStyle.colFirst, profileLinkContent);
-            HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
-            tdSummary.addStyle(HtmlStyle.colLast);
-            tdSummary.addContent(getSpace());
-            HtmlTree tr = HtmlTree.TR(tdProfile);
-            tr.addContent(tdSummary);
-            if (i % 2 == 0) {
-                tr.addStyle(HtmlStyle.altColor);
-            } else {
-                tr.addStyle(HtmlStyle.rowColor);
-            }
-            tbody.addContent(tr);
-        }
-    }
-
-    /**
      * Adds list of packages in the index table. Generate link to each package.
      *
      * @param packages Packages to which link is to be generated
--- a/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java	Wed Aug 14 18:58:39 2013 -0700
+++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java	Wed Aug 14 21:44:51 2013 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      8006124 8009684
+ * @bug      8006124 8009684 8016921
  * @summary  Test javadoc support for profiles.
  * @author   Bhavesh Patel
  * @library  ../lib/
@@ -33,7 +33,7 @@
 public class TestProfiles extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "8006124-8009684";
+    private static final String BUG_ID = "8006124-8009684-8016921";
     private static final String PROFILE_BUG_ID = BUG_ID + "-1";
     private static final String PACKAGE_BUG_ID = BUG_ID + "-2";
     //Javadoc arguments.
@@ -105,6 +105,14 @@
         {PROFILE_BUG_ID + FS + "index.html",
             "<frame src=\"overview-frame.html\" name=\"packageListFrame\" " +
             "title=\"All Packages\">"
+        },
+        //Test for "overview-summary.html" showing the profile list.
+        {PROFILE_BUG_ID + FS + "overview-summary.html",
+            "<ul>" + NL +"<li><a href=\"compact1-summary.html\" target=\"classFrame\">" +
+            "compact1</a></li>" + NL + "<li><a href=\"compact2-summary.html\" " +
+            "target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" +
+            "compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL +
+            "</ul>"
         }
     };
     private static final String[][] PROFILES_NEGATED_TEST = {
@@ -159,6 +167,13 @@
         },
         {PACKAGE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html",
             "<div class=\"subTitle\">compact1, compact2, compact3</div>"
+        },
+        {PACKAGE_BUG_ID + FS + "overview-summary.html",
+            "<ul>" + NL +"<li><a href=\"compact1-summary.html\" target=\"classFrame\">" +
+            "compact1</a></li>" + NL + "<li><a href=\"compact2-summary.html\" " +
+            "target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" +
+            "compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL +
+            "</ul>"
         }
     };