mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8210047: some pages contain content outside of landmark region
Reviewed-by: jjg
This commit is contained in:
parent
1619cbd14b
commit
a17816f881
12 changed files with 407 additions and 222 deletions
|
@ -33,6 +33,7 @@ import java.util.SortedMap;
|
|||
import javax.lang.model.element.ModuleElement;
|
||||
import javax.lang.model.element.PackageElement;
|
||||
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
|
@ -81,30 +82,30 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
|
|||
/**
|
||||
* Adds the navigation bar header to the documentation tree.
|
||||
*
|
||||
* @param body the document tree to which the navigation bar header will be added
|
||||
* @param header the document tree to which the navigation bar header will be added
|
||||
*/
|
||||
protected abstract void addNavigationBarHeader(Content body);
|
||||
protected abstract void addNavigationBarHeader(Content header);
|
||||
|
||||
/**
|
||||
* Adds the navigation bar footer to the documentation tree.
|
||||
*
|
||||
* @param body the document tree to which the navigation bar footer will be added
|
||||
* @param footer the document tree to which the navigation bar footer will be added
|
||||
*/
|
||||
protected abstract void addNavigationBarFooter(Content body);
|
||||
protected abstract void addNavigationBarFooter(Content footer);
|
||||
|
||||
/**
|
||||
* Adds the overview header to the documentation tree.
|
||||
*
|
||||
* @param body the document tree to which the overview header will be added
|
||||
* @param main the document tree to which the overview header will be added
|
||||
*/
|
||||
protected abstract void addOverviewHeader(Content body);
|
||||
protected abstract void addOverviewHeader(Content main);
|
||||
|
||||
/**
|
||||
* Adds the modules list to the documentation tree.
|
||||
*
|
||||
* @param body the document tree to which the modules list will be added
|
||||
* @param main the document tree to which the modules list will be added
|
||||
*/
|
||||
protected abstract void addModulesList(Content body);
|
||||
protected abstract void addModulesList(Content main);
|
||||
|
||||
/**
|
||||
* Adds the module packages list to the documentation tree.
|
||||
|
@ -112,11 +113,11 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
|
|||
* @param modules the set of modules
|
||||
* @param text caption for the table
|
||||
* @param tableSummary summary for the table
|
||||
* @param body the document tree to which the modules list will be added
|
||||
* @param main the document tree to which the modules list will be added
|
||||
* @param mdle the module being documented
|
||||
*/
|
||||
protected abstract void addModulePackagesList(Map<ModuleElement, Set<PackageElement>> modules, String text,
|
||||
String tableSummary, Content body, ModuleElement mdle);
|
||||
String tableSummary, Content main, ModuleElement mdle);
|
||||
|
||||
/**
|
||||
* Generate and prints the contents in the module index file. Call appropriate
|
||||
|
@ -130,11 +131,17 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
|
|||
protected void buildModuleIndexFile(String title, boolean includeScript) throws DocFileIOException {
|
||||
String windowOverview = configuration.getText(title);
|
||||
Content body = getBody(includeScript, getWindowTitle(windowOverview));
|
||||
addNavigationBarHeader(body);
|
||||
addOverviewHeader(body);
|
||||
addIndex(body);
|
||||
addOverview(body);
|
||||
addNavigationBarFooter(body);
|
||||
Content header = createTagIfAllowed(HtmlTag.HEADER, HtmlTree::HEADER, ContentBuilder::new);
|
||||
addNavigationBarHeader(header);
|
||||
Content main = createTagIfAllowed(HtmlTag.MAIN, HtmlTree::MAIN, ContentBuilder::new);
|
||||
addOverviewHeader(main);
|
||||
addIndex(header, main);
|
||||
addOverview(main);
|
||||
Content footer = createTagIfAllowed(HtmlTag.FOOTER, HtmlTree::FOOTER, ContentBuilder::new);
|
||||
addNavigationBarFooter(footer);
|
||||
body.addContent(header);
|
||||
body.addContent(main);
|
||||
body.addContent(footer);
|
||||
printHtmlDocument(configuration.metakeywords.getOverviewMetaKeywords(title,
|
||||
configuration.doctitle), includeScript, body);
|
||||
}
|
||||
|
@ -153,11 +160,17 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
|
|||
boolean includeScript, ModuleElement mdle) throws DocFileIOException {
|
||||
String windowOverview = configuration.getText(title);
|
||||
Content body = getBody(includeScript, getWindowTitle(windowOverview));
|
||||
addNavigationBarHeader(body);
|
||||
addOverviewHeader(body);
|
||||
addModulePackagesIndex(body, mdle);
|
||||
addOverview(body);
|
||||
addNavigationBarFooter(body);
|
||||
Content header = createTagIfAllowed(HtmlTag.HEADER, HtmlTree::HEADER, ContentBuilder::new);
|
||||
addNavigationBarHeader(header);
|
||||
Content main = createTagIfAllowed(HtmlTag.MAIN, HtmlTree::MAIN, ContentBuilder::new);
|
||||
addOverviewHeader(main);
|
||||
addModulePackagesIndex(header, main, mdle);
|
||||
addOverview(main);
|
||||
Content footer = createTagIfAllowed(HtmlTag.FOOTER, HtmlTree::FOOTER, ContentBuilder::new);
|
||||
addNavigationBarFooter(footer);
|
||||
body.addContent(header);
|
||||
body.addContent(main);
|
||||
body.addContent(footer);
|
||||
printHtmlDocument(configuration.metakeywords.getOverviewMetaKeywords(title,
|
||||
configuration.doctitle), includeScript, body);
|
||||
}
|
||||
|
@ -165,33 +178,35 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
|
|||
/**
|
||||
* Default to no overview, override to add overview.
|
||||
*
|
||||
* @param body the document tree to which the overview will be added
|
||||
* @param main the document tree to which the overview will be added
|
||||
*/
|
||||
protected void addOverview(Content body) { }
|
||||
protected void addOverview(Content main) { }
|
||||
|
||||
/**
|
||||
* Adds the frame or non-frame module index to the documentation tree.
|
||||
*
|
||||
* @param body the document tree to which the index will be added
|
||||
* @param header the document tree to which the navigational links will be added
|
||||
* @param main the document tree to which the modules list will be added
|
||||
*/
|
||||
protected void addIndex(Content body) {
|
||||
protected void addIndex(Content header, Content main) {
|
||||
addIndexContents(configuration.modules, "doclet.Module_Summary",
|
||||
configuration.getText("doclet.Member_Table_Summary",
|
||||
configuration.getText("doclet.Module_Summary"),
|
||||
configuration.getText("doclet.modules")), body);
|
||||
configuration.getText("doclet.modules")), header, main);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the frame or non-frame module packages index to the documentation tree.
|
||||
*
|
||||
* @param body the document tree to which the index will be added
|
||||
* @param header the document tree to which the navigational links will be added
|
||||
* @param main the document tree to which the module packages list will be added
|
||||
* @param mdle the module being documented
|
||||
*/
|
||||
protected void addModulePackagesIndex(Content body, ModuleElement mdle) {
|
||||
protected void addModulePackagesIndex(Content header, Content main, ModuleElement mdle) {
|
||||
addModulePackagesIndexContents("doclet.Module_Summary",
|
||||
configuration.getText("doclet.Member_Table_Summary",
|
||||
configuration.getText("doclet.Module_Summary"),
|
||||
configuration.getText("doclet.modules")), body, mdle);
|
||||
configuration.getText("doclet.modules")), header, main, mdle);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -201,20 +216,19 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
|
|||
* @param modules the modules to be documented
|
||||
* @param text string which will be used as the heading
|
||||
* @param tableSummary summary for the table
|
||||
* @param body the document tree to which the index contents will be added
|
||||
* @param header the document tree to which the navgational links will be added
|
||||
* @param main the document tree to which the modules list will be added
|
||||
*/
|
||||
protected void addIndexContents(Collection<ModuleElement> modules, String text,
|
||||
String tableSummary, Content body) {
|
||||
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.NAV))
|
||||
? HtmlTree.NAV()
|
||||
: new HtmlTree(HtmlTag.DIV);
|
||||
String tableSummary, Content header, Content main) {
|
||||
HtmlTree htmlTree = (HtmlTree)createTagIfAllowed(HtmlTag.NAV, HtmlTree::NAV, () -> new HtmlTree(HtmlTag.DIV));
|
||||
htmlTree.setStyle(HtmlStyle.indexNav);
|
||||
HtmlTree ul = new HtmlTree(HtmlTag.UL);
|
||||
addAllClassesLink(ul);
|
||||
addAllPackagesLink(ul);
|
||||
htmlTree.addContent(ul);
|
||||
body.addContent(htmlTree);
|
||||
addModulesList(body);
|
||||
header.addContent(htmlTree);
|
||||
addModulesList(main);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -223,22 +237,21 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
|
|||
*
|
||||
* @param text string which will be used as the heading
|
||||
* @param tableSummary summary for the table
|
||||
* @param body the document tree to which the index contents will be added
|
||||
* @param header the document tree to which the navigational links will be added
|
||||
* @param main the document tree to which the module packages list will be added
|
||||
* @param mdle the module being documented
|
||||
*/
|
||||
protected void addModulePackagesIndexContents(String text,
|
||||
String tableSummary, Content body, ModuleElement mdle) {
|
||||
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.NAV))
|
||||
? HtmlTree.NAV()
|
||||
: new HtmlTree(HtmlTag.DIV);
|
||||
String tableSummary, Content header, Content main, ModuleElement mdle) {
|
||||
HtmlTree htmlTree = (HtmlTree)createTagIfAllowed(HtmlTag.NAV, HtmlTree::NAV, () -> new HtmlTree(HtmlTag.DIV));
|
||||
htmlTree.setStyle(HtmlStyle.indexNav);
|
||||
HtmlTree ul = new HtmlTree(HtmlTag.UL);
|
||||
addAllClassesLink(ul);
|
||||
addAllPackagesLink(ul);
|
||||
addAllModulesLink(ul);
|
||||
htmlTree.addContent(ul);
|
||||
body.addContent(htmlTree);
|
||||
addModulePackagesList(modules, text, tableSummary, body, mdle);
|
||||
header.addContent(htmlTree);
|
||||
addModulePackagesList(modules, text, tableSummary, main, mdle);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,7 @@ import java.util.*;
|
|||
|
||||
import javax.lang.model.element.PackageElement;
|
||||
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
|
@ -78,9 +79,9 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
|
|||
/**
|
||||
* Adds the navigation bar header to the documentation tree.
|
||||
*
|
||||
* @param body the document tree to which the navigation bar header will be added
|
||||
* @param header the document tree to which the navigation bar header will be added
|
||||
*/
|
||||
protected abstract void addNavigationBarHeader(Content body);
|
||||
protected abstract void addNavigationBarHeader(Content header);
|
||||
|
||||
/**
|
||||
* Adds the navigation bar footer to the documentation tree.
|
||||
|
@ -92,16 +93,16 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
|
|||
/**
|
||||
* Adds the overview header to the documentation tree.
|
||||
*
|
||||
* @param body the document tree to which the overview header will be added
|
||||
* @param footer the document tree to which the overview header will be added
|
||||
*/
|
||||
protected abstract void addOverviewHeader(Content body);
|
||||
protected abstract void addOverviewHeader(Content footer);
|
||||
|
||||
/**
|
||||
* Adds the packages list to the documentation tree.
|
||||
*
|
||||
* @param body the document tree to which the packages list will be added
|
||||
* @param main the document tree to which the packages list will be added
|
||||
*/
|
||||
protected abstract void addPackagesList(Content body);
|
||||
protected abstract void addPackagesList(Content main);
|
||||
|
||||
/**
|
||||
* Generate and prints the contents in the package index file. Call appropriate
|
||||
|
@ -115,11 +116,17 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
|
|||
protected void buildPackageIndexFile(String title, boolean includeScript) throws DocFileIOException {
|
||||
String windowOverview = configuration.getText(title);
|
||||
Content body = getBody(includeScript, getWindowTitle(windowOverview));
|
||||
addNavigationBarHeader(body);
|
||||
addOverviewHeader(body);
|
||||
addIndex(body);
|
||||
addOverview(body);
|
||||
addNavigationBarFooter(body);
|
||||
Content header = createTagIfAllowed(HtmlTag.HEADER, HtmlTree::HEADER, ContentBuilder::new);
|
||||
addNavigationBarHeader(header);
|
||||
Content main = createTagIfAllowed(HtmlTag.MAIN, HtmlTree::MAIN, ContentBuilder::new);
|
||||
addOverviewHeader(main);
|
||||
addIndex(header, main);
|
||||
addOverview(main);
|
||||
Content footer = createTagIfAllowed(HtmlTag.FOOTER, HtmlTree::FOOTER, ContentBuilder::new);
|
||||
addNavigationBarFooter(footer);
|
||||
body.addContent(header);
|
||||
body.addContent(main);
|
||||
body.addContent(footer);
|
||||
printHtmlDocument(configuration.metakeywords.getOverviewMetaKeywords(title,
|
||||
configuration.doctitle), includeScript, body);
|
||||
}
|
||||
|
@ -127,30 +134,30 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
|
|||
/**
|
||||
* Default to no overview, override to add overview.
|
||||
*
|
||||
* @param body the document tree to which the overview will be added
|
||||
* @param main the document tree to which the overview will be added
|
||||
*/
|
||||
protected void addOverview(Content body) { }
|
||||
protected void addOverview(Content main) { }
|
||||
|
||||
/**
|
||||
* Adds the frame or non-frame package index to the documentation tree.
|
||||
*
|
||||
* @param body the document tree to which the index will be added
|
||||
* @param header the document tree to which the navigation links will be added
|
||||
* @param main the document tree to which the packages list will be added
|
||||
*/
|
||||
protected void addIndex(Content body) {
|
||||
addIndexContents(body);
|
||||
protected void addIndex(Content header, Content main) {
|
||||
addIndexContents(header, main);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds package index contents. Call appropriate methods from
|
||||
* the sub-classes. Adds it to the body HtmlTree
|
||||
*
|
||||
* @param body the document tree to which the index contents will be added
|
||||
* @param header the document tree to which navigation links will be added
|
||||
* @param main the document tree to which the packages list will be added
|
||||
*/
|
||||
protected void addIndexContents(Content body) {
|
||||
protected void addIndexContents(Content header, Content main) {
|
||||
if (!packages.isEmpty()) {
|
||||
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.NAV))
|
||||
? HtmlTree.NAV()
|
||||
: new HtmlTree(HtmlTag.DIV);
|
||||
HtmlTree htmlTree = (HtmlTree)createTagIfAllowed(HtmlTag.NAV, HtmlTree::NAV, () -> new HtmlTree(HtmlTag.DIV));
|
||||
htmlTree.setStyle(HtmlStyle.indexNav);
|
||||
HtmlTree ul = new HtmlTree(HtmlTag.UL);
|
||||
addAllClassesLink(ul);
|
||||
|
@ -158,8 +165,8 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
|
|||
addAllModulesLink(ul);
|
||||
}
|
||||
htmlTree.addContent(ul);
|
||||
body.addContent(htmlTree);
|
||||
addPackagesList(body);
|
||||
header.addContent(htmlTree);
|
||||
addPackagesList(main);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ package jdk.javadoc.internal.doclets.formats.html;
|
|||
import javax.lang.model.element.Element;
|
||||
import javax.lang.model.element.TypeElement;
|
||||
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
|
||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
||||
|
@ -111,15 +112,15 @@ public class AllClassesFrameWriter extends HtmlDocletWriter {
|
|||
protected void buildAllClassesFile(boolean wantFrames) throws DocFileIOException {
|
||||
String label = configuration.getText("doclet.All_Classes");
|
||||
Content body = getBody(false, getWindowTitle(label));
|
||||
Content htmlTree = createTagIfAllowed(HtmlTag.MAIN, HtmlTree::MAIN, ContentBuilder::new);
|
||||
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING,
|
||||
HtmlStyle.bar, contents.allClassesLabel);
|
||||
body.addContent(heading);
|
||||
htmlTree.addContent(heading);
|
||||
Content ul = new HtmlTree(HtmlTag.UL);
|
||||
// Generate the class links and add it to the tdFont tree.
|
||||
addAllClasses(ul, wantFrames);
|
||||
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
|
||||
? HtmlTree.MAIN(HtmlStyle.indexContainer, ul)
|
||||
: HtmlTree.DIV(HtmlStyle.indexContainer, ul);
|
||||
HtmlTree div = HtmlTree.DIV(HtmlStyle.indexContainer, ul);
|
||||
htmlTree.addContent(div);
|
||||
body.addContent(htmlTree);
|
||||
printHtmlDocument(null, false, body);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import jdk.javadoc.internal.doclets.formats.html.markup.Head;
|
|||
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@ -2105,4 +2106,20 @@ public class HtmlDocletWriter {
|
|||
Script getMainBodyScript() {
|
||||
return mainBodyScript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the HTML tag if the tag is supported by this specific HTML version
|
||||
* otherwise return the Content instance provided by Supplier ifNotSupported.
|
||||
* @param tag the HTML tag
|
||||
* @param ifSupported create this instance if HTML tag is supported
|
||||
* @param ifNotSupported create this instance if HTML tag is not supported
|
||||
* @return
|
||||
*/
|
||||
protected Content createTagIfAllowed(HtmlTag tag, Supplier<Content> ifSupported, Supplier<Content> ifNotSupported) {
|
||||
if (configuration.allowTag(tag)) {
|
||||
return ifSupported.get();
|
||||
} else {
|
||||
return ifNotSupported.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,19 +83,17 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected void addModulesList(Content body) {
|
||||
protected void addModulesList(Content main) {
|
||||
Content heading = HtmlTree.HEADING(HtmlConstants.MODULE_HEADING, true,
|
||||
contents.modulesLabel);
|
||||
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
|
||||
? HtmlTree.MAIN(HtmlStyle.indexContainer, heading)
|
||||
: HtmlTree.DIV(HtmlStyle.indexContainer, heading);
|
||||
HtmlTree htmlTree = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
|
||||
HtmlTree ul = new HtmlTree(HtmlTag.UL);
|
||||
ul.setTitle(contents.modulesLabel);
|
||||
for (ModuleElement mdle: configuration.modules) {
|
||||
ul.addContent(getModuleLink(mdle));
|
||||
}
|
||||
htmlTree.addContent(ul);
|
||||
body.addContent(htmlTree);
|
||||
main.addContent(htmlTree);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -126,7 +124,7 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected void addNavigationBarHeader(Content body) {
|
||||
protected void addNavigationBarHeader(Content header) {
|
||||
Content headerContent;
|
||||
if (configuration.packagesheader.length() > 0) {
|
||||
headerContent = new RawHtml(replaceDocRootDir(configuration.packagesheader));
|
||||
|
@ -135,7 +133,7 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
|
|||
}
|
||||
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
|
||||
HtmlStyle.bar, headerContent);
|
||||
body.addContent(heading);
|
||||
header.addContent(heading);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -173,12 +171,12 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected void addNavigationBarFooter(Content body) {
|
||||
protected void addNavigationBarFooter(Content footer) {
|
||||
Content p = HtmlTree.P(Contents.SPACE);
|
||||
body.addContent(p);
|
||||
footer.addContent(p);
|
||||
}
|
||||
|
||||
protected void addModulePackagesList(Map<ModuleElement, Set<PackageElement>> modules, String text,
|
||||
String tableSummary, Content body, ModuleElement mdle) {
|
||||
String tableSummary, Content main, ModuleElement mdle) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,11 +56,6 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
|
|||
*/
|
||||
public class ModuleIndexWriter extends AbstractModuleIndexWriter {
|
||||
|
||||
/**
|
||||
* HTML tree for main tag.
|
||||
*/
|
||||
private final HtmlTree htmlTree = HtmlTree.MAIN();
|
||||
|
||||
/**
|
||||
* Construct the ModuleIndexWriter.
|
||||
* @param configuration the configuration object
|
||||
|
@ -85,22 +80,22 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
|
|||
/**
|
||||
* Add the module index.
|
||||
*
|
||||
* @param body the documentation tree to which the index will be added
|
||||
* @param header the documentation tree to which the navigational links will be added
|
||||
* @param main the documentation tree to which the modules list will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addIndex(Content body) {
|
||||
addIndexContents(body);
|
||||
protected void addIndex(Content header, Content main) {
|
||||
addIndexContents(header, main);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds module index contents.
|
||||
*
|
||||
* @param body the document tree to which the index contents will be added
|
||||
* @param header the document tree to which the navigational links will be added
|
||||
* @param main the document tree to which the modules list will be added
|
||||
*/
|
||||
protected void addIndexContents(Content body) {
|
||||
HtmlTree htmltree = (configuration.allowTag(HtmlTag.NAV))
|
||||
? HtmlTree.NAV()
|
||||
: new HtmlTree(HtmlTag.DIV);
|
||||
protected void addIndexContents(Content header, Content main) {
|
||||
HtmlTree htmltree = (HtmlTree)createTagIfAllowed(HtmlTag.NAV, HtmlTree::NAV, () -> new HtmlTree(HtmlTag.DIV));
|
||||
htmltree.setStyle(HtmlStyle.indexNav);
|
||||
HtmlTree ul = new HtmlTree(HtmlTag.UL);
|
||||
addAllClassesLink(ul);
|
||||
|
@ -108,17 +103,17 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
|
|||
addAllModulesLink(ul);
|
||||
}
|
||||
htmltree.addContent(ul);
|
||||
body.addContent(htmltree);
|
||||
addModulesList(body);
|
||||
header.addContent(htmltree);
|
||||
addModulesList(main);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the list of modules.
|
||||
*
|
||||
* @param body the content tree to which the module list will be added
|
||||
* @param main the content tree to which the module list will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addModulesList(Content body) {
|
||||
protected void addModulesList(Content main) {
|
||||
Map<String, SortedSet<ModuleElement>> groupModuleMap
|
||||
= configuration.group.groupModules(configuration.modules);
|
||||
|
||||
|
@ -154,11 +149,7 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
|
|||
}
|
||||
|
||||
Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table.toContent());
|
||||
if (configuration.allowTag(HtmlTag.MAIN)) {
|
||||
htmlTree.addContent(div);
|
||||
} else {
|
||||
body.addContent(div);
|
||||
}
|
||||
main.addContent(div);
|
||||
|
||||
if (table.needsScript()) {
|
||||
mainBodyScript.append(table.getScript());
|
||||
|
@ -171,20 +162,16 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
|
|||
* summary at the top of the page and generate a link to the description,
|
||||
* which is added at the end of this page.
|
||||
*
|
||||
* @param body the documentation tree to which the overview header will be added
|
||||
* @param main the documentation tree to which the overview header will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addOverviewHeader(Content body) {
|
||||
addConfigurationTitle(body);
|
||||
protected void addOverviewHeader(Content main) {
|
||||
addConfigurationTitle(main);
|
||||
if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
|
||||
HtmlTree div = new HtmlTree(HtmlTag.DIV);
|
||||
div.setStyle(HtmlStyle.contentContainer);
|
||||
addOverviewComment(div);
|
||||
if (configuration.allowTag(HtmlTag.MAIN)) {
|
||||
htmlTree.addContent(div);
|
||||
} else {
|
||||
body.addContent(div);
|
||||
}
|
||||
main.addContent(div);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,59 +188,35 @@ public class ModuleIndexWriter extends AbstractModuleIndexWriter {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For HTML 5, add the htmlTree to the body. For HTML 4, do nothing.
|
||||
*
|
||||
* @param body the documentation tree to which the overview will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addOverview(Content body) {
|
||||
if (configuration.allowTag(HtmlTag.MAIN)) {
|
||||
body.addContent(htmlTree);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the top text (from the -top option), the upper
|
||||
* navigation bar, and then the title (from the"-title"
|
||||
* option), at the top of page.
|
||||
*
|
||||
* @param body the documentation tree to which the navigation bar header will be added
|
||||
* @param header the documentation tree to which the navigation bar header will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addNavigationBarHeader(Content body) {
|
||||
Content tree = (configuration.allowTag(HtmlTag.HEADER))
|
||||
? HtmlTree.HEADER()
|
||||
: body;
|
||||
addTop(tree);
|
||||
protected void addNavigationBarHeader(Content header) {
|
||||
addTop(header);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
tree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
body.addContent(tree);
|
||||
}
|
||||
header.addContent(navBar.getContent(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the lower navigation bar and the bottom text
|
||||
* (from the -bottom option) at the bottom of page.
|
||||
*
|
||||
* @param body the documentation tree to which the navigation bar footer will be added
|
||||
* @param footer the documentation tree to which the navigation bar footer will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addNavigationBarFooter(Content body) {
|
||||
Content htmltree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: body;
|
||||
protected void addNavigationBarFooter(Content footer) {
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
htmltree.addContent(navBar.getContent(false));
|
||||
addBottom(htmltree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
body.addContent(htmltree);
|
||||
}
|
||||
footer.addContent(navBar.getContent(false));
|
||||
addBottom(footer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addModulePackagesList(Map<ModuleElement, Set<PackageElement>> modules, String text,
|
||||
String tableSummary, Content body, ModuleElement mdle) {
|
||||
String tableSummary, Content main, ModuleElement mdle) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,15 +84,13 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
protected void addModulePackagesList(Map<ModuleElement, Set<PackageElement>> modules, String text,
|
||||
String tableSummary, Content body, ModuleElement mdle) {
|
||||
String tableSummary, Content main, ModuleElement mdle) {
|
||||
Content profNameContent = new StringContent(mdle.getQualifiedName().toString());
|
||||
Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
|
||||
getTargetModuleLink("classFrame", profNameContent, mdle));
|
||||
heading.addContent(Contents.SPACE);
|
||||
heading.addContent(contents.packagesLabel);
|
||||
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
|
||||
? HtmlTree.MAIN(HtmlStyle.indexContainer, heading)
|
||||
: HtmlTree.DIV(HtmlStyle.indexContainer, heading);
|
||||
HtmlTree htmlTree = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
|
||||
HtmlTree ul = new HtmlTree(HtmlTag.UL);
|
||||
ul.setTitle(contents.packagesLabel);
|
||||
List<PackageElement> packages = new ArrayList<>(modules.get(mdle));
|
||||
|
@ -102,7 +100,7 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
|
|||
}
|
||||
}
|
||||
htmlTree.addContent(ul);
|
||||
body.addContent(htmlTree);
|
||||
main.addContent(htmlTree);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -157,7 +155,7 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected void addNavigationBarHeader(Content body) {
|
||||
protected void addNavigationBarHeader(Content header) {
|
||||
Content headerContent;
|
||||
if (configuration.packagesheader.length() > 0) {
|
||||
headerContent = new RawHtml(replaceDocRootDir(configuration.packagesheader));
|
||||
|
@ -166,7 +164,7 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
|
|||
}
|
||||
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
|
||||
HtmlStyle.bar, headerContent);
|
||||
body.addContent(heading);
|
||||
header.addContent(heading);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -232,8 +230,8 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
protected void addNavigationBarFooter(Content body) {
|
||||
protected void addNavigationBarFooter(Content footer) {
|
||||
Content p = HtmlTree.P(Contents.SPACE);
|
||||
body.addContent(p);
|
||||
footer.addContent(p);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,12 +77,10 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void addPackagesList(Content body) {
|
||||
protected void addPackagesList(Content main) {
|
||||
Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
|
||||
contents.packagesLabel);
|
||||
HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
|
||||
? HtmlTree.MAIN(HtmlStyle.indexContainer, heading)
|
||||
: HtmlTree.DIV(HtmlStyle.indexContainer, heading);
|
||||
HtmlTree htmlTree = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
|
||||
HtmlTree ul = new HtmlTree(HtmlTag.UL);
|
||||
ul.setTitle(contents.packagesLabel);
|
||||
for (PackageElement aPackage : packages) {
|
||||
|
@ -94,7 +92,7 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
|
|||
}
|
||||
}
|
||||
htmlTree.addContent(ul);
|
||||
body.addContent(htmlTree);
|
||||
main.addContent(htmlTree);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -124,7 +122,7 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void addNavigationBarHeader(Content body) {
|
||||
protected void addNavigationBarHeader(Content header) {
|
||||
Content headerContent;
|
||||
if (configuration.packagesheader.length() > 0) {
|
||||
headerContent = new RawHtml(replaceDocRootDir(configuration.packagesheader));
|
||||
|
@ -133,7 +131,7 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
|
|||
}
|
||||
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
|
||||
HtmlStyle.bar, headerContent);
|
||||
body.addContent(heading);
|
||||
header.addContent(heading);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -175,8 +173,8 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void addNavigationBarFooter(Content body) {
|
||||
protected void addNavigationBarFooter(Content footer) {
|
||||
Content p = HtmlTree.P(Contents.SPACE);
|
||||
body.addContent(p);
|
||||
footer.addContent(p);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,11 +56,6 @@ import jdk.javadoc.internal.doclets.toolkit.util.Group;
|
|||
*/
|
||||
public class PackageIndexWriter extends AbstractPackageIndexWriter {
|
||||
|
||||
/**
|
||||
* HTML tree for main tag.
|
||||
*/
|
||||
private final HtmlTree htmlTree = HtmlTree.MAIN();
|
||||
|
||||
/**
|
||||
* Construct the PackageIndexWriter. Also constructs the grouping
|
||||
* information as provided on the command line by "-group" option. Stores
|
||||
|
@ -90,18 +85,19 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
|
|||
* Depending upon the grouping information and their titles, add
|
||||
* separate table indices for each package group.
|
||||
*
|
||||
* @param body the documentation tree to which the index will be added
|
||||
* @param header the documentation tree to which the navigational links will be added
|
||||
* @param main the documentation tree to which the packages list will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addIndex(Content body) {
|
||||
addIndexContents(body);
|
||||
protected void addIndex(Content header, Content main) {
|
||||
addIndexContents(header, main);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void addPackagesList(Content body) {
|
||||
protected void addPackagesList(Content main) {
|
||||
Map<String, SortedSet<PackageElement>> groupPackageMap
|
||||
= configuration.group.groupPackages(packages);
|
||||
|
||||
|
@ -136,11 +132,7 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
|
|||
}
|
||||
|
||||
Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table.toContent());
|
||||
if (configuration.allowTag(HtmlTag.MAIN)) {
|
||||
htmlTree.addContent(div);
|
||||
} else {
|
||||
body.addContent(div);
|
||||
}
|
||||
main.addContent(div);
|
||||
|
||||
if (table.needsScript()) {
|
||||
getMainBodyScript().append(table.getScript());
|
||||
|
@ -153,20 +145,16 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
|
|||
* summary at the top of the page and generate a link to the description,
|
||||
* which is added at the end of this page.
|
||||
*
|
||||
* @param body the documentation tree to which the overview header will be added
|
||||
* @param main the documentation tree to which the overview header will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addOverviewHeader(Content body) {
|
||||
addConfigurationTitle(body);
|
||||
protected void addOverviewHeader(Content main) {
|
||||
addConfigurationTitle(main);
|
||||
if (!utils.getFullBody(configuration.overviewElement).isEmpty()) {
|
||||
HtmlTree div = new HtmlTree(HtmlTag.DIV);
|
||||
div.setStyle(HtmlStyle.contentContainer);
|
||||
addOverviewComment(div);
|
||||
if (configuration.allowTag(HtmlTag.MAIN)) {
|
||||
htmlTree.addContent(div);
|
||||
} else {
|
||||
body.addContent(div);
|
||||
}
|
||||
main.addContent(div);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -183,54 +171,30 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For HTML 5, add the htmlTree to the body. For HTML 4, do nothing.
|
||||
*
|
||||
* @param body the documentation tree to which the overview will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addOverview(Content body) {
|
||||
if (configuration.allowTag(HtmlTag.MAIN)) {
|
||||
body.addContent(htmlTree);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the top text (from the -top option), the upper
|
||||
* navigation bar, and then the title (from the"-title"
|
||||
* option), at the top of page.
|
||||
*
|
||||
* @param body the documentation tree to which the navigation bar header will be added
|
||||
* @param header the documentation tree to which the navigation bar header will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addNavigationBarHeader(Content body) {
|
||||
Content tree = (configuration.allowTag(HtmlTag.HEADER))
|
||||
? HtmlTree.HEADER()
|
||||
: body;
|
||||
addTop(tree);
|
||||
protected void addNavigationBarHeader(Content header) {
|
||||
addTop(header);
|
||||
navBar.setUserHeader(getUserHeaderFooter(true));
|
||||
tree.addContent(navBar.getContent(true));
|
||||
if (configuration.allowTag(HtmlTag.HEADER)) {
|
||||
body.addContent(tree);
|
||||
}
|
||||
header.addContent(navBar.getContent(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the lower navigation bar and the bottom text
|
||||
* (from the -bottom option) at the bottom of page.
|
||||
*
|
||||
* @param body the documentation tree to which the navigation bar footer will be added
|
||||
* @param footer the documentation tree to which the navigation bar footer will be added
|
||||
*/
|
||||
@Override
|
||||
protected void addNavigationBarFooter(Content body) {
|
||||
Content tree = (configuration.allowTag(HtmlTag.FOOTER))
|
||||
? HtmlTree.FOOTER()
|
||||
: body;
|
||||
protected void addNavigationBarFooter(Content footer) {
|
||||
navBar.setUserFooter(getUserHeaderFooter(false));
|
||||
tree.addContent(navBar.getContent(false));
|
||||
addBottom(tree);
|
||||
if (configuration.allowTag(HtmlTag.FOOTER)) {
|
||||
body.addContent(tree);
|
||||
}
|
||||
footer.addContent(navBar.getContent(false));
|
||||
addBottom(footer);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue