8202959: Rearrange the top and bottom navigation bar in the javadoc generated pages

Co-authored-by: Bhavesh Patel <bhavesh.x.patel@oracle.com>
Reviewed-by: darcy, jjg
This commit is contained in:
Jonathan Gibbons 2018-06-28 15:46:27 -07:00
parent 736e57146d
commit 3ae58c7fdc
16 changed files with 126 additions and 155 deletions

View file

@ -85,16 +85,13 @@ public class AllClassesFrameWriter extends HtmlDocletWriter {
* "allclasses-frame.html" file. Generate the file in the current or the
* destination directory.
*
* @param indexBuilder IndexBuilder object for all classes index.
* @param configuration the configuration for this javadoc run
* @throws DocFileIOException
*/
public static void generate(HtmlConfiguration configuration,
IndexBuilder indexBuilder) throws DocFileIOException {
if (configuration.frames) {
generate(configuration, indexBuilder, DocPaths.ALLCLASSES_FRAME, true);
generate(configuration, indexBuilder, DocPaths.ALLCLASSES_NOFRAME, false);
} else {
generate(configuration, indexBuilder, DocPaths.ALLCLASSES, false);
}
}

View file

@ -375,23 +375,6 @@ public class HelpWriter extends HtmlDocletWriter {
ul.addContent(htmlTree);
}
// All Classes
Content allclassesHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
contents.allClassesLabel);
htmlTree = (configuration.allowTag(HtmlTag.SECTION))
? HtmlTree.SECTION(allclassesHead)
: HtmlTree.LI(HtmlStyle.blockList, allclassesHead);
Content allClassesBody = contents.getContent("doclet.help.all_classes.body",
links.createLink(DocPaths.AllClasses(configuration.frames),
resources.getText("doclet.All_Classes")));
Content allclassesPara = HtmlTree.P(allClassesBody);
htmlTree.addContent(allclassesPara);
if (configuration.allowTag(HtmlTag.SECTION)) {
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
} else {
ul.addContent(htmlTree);
}
// Serialized Form
Content sHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
contents.serializedForm);

View file

@ -106,23 +106,17 @@ public class Navigation {
}
enum Position {
BOTTOM("allclasses_navbar_bottom", HtmlConstants.START_OF_BOTTOM_NAVBAR, HtmlConstants.END_OF_BOTTOM_NAVBAR),
TOP("allclasses_navbar_top", HtmlConstants.START_OF_TOP_NAVBAR, HtmlConstants.END_OF_TOP_NAVBAR);
BOTTOM(HtmlConstants.START_OF_BOTTOM_NAVBAR, HtmlConstants.END_OF_BOTTOM_NAVBAR),
TOP(HtmlConstants.START_OF_TOP_NAVBAR, HtmlConstants.END_OF_TOP_NAVBAR);
final String allClassesLinkId;
final Content startOfNav;
final Content endOfNav;
Position(String allClassesLinkId, Content startOfNav, Content endOfNav) {
this.allClassesLinkId = allClassesLinkId;
Position(Content startOfNav, Content endOfNav) {
this.startOfNav = startOfNav;
this.endOfNav = endOfNav;
}
String allClassesLinkId() {
return allClassesLinkId;
}
Content startOfNav() {
return startOfNav;
}
@ -130,20 +124,6 @@ public class Navigation {
Content endOfNav() {
return endOfNav;
}
Script allClassesLinkScript() {
return new Script("<!--\n"
+ " allClassesLink = document.getElementById(")
.appendStringLiteral(allClassesLinkId)
.append(");\n"
+ " if(window==top) {\n"
+ " allClassesLink.style.display = \"block\";\n"
+ " }\n"
+ " else {\n"
+ " allClassesLink.style.display = \"none\";\n"
+ " }\n"
+ " //-->\n");
}
}
/**
@ -971,13 +951,6 @@ public class Navigation {
tree.addContent(HtmlTree.LI(noFramesContent));
}
private void addNavLinkClassIndex(Content tree) {
Content allClassesContent = links.createLink(pathToRoot.resolve(
DocPaths.AllClasses(configuration.frames)),
contents.allClassesLabel, "", "");
tree.addContent(HtmlTree.LI(allClassesContent));
}
private void addSearch(Content tree) {
String searchValueId = "search";
String reset = "reset";
@ -990,16 +963,6 @@ public class Navigation {
tree.addContent(ulSearch);
}
private void addAllClassesLinkScript(Content tree, boolean top) {
Content div = HtmlTree.DIV(top
? Position.TOP.allClassesLinkScript().asContent()
: Position.BOTTOM.allClassesLinkScript().asContent());
Content div_noscript = HtmlTree.DIV(contents.noScriptMessage);
Content noScript = HtmlTree.NOSCRIPT(div_noscript);
div.addContent(noScript);
tree.addContent(div);
}
private void addFixedNavScript(Content tree) {
tree.addContent(FIXED_NAV_SCRIPT.asContent());
}
@ -1046,26 +1009,6 @@ public class Navigation {
}
HtmlTree subDiv = new HtmlTree(HtmlTag.DIV);
subDiv.setStyle(HtmlStyle.subNav);
HtmlTree ulFrames = new HtmlTree(HtmlTag.UL);
ulFrames.setStyle(HtmlStyle.navList);
if (!configuration.nonavbar) {
if (configuration.frames) {
addNavShowLists(ulFrames);
addNavHideLists(ulFrames);
}
}
subDiv.addContent(ulFrames);
HtmlTree ulAllClasses = new HtmlTree(HtmlTag.UL);
ulAllClasses.setStyle(HtmlStyle.navList);
ulAllClasses.addAttr(HtmlAttr.ID, top
? Position.TOP.allClassesLinkId()
: Position.BOTTOM.allClassesLinkId());
addNavLinkClassIndex(ulAllClasses);
subDiv.addContent(ulAllClasses);
if (top && configuration.createindex) {
addSearch(subDiv);
}
addAllClassesLinkScript(subDiv, top);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
// Add the summary links if present.
HtmlTree ulNavSummary = new HtmlTree(HtmlTag.UL);
@ -1077,10 +1020,22 @@ public class Navigation {
ulNavDetail.setStyle(HtmlStyle.subNavList);
addDetailLinks(ulNavDetail);
div.addContent(ulNavDetail);
HtmlTree ulFrames = new HtmlTree(HtmlTag.UL);
ulFrames.setStyle(HtmlStyle.navList);
if (!configuration.nonavbar) {
if (configuration.frames) {
addNavShowLists(ulFrames);
addNavHideLists(ulFrames);
}
}
div.addContent(ulFrames);
subDiv.addContent(div);
subDiv.addContent(queue.poll());
if (top && configuration.createindex) {
addSearch(subDiv);
}
if (top) {
fixedNavDiv.addContent(subDiv);
fixedNavDiv.addContent(queue.poll());
fixedNavDiv.addContent(Position.TOP.endOfNav());
tree.addContent(fixedNavDiv);
HtmlTree paddingDiv = HtmlTree.DIV(HtmlStyle.navPadding, Contents.SPACE);
@ -1088,6 +1043,7 @@ public class Navigation {
addFixedNavScript(tree);
} else {
tree.addContent(subDiv);
tree.addContent(queue.poll());
tree.addContent(Position.BOTTOM.endOfNav());
}
return tree;

View file

@ -168,8 +168,6 @@ doclet.help.frames.head=\
Frames/No Frames
doclet.help.frames.body=\
These links show and hide the HTML frames. All pages are available with or without frames.
doclet.help.all_classes.body=\
The {0} link shows all classes and interfaces except non-static nested types.
doclet.help.serial_form.body=\
Each serializable or externalizable class has a description of its serialization fields and \
methods. This information is of interest to re-implementors, not to developers using the API. \

View file

@ -191,6 +191,9 @@ sup {
padding:0 0 5px 6px;
text-transform:uppercase;
}
.subNav .navList {
padding-top:5px;
}
ul.navList, ul.subNavList {
float:left;
margin:0 25px 0 0;
@ -220,6 +223,7 @@ ul.navListSearch li label {
ul.subNavList li {
list-style:none;
float:left;
padding-top:10px;
}
.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
color:#FFFFFF;
@ -784,6 +788,7 @@ ul.ui-autocomplete li {
padding-left:20px;
position:relative;
right:-18px;
width:400px;
}
#reset {
background-color: rgb(255,255,255);