提交 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 {
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 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
* 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) {
}
}
......@@ -123,15 +123,20 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
/**
* {@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);
}
......@@ -150,31 +155,6 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
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.
*
......
......@@ -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 @@ public class TestProfiles extends JavadocTester {
{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 @@ public class TestProfiles extends JavadocTester {
},
{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>"
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册