8009684: Default top left frame should be "All Packages" in the generated javadoc documentation

Reviewed-by: jjg
This commit is contained in:
Bhavesh Patel 2013-03-13 14:47:15 -07:00
parent 09e3f06ae6
commit 82210b98a8
5 changed files with 21 additions and 34 deletions

View File

@ -135,13 +135,7 @@ public class FrameOutputWriter extends HtmlDocletWriter {
protected Content getFrameDetails() {
HtmlTree frameset = HtmlTree.FRAMESET("20%,80%", null, "Documentation frame",
"top.loadFrames()");
if (configuration.showProfiles) {
HtmlTree leftFrameset = HtmlTree.FRAMESET(null, "30%,70%", "Left frames",
"top.loadFrames()");
addAllProfilesFrameTag(leftFrameset);
addAllClassesFrameTag(leftFrameset);
frameset.addContent(leftFrameset);
} else if (noOfPackages <= 1) {
if (noOfPackages <= 1) {
addAllClassesFrameTag(frameset);
} else if (noOfPackages > 1) {
HtmlTree leftFrameset = HtmlTree.FRAMESET(null, "30%,70%", "Left frames",
@ -155,17 +149,6 @@ public class FrameOutputWriter extends HtmlDocletWriter {
return frameset;
}
/**
* Add the FRAME tag for the frame that lists all profiles.
*
* @param contentTree the content tree to which the information will be added
*/
private void addAllProfilesFrameTag(Content contentTree) {
HtmlTree frame = HtmlTree.FRAME(DocPaths.PROFILE_OVERVIEW_FRAME.getPath(),
"profileListFrame", configuration.getText("doclet.All_Profiles"));
contentTree.addContent(frame);
}
/**
* Add the FRAME tag for the frame that lists all packages.
*

View File

@ -162,7 +162,7 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
*/
protected void addAllProfilesLink(Content div) {
Content linkContent = getHyperLink(DocPaths.PROFILE_OVERVIEW_FRAME,
allprofilesLabel, "", "profileListFrame");
allprofilesLabel, "", "packageListFrame");
Content span = HtmlTree.SPAN(linkContent);
div.addContent(span);
}

View File

@ -107,7 +107,7 @@ public class ProfileIndexFrameWriter extends AbstractProfileIndexWriter {
String profileName = (Profile.lookup(profile)).name;
profileLabel = new StringContent(profileName);
profileLinkContent = getHyperLink(DocPaths.profileFrame(profileName), profileLabel, "",
"profileListFrame");
"packageListFrame");
Content li = HtmlTree.LI(profileLinkContent);
return li;
}
@ -154,7 +154,7 @@ public class ProfileIndexFrameWriter extends AbstractProfileIndexWriter {
*/
protected void addAllPackagesLink(Content div) {
Content linkContent = getHyperLink(DocPaths.OVERVIEW_FRAME,
allpackagesLabel, "", "profileListFrame");
allpackagesLabel, "", "packageListFrame");
Content span = HtmlTree.SPAN(linkContent);
div.addContent(span);
}

View File

@ -172,7 +172,7 @@ public class ProfilePackageIndexFrameWriter extends AbstractProfileIndexWriter {
*/
protected void addAllPackagesLink(Content div) {
Content linkContent = getHyperLink(DocPaths.OVERVIEW_FRAME,
allpackagesLabel, "", "profileListFrame");
allpackagesLabel, "", "packageListFrame");
Content span = HtmlTree.SPAN(linkContent);
div.addContent(span);
}
@ -185,7 +185,7 @@ public class ProfilePackageIndexFrameWriter extends AbstractProfileIndexWriter {
*/
protected void addAllProfilesLink(Content div) {
Content linkContent = getHyperLink(DocPaths.PROFILE_OVERVIEW_FRAME,
allprofilesLabel, "", "profileListFrame");
allprofilesLabel, "", "packageListFrame");
Content span = HtmlTree.SPAN(linkContent);
div.addContent(span);
}

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8006124
* @bug 8006124 8009684
* @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";
private static final String BUG_ID = "8006124-8009684";
private static final String PROFILE_BUG_ID = BUG_ID + "-1";
private static final String PACKAGE_BUG_ID = BUG_ID + "-2";
//Javadoc arguments.
@ -49,17 +49,17 @@ public class TestProfiles extends JavadocTester {
// Tests for profile-overview-frame.html listing all profiles.
{PROFILE_BUG_ID + FS + "profile-overview-frame.html",
"<span><a href=\"overview-frame.html\" "
+ "target=\"profileListFrame\">All Packages</a></span>"
+ "target=\"packageListFrame\">All Packages</a></span>"
},
{PROFILE_BUG_ID + FS + "profile-overview-frame.html",
"<li><a href=\"compact1-frame.html\" target=\"profileListFrame\">"
"<li><a href=\"compact1-frame.html\" target=\"packageListFrame\">"
+ "compact1</a></li>"
},
// Tests for profileName-frame.html listing all packages in a profile.
{PROFILE_BUG_ID + FS + "compact2-frame.html",
"<span><a href=\"overview-frame.html\" target=\"profileListFrame\">"
"<span><a href=\"overview-frame.html\" target=\"packageListFrame\">"
+ "All Packages</a></span><span><a href=\"profile-overview-frame.html\" "
+ "target=\"profileListFrame\">All Profiles</a></span>"
+ "target=\"packageListFrame\">All Profiles</a></span>"
},
{PROFILE_BUG_ID + FS + "compact2-frame.html",
"<li><a href=\"pkg4/compact2-package-frame.html\" "
@ -96,11 +96,15 @@ public class TestProfiles extends JavadocTester {
//Test for "overview-frame.html" showing the "All Profiles" link.
{PROFILE_BUG_ID + FS + "overview-frame.html",
"<span><a href=\"profile-overview-frame.html\" "
+ "target=\"profileListFrame\">All Profiles</a></span>"
+ "target=\"packageListFrame\">All Profiles</a></span>"
},
//Test for "className.html" showing the profile information for the type.
{PROFILE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html",
"<div class=\"subTitle\">compact1, compact2, compact3</div>"
},
{PROFILE_BUG_ID + FS + "index.html",
"<frame src=\"overview-frame.html\" name=\"packageListFrame\" " +
"title=\"All Packages\">"
}
};
private static final String[][] PROFILES_NEGATED_TEST = {
@ -131,12 +135,12 @@ public class TestProfiles extends JavadocTester {
private static final String[][] PACKAGES_NEGATED_TEST = {
{PACKAGE_BUG_ID + FS + "profile-overview-frame.html",
"<span><a href=\"overview-frame.html\" "
+ "target=\"profileListFrame\">All Packages</a></span>"
+ "target=\"packageListFrame\">All Packages</a></span>"
},
{PACKAGE_BUG_ID + FS + "compact2-frame.html",
"<span><a href=\"overview-frame.html\" target=\"profileListFrame\">"
"<span><a href=\"overview-frame.html\" target=\"packageListFrame\">"
+ "All Packages</a></span><span><a href=\"profile-overview-frame.html\" "
+ "target=\"profileListFrame\">All Profiles</a></span>"
+ "target=\"packageListFrame\">All Profiles</a></span>"
},
{PACKAGE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html",
"<a href=\"../compact2-summary.html\" target=\"classFrame\">"
@ -151,7 +155,7 @@ public class TestProfiles extends JavadocTester {
},
{PACKAGE_BUG_ID + FS + "overview-frame.html",
"<span><a href=\"profile-overview-frame.html\" "
+ "target=\"profileListFrame\">All Profiles</a></span>"
+ "target=\"packageListFrame\">All Profiles</a></span>"
},
{PACKAGE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html",
"<div class=\"subTitle\">compact1, compact2, compact3</div>"