Skip to content
Permalink
Browse files
8240476: SystemPropertiesWriter does not conform to standard page layout
Reviewed-by: prappo
  • Loading branch information
jonathan-gibbons committed Mar 19, 2020
1 parent 029fea4 commit 32cba67284efaf5fcdc9a706020013cda7b0145e
@@ -25,6 +25,7 @@
package jdk.javadoc.internal.doclets.formats.html;

import jdk.javadoc.internal.doclets.formats.html.SearchIndexItem.Category;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.FixedStringContent;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
@@ -61,11 +62,6 @@
*/
public class SystemPropertiesWriter extends HtmlDocletWriter {

/**
* The HTML tree for main tag.
*/
private final HtmlTree mainTree = HtmlTree.MAIN();

private final Navigation navBar;

/**
@@ -108,28 +104,26 @@ private static void generate(HtmlConfiguration configuration, DocPath fileName)
* Prints all the system properties to the file.
*/
protected void buildSystemPropertiesPage() throws DocFileIOException {
String label = resources.getText("doclet.systemProperties");
HtmlTree bodyTree = getBody(getWindowTitle(label));
HtmlTree header = HtmlTree.HEADER();
addTop(header);
String title = resources.getText("doclet.systemProperties");
HtmlTree body = getBody(getWindowTitle(title));
Content headerContent = new ContentBuilder();
addTop(headerContent);
navBar.setUserHeader(getUserHeaderFooter(true));
header.add(navBar.getContent(Navigation.Position.TOP));
bodyTree.add(header);
headerContent.add(navBar.getContent(Navigation.Position.TOP));
Content mainContent = new ContentBuilder();
addSystemProperties(mainContent);
Content titleContent = new StringContent(resources.getText("doclet.systemProperties"));
Content pHeading = HtmlTree.HEADING_TITLE(Headings.PAGE_TITLE_HEADING,
HtmlStyle.title, titleContent);
Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading);
mainTree.add(headerDiv);
mainTree.add(mainContent);
bodyTree.add(mainTree);
Content footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false));
footer.add(navBar.getContent(Navigation.Position.BOTTOM));
addBottom(footer);
bodyTree.add(footer);
printHtmlDocument(null, "system properties", bodyTree);
body.add(new BodyContents()
.setHeader(headerContent)
.addMainContent(HtmlTree.DIV(HtmlStyle.header,
HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
contents.getContent("doclet.systemProperties"))))
.addMainContent(mainContent)
.setFooter(footer));
printHtmlDocument(null, "system properties", body);
}

/**
@@ -23,7 +23,7 @@

/*
* @test
* @bug 8215038 8239487
* @bug 8215038 8239487 8240476
* @summary Add a page that lists all system properties
* @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -65,6 +65,15 @@ public void test(Path base) throws Exception {
"<a href=\"system-properties.html\">System Properties</a>");

checkOutput("system-properties.html", true,
"<div class=\"flex-box\">\n" +
"<header role=\"banner\" class=\"flex-header\">",

"<div class=\"flex-content\">\n" +
"<main role=\"main\">\n" +
"<div class=\"header\">\n" +
"<h1>System Properties</h1>\n" +
"</div>",

"<table>\n" +
"<caption><span>System Properties Summary</span><span class=\"tab-end\">&nbsp;</span></caption>\n" +
"<thead>\n" +

0 comments on commit 32cba67

Please sign in to comment.