8215307: Pages do not have <h1>

Reviewed-by: hannesw
This commit is contained in:
Jonathan Gibbons 2019-02-21 14:03:57 -08:00
parent bf2d27c5a4
commit fa0093dc2c
63 changed files with 660 additions and 485 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -30,7 +30,6 @@ import java.util.*;
import java.util.zip.*;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
@ -38,7 +37,6 @@ import javax.lang.model.element.TypeElement;
import javax.lang.model.util.SimpleElementVisitor9;
import com.sun.source.doctree.DocTree;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -170,7 +168,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
String unicode = uc.toString();
contentTree.addContent(getMarkerAnchorForIndex(unicode));
Content headContent = new StringContent(unicode);
Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, false,
Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING, false,
HtmlStyle.title, headContent);
contentTree.addContent(heading);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -40,12 +40,10 @@ import javax.lang.model.type.TypeMirror;
import com.sun.source.doctree.DocTree;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.Links;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
import jdk.javadoc.internal.doclets.toolkit.Resources;
@ -375,18 +373,6 @@ public abstract class AbstractMemberWriter implements MemberSummaryWriter {
return utils.getSimpleName(member);
}
/**
* Get the header for the section.
*
* @param member the member being documented.
* @return a header content for the section.
*/
protected Content getHead(Element member) {
Content memberContent = new StringContent(name(member));
Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, memberContent);
return heading;
}
/**
* Return true if the given <code>ProgramElement</code> is inherited
* by the class that is being documented.

View File

@ -33,7 +33,6 @@ import java.util.SortedMap;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -224,7 +223,7 @@ 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 header the document tree to which the navgational links 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(Collection<ModuleElement> modules, String text,
@ -270,7 +269,7 @@ public abstract class AbstractModuleIndexWriter extends HtmlDocletWriter {
protected void addConfigurationTitle(Content body) {
if (configuration.doctitle.length() > 0) {
Content title = new RawHtml(configuration.doctitle);
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
HtmlStyle.title, title);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
body.addContent(div);

View File

@ -29,7 +29,6 @@ import java.util.*;
import javax.lang.model.element.PackageElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -180,7 +179,7 @@ public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
protected void addConfigurationTitle(Content body) {
if (configuration.doctitle.length() > 0) {
Content title = new RawHtml(configuration.doctitle);
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
HtmlStyle.title, title);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
body.addContent(div);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,7 +29,6 @@ import java.util.*;
import javax.lang.model.element.TypeElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -117,7 +116,7 @@ public abstract class AbstractTreeWriter extends HtmlDocletWriter {
if (!sset.isEmpty()) {
TypeElement firstTypeElement = sset.first();
Content headingContent = contents.getContent(heading);
Content sectionHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
Content sectionHeading = HtmlTree.HEADING(Headings.CONTENT_HEADING, true,
headingContent);
HtmlTree htmlTree = HtmlTree.SECTION(sectionHeading);
addLevelInfo(!utils.isInterface(firstTypeElement) ? firstTypeElement : null,

View File

@ -29,7 +29,6 @@ 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.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -112,7 +111,7 @@ public class AllClassesFrameWriter extends HtmlDocletWriter {
String label = resources.getText("doclet.All_Classes");
Content body = getBody(false, getWindowTitle(label));
Content htmlTree = HtmlTree.MAIN();
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
HtmlStyle.bar, contents.allClassesLabel);
htmlTree.addContent(heading);
Content ul = new HtmlTree(HtmlTag.UL);

View File

@ -32,7 +32,6 @@ import javax.lang.model.element.TypeElement;
import com.sun.source.doctree.DocTree;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -148,7 +147,7 @@ public class AllClassesIndexWriter extends HtmlDocletWriter {
}
}
Content titleContent = contents.allClassesLabel;
Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, titleContent);
Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading);
content.addContent(headerDiv);

View File

@ -27,7 +27,6 @@ package jdk.javadoc.internal.doclets.formats.html;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -94,7 +93,7 @@ public class AllPackagesIndexWriter extends HtmlDocletWriter {
div.setStyle(HtmlStyle.allPackagesContainer);
addPackages(div);
Content titleContent = contents.allPackagesLabel;
Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, titleContent);
Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading);
mainTree.addContent(headerDiv);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -33,7 +33,6 @@ import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -72,7 +71,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
memberSummaryTree.addContent(
HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY);
MarkerComments.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@ -96,7 +95,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
* {@inheritDoc}
*/
public void addAnnotationFieldDetailsMarker(Content memberDetails) {
memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_DETAILS);
memberDetails.addContent(MarkerComments.START_OF_ANNOTATION_TYPE_FIELD_DETAILS);
}
/**
@ -107,7 +106,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
if (!writer.printedAnnotationFieldHeading) {
memberDetailsTree.addContent(links.createAnchor(
SectionName.ANNOTATION_TYPE_FIELD_DETAIL));
Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.fieldDetailsLabel);
memberDetailsTree.addContent(heading);
writer.printedAnnotationFieldHeading = true;
@ -121,7 +120,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
Content annotationDetailsTree) {
annotationDetailsTree.addContent(links.createAnchor(name(member)));
Content annotationDocTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(member));
annotationDocTree.addContent(heading);
return annotationDocTree;
@ -188,7 +187,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
* {@inheritDoc}
*/
public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.fieldSummaryLabel);
memberTree.addContent(label);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -33,9 +33,7 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeOptionalMemberWriter;
import jdk.javadoc.internal.doclets.toolkit.Content;
@ -75,7 +73,7 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
memberSummaryTree.addContent(
HtmlConstants.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY);
MarkerComments.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@ -112,7 +110,7 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
*/
@Override
public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.annotateTypeOptionalMemberSummaryLabel);
memberTree.addContent(label);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -33,11 +33,9 @@ import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter;
import jdk.javadoc.internal.doclets.toolkit.Content;
@ -75,7 +73,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
memberSummaryTree.addContent(
HtmlConstants.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY);
MarkerComments.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@ -99,7 +97,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
* {@inheritDoc}
*/
public void addAnnotationDetailsMarker(Content memberDetails) {
memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS);
memberDetails.addContent(MarkerComments.START_OF_ANNOTATION_TYPE_DETAILS);
}
/**
@ -110,7 +108,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
if (!writer.printedAnnotationHeading) {
memberDetailsTree.addContent(links.createAnchor(
SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL));
Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.annotationTypeDetailsLabel);
memberDetailsTree.addContent(heading);
writer.printedAnnotationHeading = true;
@ -126,7 +124,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
annotationDetailsTree.addContent(links.createAnchor(
simpleName + utils.signature((ExecutableElement) member)));
Content annotationDocTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(simpleName);
annotationDocTree.addContent(heading);
return annotationDocTree;
@ -193,7 +191,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
* {@inheritDoc}
*/
public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.annotateTypeRequiredMemberSummaryLabel);
memberTree.addContent(label);
}

View File

@ -32,7 +32,6 @@ import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import com.sun.source.doctree.DocTree;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -95,7 +94,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true));
bodyTree.addContent(htmlTree);
bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
bodyTree.addContent(MarkerComments.START_OF_CLASS_DATA);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.header);
if (configuration.showModules) {
@ -118,7 +117,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS_HEADER, annotationType);
Content headerContent = new StringContent(header);
Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headerContent);
heading.addContent(getTypeParameterLinks(linkInfo));
div.addContent(heading);
@ -139,7 +138,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
*/
@Override
public void addFooter(Content contentTree) {
contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA);
contentTree.addContent(MarkerComments.END_OF_CLASS_DATA);
Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.addContent(navBar.getContent(false));

View File

@ -42,7 +42,6 @@ import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -325,7 +324,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
typeElement)),
getPackageLink(pkg, utils.getPackageName(pkg)));
Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
Content heading = HtmlTree.HEADING(Headings.TypeUse.SUMMARY_HEADING, link);
htmlTree.addContent(heading);
addClassUse(pkg, htmlTree);
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
@ -452,7 +451,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
headContent.addContent(contents.getContent("doclet.ClassUse_Title", cltype));
headContent.addContent(new HtmlTree(HtmlTag.BR));
headContent.addContent(clname);
Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
true, HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
mainTree.addContent(div);

View File

@ -36,7 +36,6 @@ import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.SimpleElementVisitor8;
import com.sun.source.doctree.DocTree;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -116,7 +115,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.addContent(navBar.getContent(true));
bodyTree.addContent(htmlTree);
bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
bodyTree.addContent(MarkerComments.START_OF_CLASS_DATA);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.header);
if (configuration.showModules) {
@ -143,7 +142,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
//Let's not link to ourselves in the header.
linkInfo.linkToSelf = false;
Content headerContent = new StringContent(header);
Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headerContent);
heading.addContent(getTypeParameterLinks(linkInfo));
div.addContent(heading);
@ -164,7 +163,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
*/
@Override
public void addFooter(Content contentTree) {
contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA);
contentTree.addContent(MarkerComments.END_OF_CLASS_DATA);
Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.addContent(navBar.getContent(false));

View File

@ -36,7 +36,6 @@ import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -152,11 +151,11 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
@Override
public void addContentsList(Content contentTree, Content contentListTree) {
Content titleContent = contents.constantsSummaryTitle;
Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, titleContent);
Content div = HtmlTree.DIV(HtmlStyle.header, pHeading);
Content headingContent = contents.contentsHeading;
Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING, true,
headingContent);
HtmlTree section = HtmlTree.SECTION(heading);
section.addContent(contentListTree);
@ -192,7 +191,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
pkgNameContent = getPackageLabel(parsedPackageName);
}
Content headingContent = new StringContent(".*");
Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
Content heading = HtmlTree.HEADING(Headings.ConstantsSummary.PACKAGE_HEADING, true,
pkgNameContent);
heading.addContent(headingContent);
summaryTree = HtmlTree.SECTION(heading);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,7 +34,6 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -98,7 +97,7 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
@Override
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
memberSummaryTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_SUMMARY);
memberSummaryTree.addContent(MarkerComments.START_OF_CONSTRUCTOR_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@ -118,11 +117,11 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
@Override
public Content getConstructorDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) {
memberDetailsTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_DETAILS);
memberDetailsTree.addContent(MarkerComments.START_OF_CONSTRUCTOR_DETAILS);
Content constructorDetailsTree = writer.getMemberTreeHeader();
constructorDetailsTree.addContent(links.createAnchor(
SectionName.CONSTRUCTOR_DETAIL));
Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.constructorDetailsLabel);
constructorDetailsTree.addContent(heading);
return constructorDetailsTree;
@ -140,7 +139,7 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
}
constructorDetailsTree.addContent(links.createAnchor(writer.getAnchor(constructor)));
Content constructorDocTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(constructor));
constructorDocTree.addContent(heading);
return constructorDocTree;
@ -223,7 +222,7 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
*/
@Override
public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.constructorSummaryLabel);
memberTree.addContent(label);
}

View File

@ -38,7 +38,6 @@ import javax.lang.model.element.PackageElement;
import com.sun.source.doctree.DocTree;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -336,11 +335,11 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
*/
public Content getContentsList(DeprecatedAPIListBuilder deprapi) {
Content headContent = contents.deprecatedAPI;
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
Content headingContent = contents.contentsHeading;
div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
div.addContent(HtmlTree.HEADING(Headings.CONTENT_HEADING, true,
headingContent));
Content ul = new HtmlTree(HtmlTag.UL);
for (DeprElementKind kind : DeprElementKind.values()) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -33,11 +33,9 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.EnumConstantWriter;
@ -71,7 +69,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
@Override
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
memberSummaryTree.addContent(HtmlConstants.START_OF_ENUM_CONSTANT_SUMMARY);
memberSummaryTree.addContent(MarkerComments.START_OF_ENUM_CONSTANT_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@ -91,11 +89,11 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
@Override
public Content getEnumConstantsDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) {
memberDetailsTree.addContent(HtmlConstants.START_OF_ENUM_CONSTANT_DETAILS);
memberDetailsTree.addContent(MarkerComments.START_OF_ENUM_CONSTANT_DETAILS);
Content enumConstantsDetailsTree = writer.getMemberTreeHeader();
enumConstantsDetailsTree.addContent(links.createAnchor(
SectionName.ENUM_CONSTANT_DETAIL));
Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.enumConstantDetailLabel);
enumConstantsDetailsTree.addContent(heading);
return enumConstantsDetailsTree;
@ -109,7 +107,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
Content enumConstantsDetailsTree) {
enumConstantsDetailsTree.addContent(links.createAnchor(name(enumConstant)));
Content enumConstantsTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(enumConstant));
enumConstantsTree.addContent(heading);
return enumConstantsTree;
@ -182,7 +180,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
*/
@Override
public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.enumConstantSummary);
memberTree.addContent(label);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -35,11 +35,9 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.FieldWriter;
@ -75,7 +73,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
@Override
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
memberSummaryTree.addContent(HtmlConstants.START_OF_FIELD_SUMMARY);
memberSummaryTree.addContent(MarkerComments.START_OF_FIELD_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@ -94,11 +92,11 @@ public class FieldWriterImpl extends AbstractMemberWriter
*/
@Override
public Content getFieldDetailsTreeHeader(TypeElement typeElement, Content memberDetailsTree) {
memberDetailsTree.addContent(HtmlConstants.START_OF_FIELD_DETAILS);
memberDetailsTree.addContent(MarkerComments.START_OF_FIELD_DETAILS);
Content fieldDetailsTree = writer.getMemberTreeHeader();
fieldDetailsTree.addContent(links.createAnchor(
SectionName.FIELD_DETAIL));
Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.fieldDetailsLabel);
fieldDetailsTree.addContent(heading);
return fieldDetailsTree;
@ -111,7 +109,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
public Content getFieldDocTreeHeader(VariableElement field, Content fieldDetailsTree) {
fieldDetailsTree.addContent(links.createAnchor(name(field)));
Content fieldTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(field));
fieldTree.addContent(heading);
return fieldTree;
@ -186,7 +184,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
*/
@Override
public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.fieldSummaryLabel);
memberTree.addContent(label);
}
@ -247,7 +245,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
? resources.getText("doclet.Fields_Inherited_From_Class")
: resources.getText("doclet.Fields_Inherited_From_Interface"));
}
Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
label);
labelHeading.addContent(Contents.SPACE);
labelHeading.addContent(classLink);

View File

@ -0,0 +1,134 @@
/*
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.javadoc.internal.doclets.formats.html;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
/**
* Aliases for HTML heading tags (H1..H6) for different kinds of pages.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
class Headings {
/**
* Standard top-level heading for the page title for all pages.
*/
static final HtmlTag PAGE_TITLE_HEADING = HtmlTag.H1;
/**
* Standard second-level heading for sundry pages that do
* not have their own page group.
*/
static final HtmlTag CONTENT_HEADING = HtmlTag.H2;
/**
* Headings for the page for a module declaration.
*/
static class ModuleDeclaration {
static final HtmlTag SUMMARY_HEADING = HtmlTag.H2;
}
/**
* Headings for the page for a type declaration.
* This includes classes, interfaces, enums and annotation types.
*/
static class TypeDeclaration {
/**
* Heading for the different summary lists:
* Field Summary, Constructor Summary, Method Summary, etc.
*/
static final HtmlTag SUMMARY_HEADING = HtmlTag.H2;
/**
* Subheading within a summary for the inherited elements:
* inherited methods, etc
*/
static final HtmlTag INHERITED_SUMMARY_HEADING = HtmlTag.H3;
/**
* Heading for the different detail lists:
* Field Details, Constructor Details, Method Details, etc.
*/
static final HtmlTag DETAILS_HEADING = HtmlTag.H2;
/**
* Subheading with a Details list for an individual element.
*/
static final HtmlTag MEMBER_HEADING = HtmlTag.H3;
}
/**
* Headings for the Constants Summary page.
*/
static class ConstantsSummary {
static final HtmlTag PACKAGE_HEADING = HtmlTag.H2;
}
/**
* Headings for the Serialized Form page.
*/
static class SerializedForm {
/**
* Heading for the package name, preceding a list of types.
*/
static final HtmlTag PACKAGE_HEADING = HtmlTag.H2;
/**
* Heading for a type name within a package.
*/
static final HtmlTag CLASS_HEADING = HtmlTag.H3;
/**
* Subheading for info within a type.
*/
static final HtmlTag CLASS_SUBHEADING = HtmlTag.H4;
/**
* Heading for an individual member element within a type.
*/
static final HtmlTag MEMBER_HEADING = HtmlTag.H5;
}
/**
* Headings for a type Use page.
*/
static class TypeUse {
static final HtmlTag SUMMARY_HEADING = HtmlTag.H2;
}
/**
* Headings for index frames pages.
*/
static class IndexFrames {
/** Heading for a list of module names in an index frame. */
static final HtmlTag MODULE_HEADING = HtmlTag.H2;
/** Heading for a list of package names in an index frame. */
static final HtmlTag PACKAGE_HEADING = HtmlTag.H2;
}
}

View File

@ -25,7 +25,6 @@
package jdk.javadoc.internal.doclets.formats.html;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -113,7 +112,7 @@ public class HelpWriter extends HtmlDocletWriter {
*/
protected void addHelpFileContents(Content contentTree) {
// Heading
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, false, HtmlStyle.title,
contents.getContent("doclet.help.main_heading"));
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
Content intro = HtmlTree.DIV(HtmlStyle.subTitle,
@ -126,7 +125,7 @@ public class HelpWriter extends HtmlDocletWriter {
// Overview
if (configuration.createoverview) {
Content overviewHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content overviewHeading = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.overviewLabel);
htmlTree = HtmlTree.SECTION(overviewHeading);
String overviewKey = configuration.showModules
@ -143,7 +142,7 @@ public class HelpWriter extends HtmlDocletWriter {
// Module
if (configuration.showModules) {
Content moduleHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content moduleHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.moduleLabel);
htmlTree = HtmlTree.SECTION(moduleHead);
Content moduleIntro = contents.getContent("doclet.help.module.intro");
@ -158,7 +157,7 @@ public class HelpWriter extends HtmlDocletWriter {
}
// Package
Content packageHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content packageHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.packageLabel);
htmlTree = HtmlTree.SECTION(packageHead);
Content packageIntro = contents.getContent("doclet.help.package.intro");
@ -175,7 +174,7 @@ public class HelpWriter extends HtmlDocletWriter {
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Class/interface
Content classHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content classHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.getContent("doclet.help.class_interface.head"));
htmlTree = HtmlTree.SECTION(classHead);
Content classIntro = contents.getContent("doclet.help.class_interface.intro");
@ -210,7 +209,7 @@ public class HelpWriter extends HtmlDocletWriter {
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Annotation Types
Content aHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content aHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.annotationType);
htmlTree = HtmlTree.SECTION(aHead);
Content aIntro = contents.getContent("doclet.help.annotation_type.intro");
@ -226,7 +225,7 @@ public class HelpWriter extends HtmlDocletWriter {
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Enums
Content enumHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.enum_);
Content enumHead = HtmlTree.HEADING(Headings.CONTENT_HEADING, contents.enum_);
htmlTree = HtmlTree.SECTION(enumHead);
Content eIntro = contents.getContent("doclet.help.enum.intro");
Content enumPara = HtmlTree.P(eIntro);
@ -241,7 +240,7 @@ public class HelpWriter extends HtmlDocletWriter {
// Class Use
if (configuration.classuse) {
Content useHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content useHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.getContent("doclet.help.use.head"));
htmlTree = HtmlTree.SECTION(useHead);
Content useBody = contents.getContent("doclet.help.use.body");
@ -252,7 +251,7 @@ public class HelpWriter extends HtmlDocletWriter {
// Tree
if (configuration.createtree) {
Content treeHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content treeHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.getContent("doclet.help.tree.head"));
htmlTree = HtmlTree.SECTION(treeHead);
Content treeIntro = contents.getContent("doclet.help.tree.intro",
@ -270,7 +269,7 @@ public class HelpWriter extends HtmlDocletWriter {
// Deprecated
if (!(configuration.nodeprecatedlist || configuration.nodeprecated)) {
Content dHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content dHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.deprecatedAPI);
htmlTree = HtmlTree.SECTION(dHead);
Content deprBody = contents.getContent("doclet.help.deprecated.body",
@ -291,7 +290,7 @@ public class HelpWriter extends HtmlDocletWriter {
indexlink = links.createLink(DocPaths.INDEX_ALL,
resources.getText("doclet.Index"));
}
Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content indexHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.getContent("doclet.help.index.head"));
htmlTree = HtmlTree.SECTION(indexHead);
Content indexBody = contents.getContent("doclet.help.index.body", indexlink);
@ -302,7 +301,7 @@ public class HelpWriter extends HtmlDocletWriter {
// Frames
if (configuration.frames) {
Content frameHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content frameHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.getContent("doclet.help.frames.head"));
htmlTree = HtmlTree.SECTION(frameHead);
Content framesBody = contents.getContent("doclet.help.frames.body");
@ -313,7 +312,7 @@ public class HelpWriter extends HtmlDocletWriter {
}
// Serialized Form
Content sHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content sHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.serializedForm);
htmlTree = HtmlTree.SECTION(sHead);
Content serialBody = contents.getContent("doclet.help.serial_form.body");
@ -322,7 +321,7 @@ public class HelpWriter extends HtmlDocletWriter {
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Constant Field Values
Content constHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content constHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.constantsSummaryTitle);
htmlTree = HtmlTree.SECTION(constHead);
Content constantsBody = contents.getContent("doclet.help.constants.body",
@ -333,7 +332,7 @@ public class HelpWriter extends HtmlDocletWriter {
ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
// Search
Content searchHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content searchHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
contents.getContent("doclet.help.search.head"));
htmlTree = HtmlTree.SECTION(searchHead);
Content searchBody = contents.getContent("doclet.help.search.body");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -41,11 +41,9 @@ import com.sun.tools.doclint.DocLint;
import jdk.javadoc.doclet.Doclet;
import jdk.javadoc.doclet.DocletEnvironment;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlConstants;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlVersion;
import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.DocletException;
import jdk.javadoc.internal.doclets.toolkit.Messages;
import jdk.javadoc.internal.doclets.toolkit.Resources;
@ -82,6 +80,11 @@ import static javax.tools.Diagnostic.Kind.*;
*/
public class HtmlConfiguration extends BaseConfiguration {
/**
* Default charset for HTML.
*/
public static final String HTML_DEFAULT_CHARSET = "utf-8";
/**
* Argument for command line option "-header".
*/
@ -762,7 +765,7 @@ public class HtmlConfiguration extends BaseConfiguration {
protected boolean finishOptionSettings0() throws DocletException {
if (docencoding == null) {
if (charset == null) {
docencoding = charset = (encoding == null) ? HtmlConstants.HTML_DEFAULT_CHARSET : encoding;
docencoding = charset = (encoding == null) ? HTML_DEFAULT_CHARSET : encoding;
} else {
docencoding = charset;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,7 +34,6 @@ import javax.lang.model.type.TypeMirror;
import com.sun.source.doctree.DocTree;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -108,8 +107,7 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
li.setStyle(HtmlStyle.blockList);
if (serializableFieldsTree.isValid()) {
Content headingContent = new StringContent(heading);
Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING,
headingContent);
Content serialHeading = HtmlTree.HEADING(Headings.SerializedForm.CLASS_SUBHEADING, headingContent);
li.addContent(serialHeading);
li.addContent(serializableFieldsTree);
}
@ -120,7 +118,7 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
public void addMemberHeader(TypeElement fieldType, String fieldTypeStr,
String fieldDimensions, String fieldName, Content contentTree) {
Content nameContent = new StringContent(fieldName);
Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, nameContent);
Content heading = HtmlTree.HEADING(Headings.SerializedForm.MEMBER_HEADING, nameContent);
contentTree.addContent(heading);
Content pre = new HtmlTree(HtmlTag.PRE);
if (fieldType == null) {
@ -138,7 +136,7 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl
@Override
public void addMemberHeader(TypeMirror fieldType, String fieldName, Content contentTree) {
Content nameContent = new StringContent(fieldName);
Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, nameContent);
Content heading = HtmlTree.HEADING(HtmlTag.H5, nameContent);
contentTree.addContent(heading);
Content pre = new HtmlTree(HtmlTag.PRE);
Content fieldContent = writer.getLink(new LinkInfoImpl(

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -29,7 +29,6 @@ import javax.lang.model.element.ExecutableElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -95,8 +94,7 @@ public class HtmlSerialMethodWriter extends MethodWriterImpl implements
*/
public Content getSerializableMethods(String heading, Content serializableMethodContent) {
Content headingContent = new StringContent(heading);
Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING,
headingContent);
Content serialHeading = HtmlTree.HEADING(Headings.SerializedForm.CLASS_SUBHEADING, headingContent);
Content li = HtmlTree.LI(HtmlStyle.blockList, serialHeading);
li.addContent(serializableMethodContent);
return li;
@ -120,7 +118,9 @@ public class HtmlSerialMethodWriter extends MethodWriterImpl implements
* @param methodsContentTree the content tree to which the member header will be added
*/
public void addMemberHeader(ExecutableElement member, Content methodsContentTree) {
methodsContentTree.addContent(getHead(member));
Content memberContent = new StringContent(name(member));
Content heading = HtmlTree.HEADING(Headings.SerializedForm.MEMBER_HEADING, memberContent);
methodsContentTree.addContent(heading);
methodsContentTree.addContent(getSignature(member));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,12 +23,12 @@
* questions.
*/
package jdk.javadoc.internal.doclets.formats.html.markup;
package jdk.javadoc.internal.doclets.formats.html;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.formats.html.markup.Comment;
/**
* Stores constants for Html Doclet.
* Marker comments to identify regions in the generated files.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
@ -37,216 +37,162 @@ import jdk.javadoc.internal.doclets.toolkit.Content;
*
* @author Bhavesh Patel
*/
public class HtmlConstants {
public class MarkerComments {
/**
* Marker to identify start of top navigation bar.
*/
public static final Content START_OF_TOP_NAVBAR =
public static final Comment START_OF_TOP_NAVBAR =
new Comment("========= START OF TOP NAVBAR =======");
/**
* Marker to identify start of bottom navigation bar.
*/
public static final Content START_OF_BOTTOM_NAVBAR =
public static final Comment START_OF_BOTTOM_NAVBAR =
new Comment("======= START OF BOTTOM NAVBAR ======");
/**
* Marker to identify end of top navigation bar.
*/
public static final Content END_OF_TOP_NAVBAR =
public static final Comment END_OF_TOP_NAVBAR =
new Comment("========= END OF TOP NAVBAR =========");
/**
* Marker to identify end of bottom navigation bar.
*/
public static final Content END_OF_BOTTOM_NAVBAR =
public static final Comment END_OF_BOTTOM_NAVBAR =
new Comment("======== END OF BOTTOM NAVBAR =======");
/**
* Marker to identify start of module description.
*/
public static final Content START_OF_MODULE_DESCRIPTION =
public static final Comment START_OF_MODULE_DESCRIPTION =
new Comment("============ MODULE DESCRIPTION ===========");
/**
* Marker to identify start of modules summary.
*/
public static final Content START_OF_MODULES_SUMMARY =
public static final Comment START_OF_MODULES_SUMMARY =
new Comment("============ MODULES SUMMARY ===========");
/**
* Marker to identify start of packages summary.
*/
public static final Content START_OF_PACKAGES_SUMMARY =
public static final Comment START_OF_PACKAGES_SUMMARY =
new Comment("============ PACKAGES SUMMARY ===========");
/**
* Marker to identify start of services summary.
*/
public static final Content START_OF_SERVICES_SUMMARY =
public static final Comment START_OF_SERVICES_SUMMARY =
new Comment("============ SERVICES SUMMARY ===========");
/**
* Marker to identify start of class data.
*/
public static final Content START_OF_CLASS_DATA =
public static final Comment START_OF_CLASS_DATA =
new Comment("======== START OF CLASS DATA ========");
/**
* Marker to identify end of class data.
*/
public static final Content END_OF_CLASS_DATA =
public static final Comment END_OF_CLASS_DATA =
new Comment("========= END OF CLASS DATA =========");
/**
* Marker to identify start of nested class summary.
*/
public static final Content START_OF_NESTED_CLASS_SUMMARY =
public static final Comment START_OF_NESTED_CLASS_SUMMARY =
new Comment("======== NESTED CLASS SUMMARY ========");
/**
* Marker to identify start of annotation type optional member summary.
*/
public static final Content START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY =
public static final Comment START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY =
new Comment("=========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY ===========");
/**
* Marker to identify start of annotation type required member summary.
*/
public static final Content START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY =
public static final Comment START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY =
new Comment("=========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY ===========");
/**
* Marker to identify start of annotation type required member summary.
*/
public static final Content START_OF_ANNOTATION_TYPE_FIELD_SUMMARY =
public static final Comment START_OF_ANNOTATION_TYPE_FIELD_SUMMARY =
new Comment("=========== ANNOTATION TYPE FIELD SUMMARY ===========");
/**
* Marker to identify start of constructor summary.
*/
public static final Content START_OF_CONSTRUCTOR_SUMMARY =
public static final Comment START_OF_CONSTRUCTOR_SUMMARY =
new Comment("======== CONSTRUCTOR SUMMARY ========");
/**
* Marker to identify start of enum constants summary.
*/
public static final Content START_OF_ENUM_CONSTANT_SUMMARY =
public static final Comment START_OF_ENUM_CONSTANT_SUMMARY =
new Comment("=========== ENUM CONSTANT SUMMARY ===========");
/**
* Marker to identify start of field summary.
*/
public static final Content START_OF_FIELD_SUMMARY =
public static final Comment START_OF_FIELD_SUMMARY =
new Comment("=========== FIELD SUMMARY ===========");
/**
* Marker to identify start of properties summary.
*/
public static final Content START_OF_PROPERTY_SUMMARY =
public static final Comment START_OF_PROPERTY_SUMMARY =
new Comment("=========== PROPERTY SUMMARY ===========");
/**
* Marker to identify start of method summary.
*/
public static final Content START_OF_METHOD_SUMMARY =
public static final Comment START_OF_METHOD_SUMMARY =
new Comment("========== METHOD SUMMARY ===========");
/**
* Marker to identify start of annotation type details.
*/
public static final Content START_OF_ANNOTATION_TYPE_DETAILS =
public static final Comment START_OF_ANNOTATION_TYPE_DETAILS =
new Comment("============ ANNOTATION TYPE MEMBER DETAIL ===========");
/**
* Marker to identify start of annotation type field details.
*/
public static final Content START_OF_ANNOTATION_TYPE_FIELD_DETAILS =
public static final Comment START_OF_ANNOTATION_TYPE_FIELD_DETAILS =
new Comment("============ ANNOTATION TYPE FIELD DETAIL ===========");
/**
* Marker to identify start of method details.
*/
public static final Content START_OF_METHOD_DETAILS =
public static final Comment START_OF_METHOD_DETAILS =
new Comment("============ METHOD DETAIL ==========");
/**
* Marker to identify start of field details.
*/
public static final Content START_OF_FIELD_DETAILS =
public static final Comment START_OF_FIELD_DETAILS =
new Comment("============ FIELD DETAIL ===========");
/**
* Marker to identify start of property details.
*/
public static final Content START_OF_PROPERTY_DETAILS =
public static final Comment START_OF_PROPERTY_DETAILS =
new Comment("============ PROPERTY DETAIL ===========");
/**
* Marker to identify start of constructor details.
*/
public static final Content START_OF_CONSTRUCTOR_DETAILS =
public static final Comment START_OF_CONSTRUCTOR_DETAILS =
new Comment("========= CONSTRUCTOR DETAIL ========");
/**
* Marker to identify start of enum constants details.
*/
public static final Content START_OF_ENUM_CONSTANT_DETAILS =
public static final Comment START_OF_ENUM_CONSTANT_DETAILS =
new Comment("============ ENUM CONSTANT DETAIL ===========");
/**
* Html tag for the page title heading.
*/
public static final HtmlTag TITLE_HEADING = HtmlTag.H1;
/**
* Html tag for the class page title heading.
*/
public static final HtmlTag CLASS_PAGE_HEADING = HtmlTag.H2;
/**
* Html tag for the content heading.
*/
public static final HtmlTag CONTENT_HEADING = HtmlTag.H2;
/**
* Html tag for the package name heading.
*/
public static final HtmlTag PACKAGE_HEADING = HtmlTag.H2;
/**
* Html tag for the module name heading.
*/
public static final HtmlTag MODULE_HEADING = HtmlTag.H2;
/**
* Html tag for the member summary heading.
*/
public static final HtmlTag SUMMARY_HEADING = HtmlTag.H3;
/**
* Html tag for the inherited member summary heading.
*/
public static final HtmlTag INHERITED_SUMMARY_HEADING = HtmlTag.H3;
/**
* Html tag for the member details heading.
*/
public static final HtmlTag DETAILS_HEADING = HtmlTag.H3;
/**
* Html tag for the serialized member heading.
*/
public static final HtmlTag SERIALIZED_MEMBER_HEADING = HtmlTag.H3;
/**
* Html tag for the member heading.
*/
public static final HtmlTag MEMBER_HEADING = HtmlTag.H4;
/**
* Default charset for HTML.
*/
public static final String HTML_DEFAULT_CHARSET = "utf-8";
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -36,7 +36,6 @@ import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -87,7 +86,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
*/
@Override
public Content getMemberSummaryHeader(TypeElement typeElement, Content memberSummaryTree) {
memberSummaryTree.addContent(HtmlConstants.START_OF_METHOD_SUMMARY);
memberSummaryTree.addContent(MarkerComments.START_OF_METHOD_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@ -106,10 +105,10 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
*/
@Override
public Content getMethodDetailsTreeHeader(TypeElement typeElement, Content memberDetailsTree) {
memberDetailsTree.addContent(HtmlConstants.START_OF_METHOD_DETAILS);
memberDetailsTree.addContent(MarkerComments.START_OF_METHOD_DETAILS);
Content methodDetailsTree = writer.getMemberTreeHeader();
methodDetailsTree.addContent(links.createAnchor(SectionName.METHOD_DETAIL));
Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.methodDetailLabel);
methodDetailsTree.addContent(heading);
return methodDetailsTree;
@ -126,7 +125,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
}
methodDetailsTree.addContent(links.createAnchor(writer.getAnchor(method)));
Content methodDocTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(name(method));
methodDocTree.addContent(heading);
return methodDocTree;
@ -229,7 +228,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
*/
@Override
public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.methodSummary);
memberTree.addContent(label);
}
@ -295,7 +294,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
? resources.getText("doclet.Methods_Inherited_From_Class")
: resources.getText("doclet.Methods_Inherited_From_Interface"));
}
Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
label);
labelHeading.addContent(Contents.SPACE);
labelHeading.addContent(classLink);

View File

@ -32,7 +32,6 @@ import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.ElementFilter;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -101,7 +100,7 @@ public class ModuleFrameWriter extends HtmlDocletWriter {
DocPath moduleSummary = configuration.useModuleDirectories
? DocPaths.DOT_DOT.resolve(configuration.docPaths.moduleSummary(moduleElement))
: configuration.docPaths.moduleSummary(moduleElement);
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, HtmlStyle.bar,
mdlgen.links.createLink(moduleSummary, mdlLabel, "", "classFrame"));
htmlTree.addContent(heading);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
@ -172,7 +171,7 @@ public class ModuleFrameWriter extends HtmlDocletWriter {
continue;
}
if (!printedHeader) {
Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING,
true, labelContent);
htmlTree.addContent(heading);
printedHeader = true;

View File

@ -32,7 +32,6 @@ import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlAttr;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -57,6 +56,12 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
* @author Bhavesh Patel
*/
public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
/**
* The heading (h1 or h2) to use for the module list,
* set by addNavigationBarHeader depending on whether or not there
* is an additional initial heading.
*/
private HtmlTag moduleListHeading;
/**
* Construct the ModuleIndexFrameWriter object.
@ -83,8 +88,9 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
/**
* {@inheritDoc}
*/
@Override
protected void addModulesList(Content main) {
Content heading = HtmlTree.HEADING(HtmlConstants.MODULE_HEADING, true,
Content heading = HtmlTree.HEADING(moduleListHeading, true,
contents.modulesLabel);
HtmlTree htmlTree = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
HtmlTree ul = new HtmlTree(HtmlTag.UL);
@ -125,15 +131,16 @@ public class ModuleIndexFrameWriter extends AbstractModuleIndexWriter {
* {@inheritDoc}
*/
protected void addNavigationBarHeader(Content header) {
Content headerContent;
if (configuration.packagesheader.length() > 0) {
headerContent = new RawHtml(replaceDocRootDir(configuration.packagesheader));
String headerContent = !configuration.packagesheader.isEmpty() ? configuration.packagesheader
: configuration.header;
if (!headerContent.isEmpty()) {
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.bar, new RawHtml(replaceDocRootDir(headerContent)));
header.addContent(heading);
moduleListHeading = Headings.IndexFrames.MODULE_HEADING;
} else {
headerContent = new RawHtml(replaceDocRootDir(configuration.header));
moduleListHeading = Headings.PAGE_TITLE_HEADING;
}
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
HtmlStyle.bar, headerContent);
header.addContent(heading);
}
/**

View File

@ -33,7 +33,6 @@ import java.util.Set;
import javax.lang.model.element.ModuleElement;
import javax.lang.model.element.PackageElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -57,6 +56,12 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
* @author Bhavesh Patel
*/
public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
/**
* The heading (h1 or h2) to use for the module packages list,
* set by addNavigationBarHeader depending on whether or not there
* is an additional initial heading.
*/
private HtmlTag modulePackagesListHeading;
/**
* Construct the ModulePackageIndexFrameWriter object.
@ -89,7 +94,7 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
protected void addModulePackagesList(Map<ModuleElement, Set<PackageElement>> modules, String text,
String tableSummary, Content main, ModuleElement mdle) {
Content profNameContent = new StringContent(mdle.getQualifiedName().toString());
Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
Content heading = HtmlTree.HEADING(modulePackagesListHeading, true,
getTargetModuleLink("classFrame", profNameContent, mdle));
heading.addContent(Contents.SPACE);
heading.addContent(contents.packagesLabel);
@ -112,7 +117,7 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
protected void addModulePackagesList(Set<ModuleElement> modules, String text,
String tableSummary, Content body, ModuleElement mdle) {
Content moduleNameContent = new StringContent(mdle.getQualifiedName().toString());
Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
Content heading = HtmlTree.HEADING(modulePackagesListHeading, true,
getTargetModuleLink("classFrame", moduleNameContent, mdle));
heading.addContent(Contents.SPACE);
heading.addContent(contents.packagesLabel);
@ -157,15 +162,16 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
* {@inheritDoc}
*/
protected void addNavigationBarHeader(Content header) {
Content headerContent;
if (configuration.packagesheader.length() > 0) {
headerContent = new RawHtml(replaceDocRootDir(configuration.packagesheader));
String headerContent = !configuration.packagesheader.isEmpty() ? configuration.packagesheader
: configuration.header;
if (!headerContent.isEmpty()) {
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.bar, new RawHtml(replaceDocRootDir(headerContent)));
header.addContent(heading);
modulePackagesListHeading = Headings.IndexFrames.PACKAGE_HEADING;
} else {
headerContent = new RawHtml(replaceDocRootDir(configuration.header));
modulePackagesListHeading = Headings.PAGE_TITLE_HEADING;
}
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
HtmlStyle.bar, headerContent);
header.addContent(heading);
}
/**
@ -177,6 +183,7 @@ public class ModulePackageIndexFrameWriter extends AbstractModuleIndexWriter {
/**
* Do nothing as there is no modules list on this page.
*/
@Override
protected void addModulesList(Content body) {
}

View File

@ -46,7 +46,6 @@ import javax.lang.model.util.ElementFilter;
import com.sun.source.doctree.DocTree;
import jdk.javadoc.doclet.DocletEnvironment.ModuleMode;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -213,7 +212,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
div.addContent(annotationContent);
Content label = mdle.isOpen() && (configuration.docEnv.getModuleMode() == ModuleMode.ALL)
? contents.openModuleLabel : contents.moduleLabel;
Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
Content tHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, label);
tHeading.addContent(Contents.SPACE);
Content moduleHead = new RawHtml(heading);
@ -461,7 +460,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
Content htmltree) {
htmltree.addContent(startMarker);
htmltree.addContent(links.createAnchor(markerAnchor));
htmltree.addContent(HtmlTree.HEADING(HtmlTag.H3, heading));
htmltree.addContent(HtmlTree.HEADING(Headings.ModuleDeclaration.SUMMARY_HEADING, heading));
}
/**
@ -509,7 +508,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
contents.descriptionLabel);
HtmlTree li = new HtmlTree(HtmlTag.LI);
li.setStyle(HtmlStyle.blockList);
addSummaryHeader(HtmlConstants.START_OF_MODULES_SUMMARY, SectionName.MODULES,
addSummaryHeader(MarkerComments.START_OF_MODULES_SUMMARY, SectionName.MODULES,
contents.navModules, li);
if (display(requires)) {
String text = resources.getText("doclet.Requires_Summary");
@ -561,7 +560,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
|| display(indirectPackages) || display(indirectOpenPackages)) {
HtmlTree li = new HtmlTree(HtmlTag.LI);
li.setStyle(HtmlStyle.blockList);
addSummaryHeader(HtmlConstants.START_OF_PACKAGES_SUMMARY, SectionName.PACKAGES,
addSummaryHeader(MarkerComments.START_OF_PACKAGES_SUMMARY, SectionName.PACKAGES,
contents.navPackages, li);
if (display(packages)) {
addPackageSummary(li);
@ -740,7 +739,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
if (haveProvides || haveUses) {
HtmlTree li = new HtmlTree(HtmlTag.LI);
li.setStyle(HtmlStyle.blockList);
addSummaryHeader(HtmlConstants.START_OF_SERVICES_SUMMARY, SectionName.SERVICES,
addSummaryHeader(MarkerComments.START_OF_SERVICES_SUMMARY, SectionName.SERVICES,
contents.navServices, li);
TableHeader usesProvidesTableHeader =
new TableHeader(contents.typeLabel, contents.descriptionLabel);
@ -869,7 +868,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
if (!utils.getFullBody(mdle).isEmpty()) {
Content tree = HtmlTree.SECTION();
addDeprecationInfo(tree);
tree.addContent(HtmlConstants.START_OF_MODULE_DESCRIPTION);
tree.addContent(MarkerComments.START_OF_MODULE_DESCRIPTION);
tree.addContent(links.createAnchor(SectionName.MODULE_DESCRIPTION));
addInlineComment(mdle, tree);
moduleContentTree.addContent(tree);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,10 +34,8 @@ import java.util.List;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
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.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
@ -72,7 +70,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
@Override
public Content getMemberSummaryHeader(TypeElement typeElement,
Content memberSummaryTree) {
memberSummaryTree.addContent(HtmlConstants.START_OF_NESTED_CLASS_SUMMARY);
memberSummaryTree.addContent(MarkerComments.START_OF_NESTED_CLASS_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@ -91,7 +89,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
*/
@Override
public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.nestedClassSummary);
memberTree.addContent(label);
}
@ -155,8 +153,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
? resources.getText("doclet.Nested_Classes_Interfaces_Inherited_From_Interface")
: resources.getText("doclet.Nested_Classes_Interfaces_Inherited_From_Class"));
}
Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
label);
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING, label);
labelHeading.addContent(Contents.SPACE);
labelHeading.addContent(classLink);
inheritedTree.addContent(labelHeading);

View File

@ -30,7 +30,6 @@ import java.util.*;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -102,7 +101,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
HtmlTree body = packgen.getBody(false, packgen.getWindowTitle(pkgName));
Content pkgNameContent = new StringContent(pkgName);
HtmlTree htmlTree = HtmlTree.MAIN();
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, HtmlStyle.bar,
packgen.getTargetPackageLink(packageElement, "classFrame", pkgNameContent));
htmlTree.addContent(heading);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
@ -178,7 +177,7 @@ public class PackageFrameWriter extends HtmlDocletWriter {
continue;
}
if (!printedHeader) {
Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING,
true, labelContent);
htmlTree.addContent(heading);
printedHeader = true;

View File

@ -27,7 +27,6 @@ package jdk.javadoc.internal.doclets.formats.html;
import javax.lang.model.element.PackageElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -79,7 +78,7 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
*/
@Override
protected void addPackagesList(Content main) {
Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
Content heading = HtmlTree.HEADING(Headings.IndexFrames.PACKAGE_HEADING, true,
contents.packagesLabel);
HtmlTree htmlTree = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
HtmlTree ul = new HtmlTree(HtmlTag.UL);
@ -130,7 +129,7 @@ public class PackageIndexFrameWriter extends AbstractPackageIndexWriter {
} else {
headerContent = new RawHtml(replaceDocRootDir(configuration.header));
}
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.bar, headerContent);
header.addContent(heading);
}

View File

@ -27,7 +27,6 @@ package jdk.javadoc.internal.doclets.formats.html;
import javax.lang.model.element.PackageElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -101,7 +100,7 @@ public class PackageTreeWriter extends AbstractTreeWriter {
HtmlTree mainTree = HtmlTree.MAIN();
Content headContent = contents.getContent("doclet.Hierarchy_For_Package",
utils.getPackageName(packageElement));
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, false,
HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
if (configuration.packages.size() > 1) {

View File

@ -34,7 +34,6 @@ import javax.lang.model.element.PackageElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -252,7 +251,7 @@ public class PackageUseWriter extends SubWriterHolderWriter {
headContent.addContent(contents.getContent("doclet.ClassUse_Title", packageText));
headContent.addContent(new HtmlTree(HtmlTag.BR));
headContent.addContent(name);
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
mainTree.addContent(div);

View File

@ -36,7 +36,6 @@ import javax.lang.model.element.TypeElement;
import com.sun.source.doctree.DocTree;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -129,7 +128,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
Content annotationContent = new HtmlTree(HtmlTag.P);
addAnnotationInfo(packageElement, annotationContent);
div.addContent(annotationContent);
Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
Content tHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, contents.packageLabel);
tHeading.addContent(Contents.SPACE);
Content packageHead = new StringContent(heading);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -33,7 +33,6 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -68,7 +67,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
*/
@Override
public Content getMemberSummaryHeader(TypeElement typeElement, Content memberSummaryTree) {
memberSummaryTree.addContent(HtmlConstants.START_OF_PROPERTY_SUMMARY);
memberSummaryTree.addContent(MarkerComments.START_OF_PROPERTY_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
return memberTree;
@ -88,10 +87,10 @@ public class PropertyWriterImpl extends AbstractMemberWriter
@Override
public Content getPropertyDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) {
memberDetailsTree.addContent(HtmlConstants.START_OF_PROPERTY_DETAILS);
memberDetailsTree.addContent(MarkerComments.START_OF_PROPERTY_DETAILS);
Content propertyDetailsTree = writer.getMemberTreeHeader();
propertyDetailsTree.addContent(links.createAnchor(SectionName.PROPERTY_DETAIL));
Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
contents.propertyDetailsLabel);
propertyDetailsTree.addContent(heading);
return propertyDetailsTree;
@ -105,7 +104,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
Content propertyDetailsTree) {
propertyDetailsTree.addContent(links.createAnchor(name(property)));
Content propertyDocTree = writer.getMemberTreeHeader();
Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
heading.addContent(utils.getPropertyLabel(name(property)));
propertyDocTree.addContent(heading);
return propertyDocTree;
@ -200,7 +199,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
*/
@Override
public void addSummaryLabel(Content memberTree) {
Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
Content label = HtmlTree.HEADING(Headings.TypeDeclaration.SUMMARY_HEADING,
contents.propertySummaryLabel);
memberTree.addContent(label);
}
@ -261,7 +260,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
? resources.getText("doclet.Properties_Inherited_From_Class")
: resources.getText("doclet.Properties_Inherited_From_Interface"));
}
Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
Content labelHeading = HtmlTree.HEADING(Headings.TypeDeclaration.INHERITED_SUMMARY_HEADING,
label);
labelHeading.addContent(Contents.SPACE);
labelHeading.addContent(classLink);

View File

@ -29,7 +29,6 @@ import java.util.*;
import javax.lang.model.element.TypeElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -42,7 +41,7 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException;
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
/**
* Generate the Serialized Form Information Page.
* Generates the Serialized Form Information Page, <i>serialized-form.html</i>.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
@ -86,7 +85,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
htmlTree.addContent(navBar.getContent(true));
bodyTree.addContent(htmlTree);
Content h1Content = new StringContent(header);
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, h1Content);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
mainTree.addContent(div);
@ -120,7 +119,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
* @return a content tree for the package header
*/
public Content getPackageHeader(String packageName) {
Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
Content heading = HtmlTree.HEADING(Headings.SerializedForm.PACKAGE_HEADING, true,
contents.packageLabel);
heading.addContent(Contents.SPACE);
heading.addContent(packageName);
@ -173,8 +172,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
contents.getContent(
"doclet.Class_0_extends_implements_serializable", classLink,
superClassLink);
li.addContent(HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING,
className));
li.addContent(HtmlTree.HEADING(Headings.SerializedForm.CLASS_HEADING, className));
return li;
}

View File

@ -29,7 +29,6 @@ import java.util.SortedSet;
import javax.lang.model.element.PackageElement;
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;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -108,7 +107,7 @@ public class TreeWriter extends AbstractTreeWriter {
public void generateTreeFile() throws DocFileIOException {
HtmlTree body = getTreeHeader();
Content headContent = contents.hierarchyForAllPackages;
Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false,
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, false,
HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading);
addPackageTreeLinks(div);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -42,6 +42,7 @@ import javax.lang.model.element.TypeElement;
import jdk.javadoc.internal.doclets.formats.html.AbstractMemberWriter;
import jdk.javadoc.internal.doclets.formats.html.Contents;
import jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration;
import jdk.javadoc.internal.doclets.formats.html.MarkerComments;
import jdk.javadoc.internal.doclets.formats.html.SectionName;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.builders.MemberSummaryBuilder;
@ -106,8 +107,8 @@ public class Navigation {
}
enum Position {
BOTTOM(HtmlConstants.START_OF_BOTTOM_NAVBAR, HtmlConstants.END_OF_BOTTOM_NAVBAR),
TOP(HtmlConstants.START_OF_TOP_NAVBAR, HtmlConstants.END_OF_TOP_NAVBAR);
BOTTOM(MarkerComments.START_OF_BOTTOM_NAVBAR, MarkerComments.END_OF_BOTTOM_NAVBAR),
TOP(MarkerComments.START_OF_TOP_NAVBAR, MarkerComments.END_OF_TOP_NAVBAR);
final Content startOfNav;
final Content endOfNav;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -304,8 +304,8 @@ public class SerializedFormBuilder extends AbstractBuilder {
Content noCustomizationMsg = methodWriter.getNoCustomizationMsg(
resources.getText("doclet.Serializable_no_customization"));
classContentTree.addContent(methodWriter.getSerializableMethods(
resources.getText("doclet.Serialized_Form_methods"),
noCustomizationMsg));
resources.getText("doclet.Serialized_Form_methods"),
noCustomizationMsg));
}
}
}

View File

@ -296,25 +296,32 @@ ul.subNavList li {
/*
* Styles for headings.
*/
div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
div.details ul.blockList ul.blockList ul.blockList li.blockList h3,
div.details ul.blockList ul.blockList ul.blockListLast li.blockList h3,
div.serializedFormContainer ul.blockList ul.blockList ul.blockList li.blockList h4 {
background-color:#dee3e9;
border:1px solid #d0d9e0;
margin:0 0 6px -8px;
padding:7px 5px;
}
ul.blockList ul.blockList ul.blockList li.blockList h3 {
div.details h2,
div.summary h2 {
font-style: italic;
}
div.details h3,
div.summary h3 {
font-style: normal;
}
ul.blockList ul.blockList ul.blockList li.blockList h2 {
background-color:#dee3e9;
border:1px solid #d0d9e0;
margin:0 0 6px -8px;
padding:7px 5px;
}
ul.blockList ul.blockList li.blockList h3 {
ul.blockList ul.blockList li.blockList h2 {
padding:0;
margin:15px 0;
}
ul.blockList li.blockList h2 {
padding:0px 0 20px 0;
}
/*
* Styles for page layout containers.
*/
@ -597,7 +604,8 @@ th.colDeprecatedItemName a:link, th.colDeprecatedItemName a:visited,
.docSummary {
padding:0;
}
ul.blockList ul.blockList ul.blockList li.blockList h3 {
ul.blockList ul.blockList ul.blockList li.blockList h3,
ul.blockList ul.blockList ul.blockListLast li.blockList h3 {
font-style:normal;
}
div.block {

View File

@ -57,11 +57,11 @@ public class TestAnnotationTypes extends JavadocTester {
+ "<li><a href=\"#annotation.type."
+ "field.detail\">Field</a>&nbsp;|&nbsp;</li>",
"<!-- =========== ANNOTATION TYPE FIELD SUMMARY =========== -->",
"<h3>Field Summary</h3>",
"<h2>Field Summary</h2>",
"<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#DEFAULT_NAME\">DEFAULT_NAME</a></span>"
+ "</code></th>",
"<!-- ============ ANNOTATION TYPE FIELD DETAIL =========== -->",
"<h4>DEFAULT_NAME</h4>\n"
"<h3>DEFAULT_NAME</h3>\n"
+ "<pre>static final&nbsp;java."
+ "lang.String&nbsp;DEFAULT_NAME</pre>");
@ -77,13 +77,13 @@ public class TestAnnotationTypes extends JavadocTester {
"<li class=\"blockList\"><a id=\"annotation.type.element.detail\">",
"<!-- -->",
"</a>",
"<h3>Element Detail</h3>",
"<h2>Element Detail</h2>",
"<a id=\"value()\">",
"<!-- -->",
"</a>",
"<ul class=\"blockListLast\">",
"<li class=\"blockList\">",
"<h4>value</h4>",
"<h3>value</h3>",
"<pre>int&nbsp;value</pre>" );
checkOutput("pkg/AnnotationType.html", false,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -37,23 +37,6 @@ import javadoc.tester.JavadocTester;
public class TestHeadings extends JavadocTester {
private static final String[][] TEST = {
{
},
{ "serialized-form.html"
},
{ "serialized-form.html"
},
{
},
{ "overview-frame.html"
},
{
}
};
public static void main(String... args) throws Exception {
TestHeadings tester = new TestHeadings();
tester.runTests();
@ -108,7 +91,7 @@ public class TestHeadings extends JavadocTester {
"<h2 title=\"Package\">Package&nbsp;pkg1</h2>",
"<h3>Class <a href=\"pkg1/C1.html\" title=\"class in pkg1\">"
+ "pkg1.C1</a> extends java.lang.Object implements Serializable</h3>",
"<h3>Serialized Fields</h3>");
"<h4>Serialized Fields</h4>");
// Overview Frame
checkOutput("overview-frame.html", true,

View File

@ -67,8 +67,8 @@ public class TestHiddenTag extends JavadocTester {
checkOutput("pkg1/A.VisibleInner.html", true,
"<code><a href=\"A.html#visibleField\">visibleField</a></code>",
"<code><a href=\"A.html#visibleMethod()\">visibleMethod</a></code>",
"<h3>Nested classes/interfaces inherited from class&nbsp;pkg1." +
"<a href=\"A.html\" title=\"class in pkg1\">A</a></h3>\n" +
"<h2>Nested classes/interfaces inherited from class&nbsp;pkg1." +
"<a href=\"A.html\" title=\"class in pkg1\">A</a></h2>\n" +
"<code><a href=\"A.VisibleInner.html\" title=\"class in pkg1\">" +
"A.VisibleInner</a>, <a href=\"A.VisibleInnerExtendsInvisibleInner.html\" " +
"title=\"class in pkg1\">A.VisibleInnerExtendsInvisibleInner</a></code></li>\n" +

View File

@ -75,7 +75,7 @@ public class TestHref extends JavadocTester {
checkOutput("pkg/C4.html", true,
//Header does not link to the page itself.
"Class C4&lt;E extends C4&lt;E&gt;&gt;</h2>",
"Class C4&lt;E extends C4&lt;E&gt;&gt;</h1>",
//Signature does not link to the page itself.
"public abstract class <span class=\"typeNameLabel\">C4&lt;E extends C4&lt;E&gt;&gt;</span>"
);

View File

@ -109,7 +109,7 @@ public class TestHtmlLandmarkRegions extends JavadocTester {
Path srcDir = base.resolve("src");
createPackages(srcDir);
Path outDir = base.resolve("out3");
Path outDir = base.resolve("out");
javadoc("-d", outDir.toString(),
"-doctitle", "Document Title",
"-header", "Test Header",
@ -153,7 +153,7 @@ public class TestHtmlLandmarkRegions extends JavadocTester {
+ " </body>\n"
+ "</html>"));
Path outDir = base.resolve("out5");
Path outDir = base.resolve("out");
javadoc("-d", outDir.toString(),
"-sourcepath", srcDir.toString(),
"pkg1", "pkg2");
@ -171,12 +171,12 @@ public class TestHtmlLandmarkRegions extends JavadocTester {
void createModules(Path srcDir) throws Exception {
new ModuleBuilder(tb, "m1")
.classes("package p1; public class a{}")
.classes("package p2; public class b{}")
.classes("package p1; public class a { }")
.classes("package p2; public class b { }")
.write(srcDir);
new ModuleBuilder(tb, "m2")
.classes("package p3; public class c{}")
.classes("package p4; public class d{}")
.classes("package p3; public class c { }")
.classes("package p4; public class d { }")
.write(srcDir);
}

View File

@ -349,46 +349,46 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a id=\"nested.class.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Nested Class Summary</h3>\n"
+ "<h2>Nested Class Summary</h2>\n"
+ "<div class=\"memberSummary\">\n<table>",
"<section role=\"region\">\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a id=\"field.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Field Summary</h3>\n"
+ "<h2>Field Summary</h2>\n"
+ "<div class=\"memberSummary\">\n<table>",
"<section role=\"region\">\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Constructor Summary</h3>\n"
+ "<h2>Constructor Summary</h2>\n"
+ "<div class=\"memberSummary\">\n<table>",
"<section role=\"region\">\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a id=\"method.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Method Summary</h3>",
+ "<h2>Method Summary</h2>",
"<section role=\"region\">\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a id=\"field.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Field Detail</h3>",
+ "<h2>Field Detail</h2>",
"<section role=\"region\">\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Constructor Detail</h3>",
+ "<h2>Constructor Detail</h2>",
"<section role=\"region\">\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a id=\"method.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Method Detail</h3>",
+ "<h2>Method Detail</h2>",
"<footer role=\"contentinfo\">\n"
+ "<nav role=\"navigation\">\n"
+ "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
@ -411,7 +411,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a id=\"enum.constant.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Enum Constant Summary</h3>\n"
+ "<h2>Enum Constant Summary</h2>\n"
+ "<div class=\"memberSummary\">\n",
"<table aria-labelledby=\"t0\">\n",
"<section role=\"region\">\n"
@ -419,7 +419,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a id=\"method.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Method Summary</h3>\n"
+ "<h2>Method Summary</h2>\n"
+ "<div class=\"memberSummary\">\n",
"<table aria-labelledby=\"t0\">",
"<section role=\"region\">\n"
@ -427,13 +427,13 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a id=\"enum.constant.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Enum Constant Detail</h3>",
+ "<h2>Enum Constant Detail</h2>",
"<section role=\"region\">\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a id=\"method.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Method Detail</h3>",
+ "<h2>Method Detail</h2>",
"<footer role=\"contentinfo\">\n"
+ "<nav role=\"navigation\">\n"
+ "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
@ -456,7 +456,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a id=\"method.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Method Summary</h3>\n"
+ "<h2>Method Summary</h2>\n"
+ "<div class=\"memberSummary\">\n",
"<table aria-labelledby=\"t0\">\n",
"<section role=\"region\">\n"
@ -464,7 +464,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a id=\"method.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Method Detail</h3>",
+ "<h2>Method Detail</h2>",
"<footer role=\"contentinfo\">\n"
+ "<nav role=\"navigation\">\n"
+ "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
@ -487,13 +487,13 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Constructor Summary</h3>",
+ "<h2>Constructor Summary</h2>",
"<section role=\"region\">\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Constructor Detail</h3>",
+ "<h2>Constructor Detail</h2>",
"<footer role=\"contentinfo\">\n"
+ "<nav role=\"navigation\">\n"
+ "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
@ -516,13 +516,13 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Constructor Summary</h3>",
+ "<h2>Constructor Summary</h2>",
"<section role=\"region\">\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Constructor Detail</h3>",
+ "<h2>Constructor Detail</h2>",
"<footer role=\"contentinfo\">\n"
+ "<nav role=\"navigation\">\n"
+ "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
@ -545,21 +545,21 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a id=\"annotation.type.required.element.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Required Element Summary</h3>\n"
+ "<h2>Required Element Summary</h2>\n"
+ "<div class=\"memberSummary\">\n<table>",
"<section role=\"region\">\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a id=\"annotation.type.optional.element.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Optional Element Summary</h3>\n"
+ "<h2>Optional Element Summary</h2>\n"
+ "<div class=\"memberSummary\">\n<table>",
"<section role=\"region\">\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a id=\"annotation.type.element.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Element Detail</h3>",
+ "<h2>Element Detail</h2>",
"<footer role=\"contentinfo\">\n"
+ "<nav role=\"navigation\">\n"
+ "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
@ -581,7 +581,7 @@ public class TestHtmlVersion extends JavadocTester {
"<section role=\"region\"><a id=\"pkg\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+ "<h2>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h2>\n"
+ "<div class=\"useSummary\">\n<table>",
"<footer role=\"contentinfo\">\n"
+ "<nav role=\"navigation\">\n"
@ -823,7 +823,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"nested.class.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Nested Class Summary</h3>\n"
+ "<h2>Nested Class Summary</h2>\n"
+ "<div class=\"memberSummary\">\n"
+ "<table summary=\"Nested Class Summary table, listing nested classes, and an explanation\">",
"<!-- =========== FIELD SUMMARY =========== -->\n"
@ -831,7 +831,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"field.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Field Summary</h3>\n"
+ "<h2>Field Summary</h2>\n"
+ "<div class=\"memberSummary\">\n"
+ "<table summary=\"Field Summary table, listing fields, and an explanation\">",
"<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n"
@ -839,7 +839,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Constructor Summary</h3>\n"
+ "<h2>Constructor Summary</h2>\n"
+ "<div class=\"memberSummary\">\n"
+ "<table summary=\"Constructor Summary table, listing constructors, and an explanation\">",
"<!-- ========== METHOD SUMMARY =========== -->\n"
@ -847,7 +847,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"method.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Method Summary</h3>\n"
+ "<h2>Method Summary</h2>\n"
+ "<div class=\"memberSummary\">\n"
+ "<table summary=\"Method Summary table, listing methods, and an explanation\">",
"<!-- ============ FIELD DETAIL =========== -->\n"
@ -855,19 +855,19 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"field.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Field Detail</h3>",
+ "<h2>Field Detail</h2>",
"<!-- ========= CONSTRUCTOR DETAIL ======== -->\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a name=\"constructor.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Constructor Detail</h3>",
+ "<h2>Constructor Detail</h2>",
"<!-- ============ METHOD DETAIL ========== -->\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a name=\"method.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Method Detail</h3>");
+ "<h2>Method Detail</h2>");
// Negated test for enum page
checkOutput("pkg/AnotherClass.ModalExclusionType.html", false,
@ -883,7 +883,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"enum.constant.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Enum Constant Summary</h3>\n"
+ "<h2>Enum Constant Summary</h2>\n"
+ "<div class=\"memberSummary\">\n"
+ "<table summary=\"Enum Constant Summary table, listing enum constants, and an explanation\">",
"<!-- ========== METHOD SUMMARY =========== -->\n"
@ -891,7 +891,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"method.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Method Summary</h3>\n"
+ "<h2>Method Summary</h2>\n"
+ "<div class=\"memberSummary\">\n"
+ "<table summary=\"Method Summary table, listing methods, and an explanation\">",
"<!-- ============ ENUM CONSTANT DETAIL =========== -->\n"
@ -899,13 +899,13 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"enum.constant.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Enum Constant Detail</h3>",
+ "<h2>Enum Constant Detail</h2>",
"<!-- ============ METHOD DETAIL ========== -->\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a name=\"method.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Method Detail</h3>");
+ "<h2>Method Detail</h2>");
// Negated test for interface page
checkOutput("pkg2/Interface.html", false,
@ -921,7 +921,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"method.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Method Summary</h3>\n"
+ "<h2>Method Summary</h2>\n"
+ "<div class=\"memberSummary\">\n"
+ "<table summary=\"Method Summary table, listing methods, and an explanation\">",
"<!-- ============ METHOD DETAIL ========== -->\n"
@ -929,7 +929,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"method.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Method Detail</h3>");
+ "<h2>Method Detail</h2>");
// Negated test for error page
checkOutput("pkg/TestError.html", false,
@ -945,13 +945,13 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Constructor Summary</h3>",
+ "<h2>Constructor Summary</h2>",
"<!-- ========= CONSTRUCTOR DETAIL ======== -->\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a name=\"constructor.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Constructor Detail</h3>");
+ "<h2>Constructor Detail</h2>");
// Negated test for exception page
checkOutput("pkg/TestException.html", false,
@ -967,13 +967,13 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Constructor Summary</h3>",
+ "<h2>Constructor Summary</h2>",
"<!-- ========= CONSTRUCTOR DETAIL ======== -->\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a name=\"constructor.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Constructor Detail</h3>");
+ "<h2>Constructor Detail</h2>");
// Negated test for annotation page
checkOutput("pkg2/TestAnnotationType.html", false,
@ -989,7 +989,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"annotation.type.required.element.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Required Element Summary</h3>\n"
+ "<h2>Required Element Summary</h2>\n"
+ "<div class=\"memberSummary\">\n"
+ "<table summary=\"Required Element Summary table, listing required elements, and an explanation\">",
"<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->\n"
@ -997,7 +997,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"annotation.type.optional.element.summary\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Optional Element Summary</h3>\n"
+ "<h2>Optional Element Summary</h2>\n"
+ "<div class=\"memberSummary\">\n"
+ "<table summary=\"Optional Element Summary table, listing optional elements, and an explanation\">",
"<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->\n"
@ -1005,7 +1005,7 @@ public class TestHtmlVersion extends JavadocTester {
+ "<li class=\"blockList\"><a name=\"annotation.type.element.detail\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Element Detail</h3>");
+ "<h2>Element Detail</h2>");
// Negated test for class use page
checkOutput("pkg1/class-use/RegClass.html", false,
@ -1027,7 +1027,7 @@ public class TestHtmlVersion extends JavadocTester {
"<li class=\"blockList\"><a name=\"pkg\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<h3>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+ "<h2>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h2>\n"
+ "<div class=\"useSummary\">\n<table summary=\"Use table, listing fields, and an explanation\">");
// Negated test for main index page

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -75,12 +75,12 @@ public class TestIndexTaglet extends JavadocTester {
checkExit(Exit.OK);
checkOrder("pkg/A.html",
"<h3>Method Detail</h3>\n",
"<h2>Method Detail</h2>\n",
"<div class=\"block\">test description with <a id=\"search_phrase_a\" "
+ "class=\"searchTagResult\">search_phrase_a</a></div>");
checkOrder("pkg/A.html",
"<h3>Method Summary</h3>\n",
"<h2>Method Summary</h2>\n",
"<div class=\"block\">test description with search_phrase_a</div>");
}

View File

@ -131,7 +131,7 @@ public class TestInterface extends JavadocTester {
"<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n");
checkOutput("pkg/ClassWithStaticMembers.html", true,
"<h4>f</h4>\n"
"<h3>f</h3>\n"
+ "<pre>public static&nbsp;int f</pre>\n"
+ "<div class=\"block\">A hider field</div>",
@ -142,7 +142,7 @@ public class TestInterface extends JavadocTester {
+ "<div class=\"block\">A hider method</div>\n"
+ "</td>\n",
"<h4>staticMethod</h4>\n"
"<h3>staticMethod</h3>\n"
+ "<pre class=\"methodSignature\">public static&nbsp;void&nbsp;staticMethod()</pre>\n"
+ "<div class=\"block\"><span class=\"descfrmTypeLabel\">"
+ "Description copied from interface:&nbsp;<code>"
@ -183,8 +183,8 @@ public class TestInterface extends JavadocTester {
checkOutput("pkg2/Spliterator.OfDouble.html", true,
// Ensure the correct type parameters are displayed correctly
"<h3>Nested classes/interfaces inherited from interface&nbsp;pkg2."
+ "<a href=\"Spliterator.html\" title=\"interface in pkg2\">Spliterator</a></h3>\n"
"<h2>Nested classes/interfaces inherited from interface&nbsp;pkg2."
+ "<a href=\"Spliterator.html\" title=\"interface in pkg2\">Spliterator</a></h2>\n"
+ "<code><a href=\"Spliterator.OfDouble.html\" title=\"interface in pkg2\">"
+ "Spliterator.OfDouble</a>, <a href=\"Spliterator.OfInt.html\" "
+ "title=\"interface in pkg2\">Spliterator.OfInt</a>&lt;"

View File

@ -86,14 +86,14 @@ public class TestJavaFX extends JavadocTester {
+ "<a href=\"#pausedProperty\">paused</a></span></code></th>\n"
+ "<td class=\"colLast\">\n"
+ "<div class=\"block\">Defines if paused.</div>",
"<h4>paused</h4>\n"
"<h3>paused</h3>\n"
+ "<pre>public final&nbsp;<a href=\"C.BooleanProperty.html\" "
+ "title=\"class in pkg1\">C.BooleanProperty</a> pausedProperty</pre>\n"
+ "<div class=\"block\">Defines if paused. The second line.</div>",
"<h4>isPaused</h4>\n"
"<h3>isPaused</h3>\n"
+ "<pre class=\"methodSignature\">public final&nbsp;double&nbsp;isPaused()</pre>\n"
+ "<div class=\"block\">Gets the value of the property paused.</div>",
"<h4>setPaused</h4>\n"
"<h3>setPaused</h3>\n"
+ "<pre class=\"methodSignature\">public final&nbsp;void&nbsp;setPaused&#8203;(boolean&nbsp;value)</pre>\n"
+ "<div class=\"block\">Sets the value of the property paused.</div>\n"
+ "<dl>\n"
@ -101,7 +101,7 @@ public class TestJavaFX extends JavadocTester {
+ "<dd>Defines if paused. The second line.</dd>\n"
+ "<dt><span class=\"simpleTagLabel\">Default value:</span></dt>\n"
+ "<dd>false</dd>",
"<h4>isPaused</h4>\n"
"<h3>isPaused</h3>\n"
+ "<pre class=\"methodSignature\">public final&nbsp;double&nbsp;isPaused()</pre>\n"
+ "<div class=\"block\">Gets the value of the property paused.</div>\n"
+ "<dl>\n"
@ -109,13 +109,13 @@ public class TestJavaFX extends JavadocTester {
+ "<dd>Defines if paused. The second line.</dd>\n"
+ "<dt><span class=\"simpleTagLabel\">Default value:</span></dt>\n"
+ "<dd>false</dd>",
"<h4>rate</h4>\n"
"<h3>rate</h3>\n"
+ "<pre>public final&nbsp;<a href=\"C.DoubleProperty.html\" "
+ "title=\"class in pkg1\">C.DoubleProperty</a> rateProperty</pre>\n"
+ "<div class=\"block\">Defines the direction/speed at which the "
+ "<code>Timeline</code> is expected to\n"
+ " be played. This is the second line.</div>",
"<h4>setRate</h4>\n"
"<h3>setRate</h3>\n"
+ "<pre class=\"methodSignature\">public final&nbsp;void&nbsp;setRate&#8203;(double&nbsp;value)</pre>\n"
+ "<div class=\"block\">Sets the value of the property rate.</div>\n"
+ "<dl>\n"
@ -126,7 +126,7 @@ public class TestJavaFX extends JavadocTester {
+ "<dd>11</dd>\n"
+ "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
+ "<dd>JavaFX 8.0</dd>",
"<h4>getRate</h4>\n"
"<h3>getRate</h3>\n"
+ "<pre class=\"methodSignature\">public final&nbsp;double&nbsp;getRate()</pre>\n"
+ "<div class=\"block\">Gets the value of the property rate.</div>\n"
+ "<dl>\n"
@ -137,7 +137,7 @@ public class TestJavaFX extends JavadocTester {
+ "<dd>11</dd>\n"
+ "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
+ "<dd>JavaFX 8.0</dd>",
"<h3>Property Summary</h3>\n"
"<h2>Property Summary</h2>\n"
+ "<div class=\"memberSummary\">\n<table>\n"
+ "<caption><span>Properties</span><span class=\"tabEnd\">&nbsp;</span></caption>",
"<tr class=\"altColor\">\n"
@ -147,7 +147,7 @@ public class TestJavaFX extends JavadocTester {
checkOutput("pkg1/C.html", false,
"A()",
"<h3>Property Summary</h3>\n"
"<h2>Property Summary</h2>\n"
+ "<div class=\"memberSummary\">\n"
+ "<div role=\"tablist\" aria-orientation=\"horizontal\"><button role=\"tab\""
+ " aria-selected=\"true\" aria-controls=\"memberSummary_tabpanel\" tabindex=\"0\""
@ -190,13 +190,13 @@ public class TestJavaFX extends JavadocTester {
"pkg2");
checkExit(Exit.OK);
checkOutput("pkg2/Test.html", true,
"<h3>Property Detail</h3>\n"
"<h2>Property Detail</h2>\n"
+ "<a id=\"betaProperty\">\n"
+ "<!-- -->\n"
+ "</a>\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\">\n"
+ "<h4>beta</h4>\n"
+ "<h3>beta</h3>\n"
+ "<pre>public&nbsp;java.lang.Object betaProperty</pre>\n"
+ "</li>\n"
+ "</ul>\n"
@ -205,7 +205,7 @@ public class TestJavaFX extends JavadocTester {
+ "</a>\n"
+ "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\">\n"
+ "<h4>gamma</h4>\n"
+ "<h3>gamma</h3>\n"
+ "<pre>public final&nbsp;java.util.List&lt;java.lang.String&gt; gammaProperty</pre>\n"
+ "</li>\n"
+ "</ul>\n"
@ -214,19 +214,19 @@ public class TestJavaFX extends JavadocTester {
+ "</a>\n"
+ "<ul class=\"blockListLast\">\n"
+ "<li class=\"blockList\">\n"
+ "<h4>delta</h4>\n"
+ "<h3>delta</h3>\n"
+ "<pre>public final&nbsp;java.util.List&lt;"
+ "java.util.Set&lt;? super java.lang.Object&gt;&gt; deltaProperty</pre>\n"
+ "</li>\n"
+ "</ul>\n"
+ "</li>\n"
+ "</ul>",
"<h3>Property Summary</h3>\n"
"<h2>Property Summary</h2>\n"
+ "<div class=\"memberSummary\">\n<table>\n"
+ "<caption><span>Properties</span><span class=\"tabEnd\">&nbsp;</span></caption>");
checkOutput("pkg2/Test.html", false,
"<h3>Property Summary</h3>\n"
"<h2>Property Summary</h2>\n"
+ "<div class=\"memberSummary\">\n"
+ "<div role=\"tablist\" aria-orientation=\"horizontal\"><button role=\"tab\""
+ " aria-selected=\"true\" aria-controls=\"memberSummary_tabpanel\" tabindex=\"0\""
@ -250,7 +250,7 @@ public class TestJavaFX extends JavadocTester {
"-package",
"pkg2");
checkExit(Exit.OK);
checkOutput("pkg2/Test.html", false, "<h3>Property Summary</h3>");
checkOutput("pkg2/Test.html", false, "<h2>Property Summary</h2>");
checkOutput("pkg2/Test.html", true,
"<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n"
+ "<th class=\"colSecond\" scope=\"col\">Method</th>\n"

View File

@ -173,7 +173,7 @@ public class TestModuleServices extends JavadocTester {
checkExit(Exit.OK);
checkOutput("m/module-summary.html", false,
"<h3>Services</h3>");
"<h2>Services</h2>");
}
@Test
@ -194,7 +194,7 @@ public class TestModuleServices extends JavadocTester {
checkExit(Exit.OK);
checkOutput("m/module-summary.html", true,
"<h3>Services</h3>");
"<h2>Services</h2>");
checkOutput("m/module-summary.html", true,
"<div class=\"usesSummary\">\n<table>\n" +
@ -235,7 +235,7 @@ public class TestModuleServices extends JavadocTester {
checkExit(Exit.OK);
checkOutput("m/module-summary.html", true,
"<h3>Services</h3>");
"<h2>Services</h2>");
checkOutput("m/module-summary.html", true,
"<div class=\"usesSummary\">\n<table>\n" +
@ -276,7 +276,7 @@ public class TestModuleServices extends JavadocTester {
checkExit(Exit.OK);
checkOutput("m/module-summary.html", false,
"<h3>Services</h3>");
"<h2>Services</h2>");
}
@Test
@ -302,7 +302,7 @@ public class TestModuleServices extends JavadocTester {
checkExit(Exit.OK);
checkOutput("m/module-summary.html", true,
"<h3>Services</h3>");
"<h2>Services</h2>");
checkOutput("m/module-summary.html", true,
"<div class=\"providesSummary\">\n<table>\n" +
@ -346,7 +346,7 @@ public class TestModuleServices extends JavadocTester {
checkExit(Exit.OK);
checkOutput("m/module-summary.html", true,
"<h3>Services</h3>");
"<h2>Services</h2>");
checkOutput("m/module-summary.html", true,
"<div class=\"providesSummary\">\n<table>\n" +
@ -389,7 +389,7 @@ public class TestModuleServices extends JavadocTester {
checkExit(Exit.OK);
checkOutput("m/module-summary.html", true,
"<h3>Services</h3>");
"<h2>Services</h2>");
checkOutput("m/module-summary.html", true,
"<div class=\"providesSummary\">\n<table>\n" +

View File

@ -1261,7 +1261,7 @@ public class TestModules extends JavadocTester {
+ "<div class=\"block\">This is a test description for the test.moduleFullName.</div>\n"
+ "</dd>");
checkOutput("module-overview-frame.html", found,
"<h2 title=\"Modules\">Modules</h2>\n"
"<h1 title=\"Modules\">Modules</h1>\n"
+ "<ul title=\"Modules\">\n"
+ "<li><a href=\"moduleB/module-frame.html\" target=\"packageListFrame\" onclick=\"updateModuleFrame('moduleB/module-type-frame.html','moduleB/module-summary.html');\">moduleB</a></li>\n"
+ "<li><a href=\"test.moduleFullName/module-frame.html\" target=\"packageListFrame\" onclick=\"updateModuleFrame('test.moduleFullName/module-type-frame.html','test.moduleFullName/module-summary.html');\">test.moduleFullName</a></li>\n"

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 4789689 4905985 4927164 4827184 4993906 5004549 7025314 7010344 8025633 8026567 8162363
* 8175200 8186332 8182765 8196202 8187288 8173730
* 8175200 8186332 8182765 8196202 8187288 8173730 8215307
* @summary Run Javadoc on a set of source files that demonstrate new
* language features. Check the output to ensure that the new
* language features are properly documented.
@ -66,7 +66,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
void checkEnums() {
checkOutput("pkg/Coin.html", true,
// Make sure enum header is correct.
"Enum Coin</h2>",
"Enum Coin</h1>",
// Make sure enum signature is correct.
"<pre>public enum "
+ "<span class=\"typeNameLabel\">Coin</span>\n"
@ -110,7 +110,7 @@ public class TestNewLanguageFeatures extends JavadocTester {
void checkTypeParameters() {
checkOutput("pkg/TypeParameters.html", true,
// Make sure the header is correct.
"Class TypeParameters&lt;E&gt;</h2>",
"Class TypeParameters&lt;E&gt;</h1>",
// Check class type parameters section.
"<dt><span class=\"paramLabel\">Type Parameters:</span></dt>\n"
+ "<dd><code>E</code> - "

View File

@ -193,10 +193,10 @@ public class TestOptions extends JavadocTester {
"<pre>@Documented\npublic @interface <a href="
+ "\"../src-html/linksource/AnnotationTypeField.html#line.31\">"
+ "AnnotationTypeField</a></pre>",
"<h4>DEFAULT_NAME</h4>\n<pre>static final&nbsp;java.lang.String&nbsp;"
"<h3>DEFAULT_NAME</h3>\n<pre>static final&nbsp;java.lang.String&nbsp;"
+ "<a href=\"../src-html/linksource/AnnotationTypeField.html#line.32\">"
+ "DEFAULT_NAME</a></pre>",
"<h4>name</h4>\n<pre>java.lang.String&nbsp;<a href="
"<h3>name</h3>\n<pre>java.lang.String&nbsp;<a href="
+ "\"../src-html/linksource/AnnotationTypeField.html#line.34\">name</a></pre>");
checkOutput("src-html/linksource/AnnotationTypeField.html", true,

View File

@ -551,107 +551,107 @@ public class TestOrdering extends JavadocTester {
checkExit(Exit.OK);
checkOrder("pkg5/AnnoFieldTest.html",
"<h3>Field Detail</h3>",
"<h2>Field Detail</h2>",
"<pre>static final&nbsp;int&nbsp;one</pre>",
"<pre>static final&nbsp;int&nbsp;two</pre>",
"<pre>static final&nbsp;int&nbsp;three</pre>",
"<pre>static final&nbsp;int&nbsp;four</pre>");
checkOrder("pkg5/AnnoOptionalTest.html",
"<h3>Optional Element Summary</h3>",
"<h2>Optional Element Summary</h2>",
"<a href=\"#four()\">four</a>",
"<a href=\"#one()\">one</a>",
"<a href=\"#three()\">three</a>",
"<a href=\"#two()\">two</a>",
"<h3>Element Detail</h3>",
"<h4>one</h4>",
"<h4>two</h4>",
"<h4>three</h4>",
"<h4>four</h4>");
"<h2>Element Detail</h2>",
"<h3>one</h3>",
"<h3>two</h3>",
"<h3>three</h3>",
"<h3>four</h3>");
checkOrder("pkg5/AnnoRequiredTest.html",
"<h3>Required Element Summary</h3>",
"<h2>Required Element Summary</h2>",
"<a href=\"#four()\">four</a>",
"<a href=\"#one()\">one</a>",
"<a href=\"#three()\">three</a>",
"<a href=\"#two()\">two</a>",
"<h3>Element Detail</h3>",
"<h4>one</h4>",
"<h4>two</h4>",
"<h4>three</h4>",
"<h4>four</h4>");
"<h2>Element Detail</h2>",
"<h3>one</h3>",
"<h3>two</h3>",
"<h3>three</h3>",
"<h3>four</h3>");
checkOrder("pkg5/CtorTest.html",
"<h3>Constructor Summary</h3>",
"<h2>Constructor Summary</h2>",
"<a href=\"#%3Cinit%3E(int)\"",
"<a href=\"#%3Cinit%3E(int,int)\"",
"<a href=\"#%3Cinit%3E(int,int,int)\"",
"<a href=\"#%3Cinit%3E(int,int,int,int)\"",
"<h3>Constructor Detail</h3>",
"<h2>Constructor Detail</h2>",
"<a id=\"&lt;init&gt;(int,int,int,int)\">",
"<a id=\"&lt;init&gt;(int,int,int)\">",
"<a id=\"&lt;init&gt;(int,int)\">",
"<a id=\"&lt;init&gt;(int)\">");
checkOrder("pkg5/EnumTest.html",
"<h3>Enum Constant Summary</h3>",
"<h2>Enum Constant Summary</h2>",
"<a href=\"#FOUR\">FOUR</a>",
"<a href=\"#ONE\">ONE</a>",
"<a href=\"#THREE\">THREE</a>",
"<a href=\"#TWO\">TWO</a>",
"<h3>Enum Constant Detail</h3>",
"<h4>ONE</h4>",
"<h4>TWO</h4>",
"<h4>THREE</h4>",
"<h4>FOUR</h4>");
"<h2>Enum Constant Detail</h2>",
"<h3>ONE</h3>",
"<h3>TWO</h3>",
"<h3>THREE</h3>",
"<h3>FOUR</h3>");
checkOrder("pkg5/FieldTest.html",
"<h3>Field Summary</h3>",
"<h2>Field Summary</h2>",
"<a href=\"#four\">four</a>",
"<a href=\"#one\">one</a>",
"<a href=\"#three\">three</a>",
"<a href=\"#two\">two</a>",
"<h3>Field Detail</h3>",
"<h4>one</h4>",
"<h4>two</h4>",
"<h4>three</h4>",
"<h4>four</h4>");
"<h2>Field Detail</h2>",
"<h3>one</h3>",
"<h3>two</h3>",
"<h3>three</h3>",
"<h3>four</h3>");
checkOrder("pkg5/IntfTest.html",
"<h3>Method Summary</h3>",
"<h2>Method Summary</h2>",
"<a href=\"#four()\">four</a>",
"<a href=\"#one()\">one</a>",
"<a href=\"#three()\">three</a>",
"<a href=\"#two()\">two</a>",
"<h3>Method Detail</h3>",
"<h4>one</h4>",
"<h4>two</h4>",
"<h4>three</h4>",
"<h4>four</h4>");
"<h2>Method Detail</h2>",
"<h3>one</h3>",
"<h3>two</h3>",
"<h3>three</h3>",
"<h3>four</h3>");
checkOrder("pkg5/MethodTest.html",
"<h3>Method Summary</h3>",
"<h2>Method Summary</h2>",
"<a href=\"#four()\">four</a>",
"<a href=\"#one()\">one</a>",
"<a href=\"#three()\">three</a>",
"<a href=\"#two()\">two</a>",
"<h3>Method Detail</h3>",
"<h4>one</h4>",
"<h4>two</h4>",
"<h4>three</h4>",
"<h4>four</h4>");
"<h2>Method Detail</h2>",
"<h3>one</h3>",
"<h3>two</h3>",
"<h3>three</h3>",
"<h3>four</h3>");
checkOrder("pkg5/PropertyTest.html",
"<h3>Property Summary</h3>",
"<h2>Property Summary</h2>",
"<a href=\"#fourProperty\">four</a>",
"<a href=\"#oneProperty\">one</a>",
"<a href=\"#threeProperty\">three</a>",
"<a href=\"#twoProperty\">two</a>",
"<h3>Property Detail</h3>",
"<h4>oneProperty</h4>",
"<h4>twoProperty</h4>",
"<h4>threeProperty</h4>",
"<h4>fourProperty</h4>");
"<h2>Property Detail</h2>",
"<h3>oneProperty</h3>",
"<h3>twoProperty</h3>",
"<h3>threeProperty</h3>",
"<h3>fourProperty</h3>");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -53,7 +53,7 @@ public class TestBadOverride extends JavadocTester {
checkOutput("pkg4/Foo.html", true,
"<li class=\"blockList\">\n"
+ "<h4>toString</h4>\n"
+ "<h3>toString</h3>\n"
+ "<pre class=\"methodSignature\">public&nbsp;void&nbsp;toString()</pre>\n"
+ "<div class=\"block\">Why can't I do this ?</div>\n"
+ "</li>");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 4341304 4485668 4966728 8032066 8071982 8192933
* @bug 4341304 4485668 4966728 8032066 8071982 8192933 8215307
* @summary Test that methods readResolve and writeReplace show
* up in serialized-form.html the same way that readObject and writeObject do.
* If the doclet includes readResolve and writeReplace in the serialized-form
@ -109,6 +109,8 @@ public class TestSerializedForm extends JavadocTester {
testSrc("SerializedForm.java"), testSrc("ExternalizedForm.java"), "pkg1");
checkExit(Exit.OK);
showHeadings("serialized-form.html");
checkOutput("serialized-form.html", true,
"<h3>Class <a href=\"pkg1/NestedInnerClass.InnerClass.ProNestedInnerClass.html\" "
+ "title=\"class in pkg1\">pkg1.NestedInnerClass.InnerClass.ProNestedInnerClass</a> "
@ -130,15 +132,15 @@ public class TestSerializedForm extends JavadocTester {
+ "extends java.lang.Object implements Serializable</h3>");
checkOutput("serialized-form.html", true,
"<h3>Serialized Fields</h3>\n" +
"<h4>Serialized Fields</h4>\n" +
"<ul class=\"blockList\">\n" +
"<li class=\"blockList\">\n" +
"<h4>longs</h4>\n" +
"<h5>longs</h5>\n" +
"<pre>Long[] longs</pre>\n" +
"<div class=\"block\">the longs</div>\n" +
"</li>\n" +
"<li class=\"blockListLast\">\n" +
"<h4>name</h4>\n" +
"<h5>name</h5>\n" +
"<pre>java.lang.String name</pre>\n" +
"<div class=\"block\">a test</div>");
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -51,6 +51,6 @@ public class TestSummaryHeading extends JavadocTester {
checkExit(Exit.OK);
checkOutput("C.html", true,
"<h3>Method Summary</h3>");
"<h2>Method Summary</h2>");
}
}

View File

@ -86,7 +86,7 @@ public class TestSummaryTag extends JavadocTester {
// make sure the second @summary's content is displayed correctly
checkOutput("p1/A.html", true,
"<li class=\"blockList\">\n"
+ "<h4>m3</h4>\n"
+ "<h3>m3</h3>\n"
+ "<pre class=\"methodSignature\">public&nbsp;void&nbsp;m3()</pre>\n"
+ "<div class=\"block\">First sentence some text maybe second sentence.</div>\n"
+ "</li>\n"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -76,9 +76,9 @@ public class TestSystemPropertyTaglet extends JavadocTester {
checkExit(Exit.OK);
checkOrder("pkg/A.html",
"<h2 title=\"Class A\" class=\"title\">Class A</h2>",
"<h1 title=\"Class A\" class=\"title\">Class A</h1>",
"test with <code><a id=\"user.name\" class=\"searchTagResult\">user.name</a></code>",
"<h3>Method Detail</h3>",
"<h2>Method Detail</h2>",
"test with <code><a id=\"java.version\" class=\"searchTagResult\">java.version</a></code>");
checkOrder("index-all.html",

View File

@ -232,7 +232,7 @@ public abstract class JavadocTester {
private DirectoryCheck outputDirectoryCheck = DirectoryCheck.EMPTY;
private boolean automaticCheckAccessibility = false;
private boolean automaticCheckAccessibility = true;
private boolean automaticCheckLinks = true;
/** The current subtest number. Incremented when checking(...) is called. */
@ -261,7 +261,7 @@ public abstract class JavadocTester {
}
/**
* Run all methods annotated with @Test, followed by printSummary.
* Runs all methods annotated with @Test, followed by printSummary.
* Typically called on a tester object in main()
* @param f a function which will be used to provide arguments to each
* invoked method
@ -285,7 +285,7 @@ public abstract class JavadocTester {
}
/**
* Run javadoc.
* Runs javadoc.
* The output directory used by this call and the final exit code
* will be saved for later use.
* To aid the reader, it is recommended that calls to this method
@ -391,7 +391,7 @@ public abstract class JavadocTester {
}
/**
* Set the kind of check for the initial contents of the output directory
* Sets the kind of check for the initial contents of the output directory
* before javadoc is run.
* The filter should return true for files that should <b>not</b> appear.
* @param c the kind of check to perform
@ -401,7 +401,14 @@ public abstract class JavadocTester {
}
/**
* Set whether or not to perform an automatic call of checkLinks.
* Sets whether or not to perform an automatic call of checkAccessibility.
*/
public void setAutomaticCheckAccessibility(boolean b) {
automaticCheckAccessibility = b;
}
/**
* Sets whether or not to perform an automatic call of checkLinks.
*/
public void setAutomaticCheckLinks(boolean b) {
automaticCheckLinks = b;
@ -431,7 +438,7 @@ public abstract class JavadocTester {
}
/**
* Check the exit code of the most recent call of javadoc.
* Checks the exit code of the most recent call of javadoc.
*
* @param expected the exit code that is required for the test
* to pass.
@ -446,7 +453,7 @@ public abstract class JavadocTester {
}
/**
* Check for content in (or not in) the generated output.
* Checks for content in (or not in) the generated output.
* Within the search strings, the newline character \n
* will be translated to the platform newline character sequence.
* @param path a path within the most recent output directory
@ -465,7 +472,7 @@ public abstract class JavadocTester {
}
/**
* Check for content in (or not in) the generated output.
* Checks for content in (or not in) the generated output.
* Within the search strings, the newline character \n
* will be translated to the platform newline character sequence.
* @param path a path within the most recent output directory, identifying
@ -487,7 +494,7 @@ public abstract class JavadocTester {
}
/**
* Check for content in (or not in) the one of the output streams written by
* Checks for content in (or not in) the one of the output streams written by
* javadoc. Within the search strings, the newline character \n
* will be translated to the platform newline character sequence.
* @param output the output stream to check
@ -519,6 +526,11 @@ public abstract class JavadocTester {
}
}
/**
* Performs some structural accessibility checks on the files generated by the most
* recent run of javadoc.
* The checks can be run automatically by calling {@link #setAutomaticCheckAccessibility}.
*/
public void checkAccessibility() {
checking("Check accessibility");
A11yChecker c = new A11yChecker(out, this::readFile);
@ -536,6 +548,11 @@ public abstract class JavadocTester {
}
}
/**
* Checks all the links within the files generated by the most
* recent run of javadoc.
* The checks can be run automatically by calling {@link #setAutomaticCheckLinks}.
*/
public void checkLinks() {
checking("Check links");
LinkChecker c = new LinkChecker(out, this::readFile);
@ -554,7 +571,27 @@ public abstract class JavadocTester {
}
/**
* Get the content of the one of the output streams written by javadoc.
* Shows the heading structure for each of the specified files.
* The structure is is printed in plain text to the main output stream.
* No errors are reported (unless there is a problem reading a file)
* but missing headings are noted within the output.
* @params the files
*/
public void showHeadings(String... paths) {
ShowHeadings s = new ShowHeadings(out, this::readFile);
for (String p : paths) {
try {
File f = new File(outputDir, p);
s.checkFiles(List.of(f.toPath()), false, Collections.emptySet());
} catch (IOException e) {
checking("Read file");
failed("Error reading file: " + e);
}
}
}
/**
* Gets the content of the one of the output streams written by javadoc.
* @param output the name of the output stream
* @return the content of the output stream
*/
@ -563,7 +600,7 @@ public abstract class JavadocTester {
}
/**
* Get the content of the one of the output streams written by javadoc.
* Gets the content of the one of the output streams written by javadoc.
* @param output the name of the output stream
* @return the content of the output stream, as a line of lines
*/
@ -573,7 +610,7 @@ public abstract class JavadocTester {
}
/**
* Check for files in (or not in) the generated output.
* Checks for files in (or not in) the generated output.
* @param expectedFound true if all of the files are expected
* to be found, or false if all of the files are expected to be
* not found
@ -584,7 +621,7 @@ public abstract class JavadocTester {
}
/**
* Check for files in (or not in) the generated output.
* Checks for files in (or not in) the generated output.
* @param expectedFound true if all of the files are expected
* to be found, or false if all of the files are expected to be
* not found
@ -605,7 +642,7 @@ public abstract class JavadocTester {
}
/**
* Check that a series of strings are found in order in a file in
* Checks that a series of strings are found in order in a file in
* the generated output.
* @param path the file to check
* @param strings the strings whose order to check
@ -658,7 +695,7 @@ public abstract class JavadocTester {
}
/**
* Compare a set of files in each of two directories.
* Compares a set of files in each of two directories.
*
* @param baseDir1 the directory containing the first set of files
* @param baseDir2 the directory containing the second set of files
@ -673,7 +710,7 @@ public abstract class JavadocTester {
}
/**
* A utility to copy a directory from one place to another.
* Copies a directory from one place to another.
*
* @param targetDir the directory to copy.
* @param destDir the destination to copy the directory to.
@ -707,7 +744,7 @@ public abstract class JavadocTester {
}
/**
* Copy source file to destination file.
* Copies a file.
*
* @param destfile the destination file
* @param srcfile the source file
@ -749,7 +786,7 @@ public abstract class JavadocTester {
}
/**
* Read the file and return it as a string.
* Reads the file and return it as a string.
*
* @param baseDir the directory in which to locate the file
* @param fileName the name of the file to read
@ -825,7 +862,7 @@ public abstract class JavadocTester {
}
/**
* Print a summary of the test results.
* Prints a summary of the test results.
*/
protected void printSummary() {
String javadocRuns = (javadocRunNum <= 1) ? ""
@ -845,7 +882,7 @@ public abstract class JavadocTester {
}
/**
* Search for the string in the given file and return true
* Searches for the string in the given file and return true
* if the string was found.
*
* @param fileString the contents of the file to search through
@ -861,7 +898,7 @@ public abstract class JavadocTester {
}
/**
* Compare the two given files.
* Compares the two given files.
*
* @param baseDir1 the directory in which to locate the first file
* @param baseDir2 the directory in which to locate the second file

View File

@ -0,0 +1,102 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javadoc.tester;
import java.io.PrintStream;
import java.nio.file.Path;
import java.util.Map;
import java.util.function.Function;
public class ShowHeadings extends HtmlChecker {
private int currLevel;
private boolean copyContent;
ShowHeadings(PrintStream out, Function<Path,String> fileReader) {
super(out, fileReader);
}
@Override
public void report() {
}
@Override
public void startFile(Path path) {
out.println("Headings: " + path);
currLevel = 0;
}
@Override
public void endFile() {
}
@Override
public void docType(String doctype) {
}
@Override
public void startElement(String name, Map<String,String> attrs, boolean selfClosing) {
switch (name) {
case "h1": case "h2": case "h3": case "h4": case "h5": case "h6":
startHeading(name);
break;
}
}
@Override
public void endElement(String name) {
switch (name) {
case "h1": case "h2": case "h3": case "h4": case "h5": case "h6":
out.println();
copyContent = false;
break;
}
}
private void startHeading(String h) {
int level = Character.digit(h.charAt(1), 10);
while (level > currLevel + 1) {
currLevel++;
out.println("* ".repeat(currLevel - 1) + "H" + currLevel + ": *** MISSING ***");
}
currLevel = level;
out.print("* ".repeat(currLevel - 1) + "H" + currLevel + ": ");
copyContent = true;
}
@Override
public void content(String s) {
if (copyContent) {
out.print(s.replace("&nbsp;", " ")
.replace("&lt;", "<")
.replace("&gt;", ">")
.replace("&amp;", "&")
.replaceAll("\\s+", " ")
);
}
}
}