提交 daa791a5 编写于 作者: B bpatel

8016921: Change the profiles table on overview-summary.html page to a list

Reviewed-by: jjg
上级 e33367e5
...@@ -159,10 +159,7 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter { ...@@ -159,10 +159,7 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
body.addContent(div); body.addContent(div);
if (configuration.showProfiles) { if (configuration.showProfiles) {
Content profileSummary = configuration.getResource("doclet.Profiles"); Content profileSummary = configuration.getResource("doclet.Profiles");
Content profilesTableSummary = configuration.getResource("doclet.Member_Table_Summary", addProfilesList(profileSummary, body);
configuration.getResource("doclet.Profile_Summary"),
configuration.getResource("doclet.profiles"));
addProfilesList(profileSummary, profilesTableSummary, body);
} }
addPackagesList(packages, text, tableSummary, body); addPackagesList(packages, text, tableSummary, body);
} }
...@@ -214,10 +211,8 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter { ...@@ -214,10 +211,8 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
* Do nothing. This will be overridden. * Do nothing. This will be overridden.
* *
* @param profileSummary the profile summary heading * @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 * @param body the content tree to which the profiles list will be added
*/ */
protected void addProfilesList(Content profileSummary, Content profilesTableSummary, protected void addProfilesList(Content profileSummary, Content body) {
Content body) {
} }
} }
...@@ -123,15 +123,20 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter { ...@@ -123,15 +123,20 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
protected void addProfilesList(Content profileSummary, String profilesTableSummary, protected void addProfilesList(Content profileSummary, Content body) {
Content body) { Content h2 = HtmlTree.HEADING(HtmlTag.H2, profileSummary);
Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, profilesTableSummary, Content profilesDiv = HtmlTree.DIV(h2);
getTableCaption(profileSummary)); Content ul = new HtmlTree(HtmlTag.UL);
table.addContent(getSummaryTableHeader(profileTableHeader, "col")); String profileName;
Content tbody = new HtmlTree(HtmlTag.TBODY); for (int i = 1; i < configuration.profiles.getProfileCount(); i++) {
addProfilesList(tbody); profileName = Profile.lookup(i).name;
table.addContent(tbody); Content profileLinkContent = getTargetProfileLink("classFrame",
Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table); 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); body.addContent(div);
} }
...@@ -150,31 +155,6 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter { ...@@ -150,31 +155,6 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
body.addContent(div); body.addContent(div);
} }
/**
* 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. * Adds list of packages in the index table. Generate link to each package.
* *
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/* /*
* @test * @test
* @bug 8006124 8009684 * @bug 8006124 8009684 8016921
* @summary Test javadoc support for profiles. * @summary Test javadoc support for profiles.
* @author Bhavesh Patel * @author Bhavesh Patel
* @library ../lib/ * @library ../lib/
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
public class TestProfiles extends JavadocTester { public class TestProfiles extends JavadocTester {
//Test information. //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 PROFILE_BUG_ID = BUG_ID + "-1";
private static final String PACKAGE_BUG_ID = BUG_ID + "-2"; private static final String PACKAGE_BUG_ID = BUG_ID + "-2";
//Javadoc arguments. //Javadoc arguments.
...@@ -105,6 +105,14 @@ public class TestProfiles extends JavadocTester { ...@@ -105,6 +105,14 @@ public class TestProfiles extends JavadocTester {
{PROFILE_BUG_ID + FS + "index.html", {PROFILE_BUG_ID + FS + "index.html",
"<frame src=\"overview-frame.html\" name=\"packageListFrame\" " + "<frame src=\"overview-frame.html\" name=\"packageListFrame\" " +
"title=\"All Packages\">" "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 = { private static final String[][] PROFILES_NEGATED_TEST = {
...@@ -159,6 +167,13 @@ public class TestProfiles extends JavadocTester { ...@@ -159,6 +167,13 @@ public class TestProfiles extends JavadocTester {
}, },
{PACKAGE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html", {PACKAGE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html",
"<div class=\"subTitle\">compact1, compact2, compact3</div>" "<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>"
} }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册