8168688: javadoc top left frame should display all modules while in module mode

Reviewed-by: jjg
This commit is contained in:
Bhavesh Patel 2016-12-08 12:46:59 -08:00
parent 34c791a6a4
commit b5d8b0b991
2 changed files with 37 additions and 4 deletions

View File

@ -117,18 +117,30 @@ public class FrameOutputWriter extends HtmlDocletWriter {
HtmlTree rightContainerDiv = new HtmlTree(HtmlTag.DIV);
leftContainerDiv.addStyle(HtmlStyle.leftContainer);
rightContainerDiv.addStyle(HtmlStyle.rightContainer);
if (noOfPackages <= 1) {
addAllClassesFrameTag(leftContainerDiv);
if (configuration.showModules && configuration.modules.size() > 1) {
addAllModulesFrameTag(leftContainerDiv);
} else if (noOfPackages > 1) {
addAllPackagesFrameTag(leftContainerDiv);
addAllClassesFrameTag(leftContainerDiv);
}
addAllClassesFrameTag(leftContainerDiv);
addClassFrameTag(rightContainerDiv);
HtmlTree mainContainer = HtmlTree.DIV(HtmlStyle.mainContainer, leftContainerDiv);
mainContainer.addContent(rightContainerDiv);
return mainContainer;
}
/**
* Add the IFRAME tag for the frame that lists all modules.
*
* @param contentTree to which the information will be added
*/
private void addAllModulesFrameTag(Content contentTree) {
HtmlTree frame = HtmlTree.IFRAME(DocPaths.MODULE_OVERVIEW_FRAME.getPath(),
"packageListFrame", configuration.getText("doclet.All_Modules"));
HtmlTree leftTop = HtmlTree.DIV(HtmlStyle.leftTop, frame);
contentTree.addContent(leftTop);
}
/**
* Add the IFRAME tag for the frame that lists all packages.
*

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363 8168766
* @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363 8168766 8168688
* @summary Test modules support in javadoc.
* @author bpatel
* @library ../lib
@ -56,6 +56,7 @@ public class TestModules extends JavadocTester {
checkModuleClickThrough(true);
checkModuleFilesAndLinks(true);
checkModulesInSearch(true);
checkOverviewFrame(true);
}
/**
@ -76,6 +77,7 @@ public class TestModules extends JavadocTester {
checkModuleClickThrough(true);
checkModuleFilesAndLinks(true);
checkModulesInSearch(true);
checkOverviewFrame(true);
}
/**
@ -92,6 +94,7 @@ public class TestModules extends JavadocTester {
checkNoDescription(true);
checkModuleLink();
checkModuleFilesAndLinks(true);
checkOverviewFrame(true);
}
/**
@ -108,6 +111,7 @@ public class TestModules extends JavadocTester {
checkHtml5NoDescription(true);
checkModuleLink();
checkModuleFilesAndLinks(true);
checkOverviewFrame(true);
}
/**
@ -123,6 +127,7 @@ public class TestModules extends JavadocTester {
checkModuleClickThrough(false);
checkModuleFilesAndLinks(false);
checkModulesInSearch(false);
checkOverviewFrame(false);
}
/**
@ -137,6 +142,7 @@ public class TestModules extends JavadocTester {
checkHtml5OverviewSummaryPackages();
checkModuleFilesAndLinks(false);
checkModulesInSearch(false);
checkOverviewFrame(false);
}
/**
@ -179,6 +185,7 @@ public class TestModules extends JavadocTester {
"testpkgmdl1");
checkExit(Exit.OK);
checkModuleFilesAndLinks(true);
checkNegatedOverviewFrame();
}
/**
@ -620,4 +627,18 @@ public class TestModules extends JavadocTester {
checkOutput("module2-summary.html", false,
"@AnnotationTypeUndocumented");
}
void checkOverviewFrame(boolean found) {
checkOutput("index.html", !found,
"<iframe src=\"overview-frame.html\" name=\"packageListFrame\" title=\"All Packages\"></iframe>");
checkOutput("index.html", found,
"<iframe src=\"module-overview-frame.html\" name=\"packageListFrame\" title=\"All Modules\"></iframe>");
}
void checkNegatedOverviewFrame() {
checkOutput("index.html", false,
"<iframe src=\"overview-frame.html\" name=\"packageListFrame\" title=\"All Packages\"></iframe>");
checkOutput("index.html", false,
"<iframe src=\"module-overview-frame.html\" name=\"packageListFrame\" title=\"All Modules\"></iframe>");
}
}