8242326: use new "summary-list" CSS class instead of general "block-list" for list of summary sections

Reviewed-by: hannesw
This commit is contained in:
Jonathan Gibbons 2020-04-13 10:54:12 -07:00
parent ea36a53b75
commit 7a608f40fc
25 changed files with 289 additions and 213 deletions

@ -74,9 +74,9 @@ public class AnnotationTypeOptionalMemberWriterImpl extends
}
@Override
public void addMemberTree(Content memberSummaryTree, Content memberTree) {
writer.addMemberTree(HtmlStyle.memberSummary,
SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY, memberSummaryTree, memberTree);
public void addSummary(Content summariesList, Content content) {
writer.addSummary(HtmlStyle.memberSummary,
SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY, summariesList, content);
}
@Override

@ -79,9 +79,9 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
}
@Override
public void addMemberTree(Content memberSummaryTree, Content memberTree) {
writer.addMemberTree(HtmlStyle.memberSummary,
SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY, memberSummaryTree, memberTree);
public void addSummary(Content summariesList, Content content) {
writer.addSummary(HtmlStyle.memberSummary,
SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY, summariesList, content);
}
@Override

@ -99,9 +99,9 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
}
@Override
public void addMemberTree(Content memberSummaryTree, Content memberTree) {
writer.addMemberTree(HtmlStyle.constructorSummary,
SectionName.CONSTRUCTOR_SUMMARY, memberSummaryTree, memberTree);
public void addSummary(Content summariesList, Content content) {
writer.addSummary(HtmlStyle.constructorSummary,
SectionName.CONSTRUCTOR_SUMMARY, summariesList, content);
}
@Override

@ -69,9 +69,9 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
}
@Override
public void addMemberTree(Content memberSummaryTree, Content memberTree) {
writer.addMemberTree(HtmlStyle.constantsSummary,
SectionName.ENUM_CONSTANT_SUMMARY, memberSummaryTree, memberTree);
public void addSummary(Content summariesList, Content content) {
writer.addSummary(HtmlStyle.constantsSummary,
SectionName.ENUM_CONSTANT_SUMMARY, summariesList, content);
}
@Override

@ -72,9 +72,9 @@ public class FieldWriterImpl extends AbstractMemberWriter
}
@Override
public void addMemberTree(Content memberSummaryTree, Content memberTree) {
writer.addMemberTree(HtmlStyle.fieldSummary,
SectionName.FIELD_SUMMARY, memberSummaryTree, memberTree);
public void addSummary(Content summariesList, Content content) {
writer.addSummary(HtmlStyle.fieldSummary,
SectionName.FIELD_SUMMARY, summariesList, content);
}
@Override

@ -115,12 +115,6 @@ public class MarkerComments {
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 Comment START_OF_ANNOTATION_TYPE_FIELD_SUMMARY =
new Comment("=========== ANNOTATION TYPE FIELD SUMMARY ===========");
/**
* Marker to identify start of constructor summary.
*/

@ -85,9 +85,9 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
}
@Override
public void addMemberTree(Content memberSummaryTree, Content memberTree) {
writer.addMemberTree(HtmlStyle.methodSummary,
SectionName.METHOD_SUMMARY, memberSummaryTree, memberTree);
public void addSummary(Content summariesList, Content content) {
writer.addSummary(HtmlStyle.methodSummary,
SectionName.METHOD_SUMMARY, summariesList, content);
}
@Override

@ -224,10 +224,8 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
* Get the summary section header.
*/
@Override
public Content getSummaryHeader() {
HtmlTree ul = new HtmlTree(TagName.UL);
ul.setStyle(HtmlStyle.blockList);
return ul;
public Content getSummariesList() {
return new HtmlTree(TagName.UL).setStyle(HtmlStyle.summaryList);
}
/**
@ -483,7 +481,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
}
@Override
public void addModulesSummary(Content summaryContentTree) {
public void addModulesSummary(Content summariesList) {
if (display(requires) || display(indirectModules)) {
TableHeader requiresTableHeader =
new TableHeader(contents.modifierLabel, contents.moduleLabel,
@ -514,7 +512,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
addModulesList(indirectModules, amrTable);
section.add(amrTable);
}
summaryContentTree.add(HtmlTree.LI(section));
summariesList.add(HtmlTree.LI(section));
}
}
@ -535,7 +533,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
}
@Override
public void addPackagesSummary(Content summaryContentTree) {
public void addPackagesSummary(Content summariesList) {
if (display(packages)
|| display(indirectPackages) || display(indirectOpenPackages)) {
HtmlTree section = HtmlTree.SECTION(HtmlStyle.packagesSummary)
@ -560,7 +558,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
addIndirectPackages(aopTable, indirectOpenPackages);
section.add(aopTable);
}
summaryContentTree.add(HtmlTree.LI(section));
summariesList.add(HtmlTree.LI(section));
}
}
@ -706,7 +704,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
}
@Override
public void addServicesSummary(Content summaryContentTree) {
public void addServicesSummary(Content summariesList) {
boolean haveUses = displayServices(uses, usesTrees);
boolean haveProvides = displayServices(provides.keySet(), providesTrees);
@ -735,7 +733,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
section.add(table);
}
}
summaryContentTree.add(HtmlTree.LI(section));
summariesList.add(HtmlTree.LI(section));
}
}

@ -70,9 +70,9 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
}
@Override
public void addMemberTree(Content memberSummaryTree, Content memberTree) {
writer.addMemberTree(HtmlStyle.nestedClassSummary,
SectionName.NESTED_CLASS_SUMMARY, memberSummaryTree, memberTree);
public void addSummary(Content summariesList, Content content) {
writer.addSummary(HtmlStyle.nestedClassSummary,
SectionName.NESTED_CLASS_SUMMARY, summariesList, content);
}
@Override

@ -160,10 +160,8 @@ public class PackageWriterImpl extends HtmlDocletWriter
}
@Override
public Content getSummaryHeader() {
HtmlTree ul = new HtmlTree(TagName.UL);
ul.setStyle(HtmlStyle.blockList);
return ul;
public Content getSummariesList() {
return new HtmlTree(TagName.UL).setStyle(HtmlStyle.summaryList);
}
@Override

@ -64,9 +64,9 @@ public class PropertyWriterImpl extends AbstractMemberWriter
}
@Override
public void addMemberTree(Content memberSummaryTree, Content memberTree) {
writer.addMemberTree(HtmlStyle.propertySummary,
SectionName.PROPERTY_SUMMARY, memberSummaryTree, memberTree);
public void addSummary(Content summariesList, Content content) {
writer.addSummary(HtmlStyle.propertySummary,
SectionName.PROPERTY_SUMMARY, summariesList, content);
}
@Override

@ -212,6 +212,26 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
return ul;
}
/**
* Returns a list to be used for the list of summaries for members of a given kind.
*
* @return a list to be used for the list of summaries for members of a given kind
*/
public Content getSummariesList() {
return new HtmlTree(TagName.UL).setStyle(HtmlStyle.summaryList);
}
/**
* Returns an item for the list of summaries for members of a given kind.
*
* @param content content for the item
* @return an item for the list of summaries for members of a given kind
*/
public Content getSummariesListItem(Content content) {
return HtmlTree.LI(content);
}
/**
* Returns a list to be used for the list of details for members of a given kind.
*
@ -257,16 +277,17 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
}
/**
* Adds the member tree with css style and id attribute.
* @param style the css style to be applied to member tree
* @param sectionName the section name to use for the section id attribute
* @param memberSummaryTree the content tree representing the member summary
* @param memberTree the content tree representing the member
* Adds a section for a summary tree with the given CSS {@code class} and {@code id} attribute.
*
* @param style the CSS class for the section
* @param sectionName the section name to use for the section id attribute
* @param summariesList the list of summary sections to which the summary will be added
* @param content the content tree representing the summary
*/
public void addMemberTree(HtmlStyle style, SectionName sectionName, Content memberSummaryTree, Content memberTree) {
HtmlTree htmlTree = HtmlTree.SECTION(style, memberTree)
public void addSummary(HtmlStyle style, SectionName sectionName, Content summariesList, Content content) {
HtmlTree htmlTree = HtmlTree.SECTION(style, content)
.setId(sectionName.getName());
memberSummaryTree.add(getMemberTree(htmlTree));
summariesList.add(getSummariesListItem(htmlTree));
}
/**

@ -123,6 +123,7 @@ public enum HtmlStyle {
subNavList,
subTitle,
summary,
summaryList,
systemPropertiesSummary,
tabEnd,
tableTab,

@ -171,6 +171,21 @@ public interface ClassWriter {
*/
Content getMemberTreeHeader();
/**
* Returns a list to be used for the list of summaries for members of a given kind.
*
* @return a list to be used for the list of summaries for members of a given kind
*/
Content getSummariesList();
/**
* Returns an item for the list of summaries for members of a given kind.
*
* @param content content for the item
* @return an item for the list of summaries for members of a given kind
*/
Content getSummariesListItem(Content content);
/**
* Returns a list to be used for the list of details for members of a given kind.
*

@ -99,12 +99,12 @@ public interface MemberSummaryWriter {
Content getInheritedSummaryLinksTree();
/**
* Add the member tree to the member summary tree.
* Adds the given summary to the list of summaries.
*
* @param memberSummaryTree the content tree representing the member summary
* @param memberTree the content tree representing the member
* @param summariesList the list of summaries
* @param content the summary
*/
void addMemberTree(Content memberSummaryTree, Content memberTree);
void addSummary(Content summariesList, Content content);
/**
* Get the member tree.

@ -58,7 +58,7 @@ public interface ModuleSummaryWriter {
*
* @return a content tree with the summary header
*/
Content getSummaryHeader();
Content getSummariesList();
/**
* Get the header for the summary tree.
@ -86,25 +86,25 @@ public interface ModuleSummaryWriter {
void addModuleTags(Content moduleContentTree);
/**
* Adds the modules summary to the documentation tree.
* Adds the summary of modules to the list of summaries.
*
* @param summaryContentTree the content tree to which the summary will be added
* @param summariesList the list of summaries
*/
void addModulesSummary(Content summaryContentTree);
void addModulesSummary(Content summariesList);
/**
* Adds the packages summary to the documentation tree.
* Adds the summary of packages to the list of summaries.
*
* @param summaryContentTree the content tree to which the summary will be added
* @param summariesList the list of summaries
*/
void addPackagesSummary(Content summaryContentTree);
void addPackagesSummary(Content summariesList);
/**
* Adds the services summary to the documentation tree.
* Adds the summary of services to the list of summaries.
*
* @param summaryContentTree the content tree to which the summary will be added
* @param summariesList the list of summaries
*/
void addServicesSummary(Content summaryContentTree);
void addServicesSummary(Content summariesList);
/**
* Adds the module content tree to the documentation tree.

@ -62,7 +62,7 @@ public interface PackageSummaryWriter {
*
* @return a content tree with the package summary header
*/
Content getSummaryHeader();
Content getSummariesList();
/**
* Adds the table of interfaces to the documentation tree.

@ -323,9 +323,9 @@ public class ClassBuilder extends AbstractBuilder {
* @throws DocletException if there is a problem while building the documentation
*/
protected void buildMemberSummary(Content classContentTree) throws DocletException {
Content memberSummaryTree = writer.getMemberTreeHeader();
builderFactory.getMemberSummaryBuilder(writer).build(memberSummaryTree);
classContentTree.add(writer.getMemberSummaryTree(memberSummaryTree));
Content summariesList = writer.getSummariesList();
builderFactory.getMemberSummaryBuilder(writer).build(summariesList);
classContentTree.add(writer.getMemberSummaryTree(summariesList));
}
/**

@ -100,15 +100,15 @@ public abstract class MemberSummaryBuilder extends AbstractMemberBuilder {
ClassWriter classWriter, Context context) {
MemberSummaryBuilder builder = new MemberSummaryBuilder(context, classWriter.getTypeElement()) {
@Override
public void build(Content contentTree) {
buildPropertiesSummary(contentTree);
buildNestedClassesSummary(contentTree);
buildEnumConstantsSummary(contentTree);
buildAnnotationTypeRequiredMemberSummary(contentTree);
buildAnnotationTypeOptionalMemberSummary(contentTree);
buildFieldsSummary(contentTree);
buildConstructorsSummary(contentTree);
buildMethodsSummary(contentTree);
public void build(Content summariesList) {
buildPropertiesSummary(summariesList);
buildNestedClassesSummary(summariesList);
buildEnumConstantsSummary(summariesList);
buildAnnotationTypeRequiredMemberSummary(summariesList);
buildAnnotationTypeOptionalMemberSummary(summariesList);
buildFieldsSummary(summariesList);
buildConstructorsSummary(summariesList);
buildMethodsSummary(summariesList);
}
@Override
@ -174,93 +174,83 @@ public abstract class MemberSummaryBuilder extends AbstractMemberBuilder {
}
/**
* Build the summary for the enum constants.
* Builds the summary for any optional members of an annotation type.
*
* @param memberSummaryTree the content tree to which the documentation will be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildEnumConstantsSummary(Content memberSummaryTree) {
MemberSummaryWriter writer = memberSummaryWriters.get(ENUM_CONSTANTS);
addSummary(writer, ENUM_CONSTANTS, false, memberSummaryTree);
}
/**
* Build the summary for fields.
*
* @param memberSummaryTree the content tree to which the documentation will be added
*/
protected void buildAnnotationTypeFieldsSummary(Content memberSummaryTree) {
MemberSummaryWriter writer = memberSummaryWriters.get(FIELDS);
addSummary(writer, FIELDS, false, memberSummaryTree);
}
/**
* Build the summary for the optional members.
*
* @param memberSummaryTree the content tree to which the documentation will be added
*/
protected void buildAnnotationTypeOptionalMemberSummary(Content memberSummaryTree) {
protected void buildAnnotationTypeOptionalMemberSummary(Content summariesList) {
MemberSummaryWriter writer = memberSummaryWriters.get(ANNOTATION_TYPE_MEMBER_OPTIONAL);
addSummary(writer, ANNOTATION_TYPE_MEMBER_OPTIONAL, false, memberSummaryTree);
addSummary(writer, ANNOTATION_TYPE_MEMBER_OPTIONAL, false, summariesList);
}
/**
* Build the summary for the optional members.
* Builds the summary for any required members of an annotation type.
*
* @param memberSummaryTree the content tree to which the documentation will be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildAnnotationTypeRequiredMemberSummary(Content memberSummaryTree) {
protected void buildAnnotationTypeRequiredMemberSummary(Content summariesList) {
MemberSummaryWriter writer = memberSummaryWriters.get(ANNOTATION_TYPE_MEMBER_REQUIRED);
addSummary(writer, ANNOTATION_TYPE_MEMBER_REQUIRED, false, memberSummaryTree);
addSummary(writer, ANNOTATION_TYPE_MEMBER_REQUIRED, false, summariesList);
}
/**
* Build the summary for the fields.
* Builds the summary for any enum constants of an enum type.
*
* @param memberSummaryTree the content tree to which the documentation will be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildFieldsSummary(Content memberSummaryTree) {
protected void buildEnumConstantsSummary(Content summariesList) {
MemberSummaryWriter writer = memberSummaryWriters.get(ENUM_CONSTANTS);
addSummary(writer, ENUM_CONSTANTS, false, summariesList);
}
/**
* Builds the summary for any fields.
*
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildFieldsSummary(Content summariesList) {
MemberSummaryWriter writer = memberSummaryWriters.get(FIELDS);
addSummary(writer, FIELDS, true, memberSummaryTree);
addSummary(writer, FIELDS, true, summariesList);
}
/**
* Build the summary for the fields.
* Builds the summary for any properties.
*
* @param memberSummaryTree the content tree to which the documentation will be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildPropertiesSummary(Content memberSummaryTree) {
protected void buildPropertiesSummary(Content summariesList) {
MemberSummaryWriter writer = memberSummaryWriters.get(PROPERTIES);
addSummary(writer, PROPERTIES, true, memberSummaryTree);
addSummary(writer, PROPERTIES, true, summariesList);
}
/**
* Build the summary for the nested classes.
* Builds the summary for any nested classes.
*
* @param memberSummaryTree the content tree to which the documentation will be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildNestedClassesSummary(Content memberSummaryTree) {
protected void buildNestedClassesSummary(Content summariesList) {
MemberSummaryWriter writer = memberSummaryWriters.get(INNER_CLASSES);
addSummary(writer, INNER_CLASSES, true, memberSummaryTree);
addSummary(writer, INNER_CLASSES, true, summariesList);
}
/**
* Build the method summary.
* Builds the summary for any methods.
*
* @param memberSummaryTree the content tree to which the documentation will be added
* @param summariesList the content tree to which the documentation will be added
*/
protected void buildMethodsSummary(Content memberSummaryTree) {
protected void buildMethodsSummary(Content summariesList) {
MemberSummaryWriter writer = memberSummaryWriters.get(METHODS);
addSummary(writer, METHODS, true, memberSummaryTree);
addSummary(writer, METHODS, true, summariesList);
}
/**
* Build the constructor summary.
* Builds the summary for any constructors.
*
* @param memberSummaryTree the content tree to which the documentation will be added
* @param summariesList the content tree to which the documentation will be added
*/
protected void buildConstructorsSummary(Content memberSummaryTree) {
protected void buildConstructorsSummary(Content summariesList) {
MemberSummaryWriter writer = memberSummaryWriters.get(CONSTRUCTORS);
addSummary(writer, CONSTRUCTORS, false, memberSummaryTree);
addSummary(writer, CONSTRUCTORS, false, summariesList);
}
/**
@ -444,26 +434,26 @@ public abstract class MemberSummaryBuilder extends AbstractMemberBuilder {
}
/**
* Add the summary for the documentation.
* Adds the summary for the documentation.
*
* @param writer the writer for this member summary.
* @param kind the kind of members to document.
* @param showInheritedSummary true if inherited summary should be documented
* @param memberSummaryTree the content tree to which the documentation will be added
* @param writer the writer for this member summary
* @param kind the kind of members to document
* @param showInheritedSummary true if a summary of any inherited elements should be documented
* @param summariesList the list of summaries to which the summary will be added
*/
private void addSummary(MemberSummaryWriter writer,
VisibleMemberTable.Kind kind,
boolean showInheritedSummary,
Content memberSummaryTree)
Content summariesList)
{
LinkedList<Content> summaryTreeList = new LinkedList<>();
buildSummary(writer, kind, summaryTreeList);
if (showInheritedSummary)
buildInheritedSummary(writer, kind, summaryTreeList);
if (!summaryTreeList.isEmpty()) {
Content memberTree = writer.getMemberSummaryHeader(typeElement, memberSummaryTree);
Content memberTree = writer.getMemberSummaryHeader(typeElement, summariesList);
summaryTreeList.forEach(memberTree::add);
writer.addMemberTree(memberSummaryTree, memberTree);
writer.addSummary(summariesList, memberTree);
}
}

@ -129,52 +129,51 @@ public class ModuleSummaryBuilder extends AbstractBuilder {
}
/**
* Build the module summary.
* Builds the list of summary sections for this module.
*
* @param moduleContentTree the module content tree to which the summaries will
* be added
* @throws DocletException if there is a problem while building the documentation
*/
protected void buildSummary(Content moduleContentTree) throws DocletException {
Content summaryContentTree = moduleWriter.getSummaryHeader();
Content summariesList = moduleWriter.getSummariesList();
buildPackagesSummary(summaryContentTree);
buildModulesSummary(summaryContentTree);
buildServicesSummary(summaryContentTree);
buildPackagesSummary(summariesList);
buildModulesSummary(summariesList);
buildServicesSummary(summariesList);
moduleContentTree.add(moduleWriter.getSummaryTree(summaryContentTree));
moduleContentTree.add(moduleWriter.getSummaryTree(summariesList));
}
/**
* Build the modules summary.
* Builds the summary of the module dependencies of this module.
*
* @param summaryContentTree the content tree to which the summaries will
* be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildModulesSummary(Content summaryContentTree) {
moduleWriter.addModulesSummary(summaryContentTree);
protected void buildModulesSummary(Content summariesList) {
moduleWriter.addModulesSummary(summariesList);
}
/**
* Build the package summary.
* Builds the summary of the packages exported or opened by this module.
*
* @param summaryContentTree the content tree to which the summaries will be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildPackagesSummary(Content summaryContentTree) {
moduleWriter.addPackagesSummary(summaryContentTree);
protected void buildPackagesSummary(Content summariesList) {
moduleWriter.addPackagesSummary(summariesList);
}
/**
* Build the services summary.
* Builds the summary of the services used or provided by this module.
*
* @param summaryContentTree the content tree to which the summaries will be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildServicesSummary(Content summaryContentTree) {
moduleWriter.addServicesSummary(summaryContentTree);
protected void buildServicesSummary(Content summariesList) {
moduleWriter.addServicesSummary(summariesList);
}
/**
* Build the description for the module.
* Builds the description for this module.
*
* @param moduleContentTree the tree to which the module description will
* be added

@ -136,97 +136,92 @@ public class PackageSummaryBuilder extends AbstractBuilder {
}
/**
* Build the package summary.
* Builds the list of summaries for the different kinds of types in this package.
*
* @param packageContentTree the package content tree to which the summaries will
* be added
* @throws DocletException if there is a problem while building the documentation
*/
protected void buildSummary(Content packageContentTree) throws DocletException {
Content summaryContentTree = packageWriter.getSummaryHeader();
Content summariesList = packageWriter.getSummariesList();
buildInterfaceSummary(summaryContentTree);
buildClassSummary(summaryContentTree);
buildEnumSummary(summaryContentTree);
buildRecordSummary(summaryContentTree);
buildExceptionSummary(summaryContentTree);
buildErrorSummary(summaryContentTree);
buildAnnotationTypeSummary(summaryContentTree);
buildInterfaceSummary(summariesList);
buildClassSummary(summariesList);
buildEnumSummary(summariesList);
buildRecordSummary(summariesList);
buildExceptionSummary(summariesList);
buildErrorSummary(summariesList);
buildAnnotationTypeSummary(summariesList);
packageContentTree.add(packageWriter.getPackageSummary(summaryContentTree));
packageContentTree.add(packageWriter.getPackageSummary(summariesList));
}
/**
* Build the summary for the interfaces in this package.
* Builds the summary for any interfaces in this package.
*
* @param summaryContentTree the summary tree to which the interface summary
* will be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildInterfaceSummary(Content summaryContentTree) {
protected void buildInterfaceSummary(Content summariesList) {
SortedSet<TypeElement> ilist = utils.isSpecified(packageElement)
? utils.getTypeElementsAsSortedSet(utils.getInterfaces(packageElement))
: configuration.typeElementCatalog.interfaces(packageElement);
SortedSet<TypeElement> interfaces = utils.filterOutPrivateClasses(ilist, options.javafx());
if (!interfaces.isEmpty()) {
packageWriter.addInterfaceSummary(interfaces, summaryContentTree);
packageWriter.addInterfaceSummary(interfaces, summariesList);
}
}
/**
* Build the summary for the classes in this package.
* Builds the summary for any classes in this package.
*
* @param summaryContentTree the summary tree to which the class summary will
* be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildClassSummary(Content summaryContentTree) {
protected void buildClassSummary(Content summariesList) {
SortedSet<TypeElement> clist = utils.isSpecified(packageElement)
? utils.getTypeElementsAsSortedSet(utils.getOrdinaryClasses(packageElement))
: configuration.typeElementCatalog.ordinaryClasses(packageElement);
SortedSet<TypeElement> classes = utils.filterOutPrivateClasses(clist, options.javafx());
if (!classes.isEmpty()) {
packageWriter.addClassSummary(classes, summaryContentTree);
packageWriter.addClassSummary(classes, summariesList);
}
}
/**
* Build the summary for the enums in this package.
* Builds the summary for the enum types in this package.
*
* @param summaryContentTree the summary tree to which the enum summary will
* be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildEnumSummary(Content summaryContentTree) {
protected void buildEnumSummary(Content summariesList) {
SortedSet<TypeElement> elist = utils.isSpecified(packageElement)
? utils.getTypeElementsAsSortedSet(utils.getEnums(packageElement))
: configuration.typeElementCatalog.enums(packageElement);
SortedSet<TypeElement> enums = utils.filterOutPrivateClasses(elist, options.javafx());
if (!enums.isEmpty()) {
packageWriter.addEnumSummary(enums, summaryContentTree);
packageWriter.addEnumSummary(enums, summariesList);
}
}
/**
* Build the summary for the records in this package.
* Builds the summary for any record types in this package.
*
* @param summaryContentTree the summary tree to which the record summary will
* be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildRecordSummary(Content summaryContentTree) {
protected void buildRecordSummary(Content summariesList) {
SortedSet<TypeElement> rlist = utils.isSpecified(packageElement)
? utils.getTypeElementsAsSortedSet(utils.getRecords(packageElement))
: configuration.typeElementCatalog.records(packageElement);
SortedSet<TypeElement> records = utils.filterOutPrivateClasses(rlist, options.javafx());
if (!records.isEmpty()) {
packageWriter.addRecordSummary(records, summaryContentTree);
packageWriter.addRecordSummary(records, summariesList);
}
}
/**
* Build the summary for the exceptions in this package.
* Builds the summary for any exception types in this package.
*
* @param summaryContentTree the summary tree to which the exception summary will
* be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildExceptionSummary(Content summaryContentTree) {
protected void buildExceptionSummary(Content summariesList) {
Set<TypeElement> iexceptions =
utils.isSpecified(packageElement)
? utils.getTypeElementsAsSortedSet(utils.getExceptions(packageElement))
@ -234,34 +229,32 @@ public class PackageSummaryBuilder extends AbstractBuilder {
SortedSet<TypeElement> exceptions = utils.filterOutPrivateClasses(iexceptions,
options.javafx());
if (!exceptions.isEmpty()) {
packageWriter.addExceptionSummary(exceptions, summaryContentTree);
packageWriter.addExceptionSummary(exceptions, summariesList);
}
}
/**
* Build the summary for the errors in this package.
* Builds the summary for any error types in this package.
*
* @param summaryContentTree the summary tree to which the error summary will
* be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildErrorSummary(Content summaryContentTree) {
protected void buildErrorSummary(Content summariesList) {
Set<TypeElement> ierrors =
utils.isSpecified(packageElement)
? utils.getTypeElementsAsSortedSet(utils.getErrors(packageElement))
: configuration.typeElementCatalog.errors(packageElement);
SortedSet<TypeElement> errors = utils.filterOutPrivateClasses(ierrors, options.javafx());
if (!errors.isEmpty()) {
packageWriter.addErrorSummary(errors, summaryContentTree);
packageWriter.addErrorSummary(errors, summariesList);
}
}
/**
* Build the summary for the annotation type in this package.
* Builds the summary for any annotation types in this package.
*
* @param summaryContentTree the summary tree to which the annotation type
* summary will be added
* @param summariesList the list of summaries to which the summary will be added
*/
protected void buildAnnotationTypeSummary(Content summaryContentTree) {
protected void buildAnnotationTypeSummary(Content summariesList) {
SortedSet<TypeElement> iannotationTypes =
utils.isSpecified(packageElement)
? utils.getTypeElementsAsSortedSet(utils.getAnnotationTypes(packageElement))
@ -269,7 +262,7 @@ public class PackageSummaryBuilder extends AbstractBuilder {
SortedSet<TypeElement> annotationTypes = utils.filterOutPrivateClasses(iannotationTypes,
options.javafx());
if (!annotationTypes.isEmpty()) {
packageWriter.addAnnotationTypeSummary(annotationTypes, summaryContentTree);
packageWriter.addAnnotationTypeSummary(annotationTypes, summariesList);
}
}

@ -321,11 +321,17 @@ div.inheritance {
div.inheritance div.inheritance {
margin-left:2em;
}
ul.block-list, ul.details-list, ul.member-list {
ul.block-list,
ul.details-list,
ul.member-list,
ul.summary-list {
margin:10px 0 10px 0;
padding:0;
}
ul.block-list > li, ul.details-list > li, ul.member-list > li {
ul.block-list > li,
ul.details-list > li,
ul.member-list > li,
ul.summary-list > li {
list-style:none;
margin-bottom:15px;
line-height:1.4;

@ -101,7 +101,7 @@ public class TestHtmlVersion extends JavadocTester {
// No package description
checkOutput("pkg1/package-summary.html", true,
"<section class=\"summary\">\n"
+ "<ul class=\"block-list\">\n"
+ "<ul class=\"summary-list\">\n"
+ "<li>\n"
+ "<div class=\"type-summary\">\n<table>\n"
+ "<caption><span>Class Summary</span><span class=\"tab-end\">&nbsp;</span></caption>");

@ -23,7 +23,7 @@
/*
* @test
* @bug 8241625 8241895
* @bug 8241625 8241895 8242326
* @summary test the lists generated by the doclet
* @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@ -103,13 +103,13 @@ public class TestLists extends JavadocTester {
Path src = base.resolve("src");
tb.writeJavaFiles(src,
"package p; public class C {\n"
+ " public C() { }\n"
+ " public C(int i) { }\n"
+ " public int f1;\n"
+ " public int f2;\n"
+ " public void m1() { }\n"
+ " public void m2() { }\n"
+ "}\n",
+ " public C() { }\n"
+ " public C(int i) { }\n"
+ " public int f1;\n"
+ " public int f2;\n"
+ " public void m1() { }\n"
+ " public void m2() { }\n"
+ "}\n",
"package p; public enum E { E1, E2 }\n",
"package p; public @interface A { int value(); }\n"
);
@ -153,4 +153,65 @@ public class TestLists extends JavadocTester {
+ "<h2>Element Details</h2>\n"
+ "<ul class=\"member-list\">");
}
@Test
public void testSummaryLists(Path base) throws IOException {
Path src = base.resolve("src");
tb.writeJavaFiles(src,
"package p; public class C {\n"
+ " public C() { }\n"
+ " public C(int i) { }\n"
+ " public int f1;\n"
+ " public int f2;\n"
+ " public void m1() { }\n"
+ " public void m2() { }\n"
+ "}\n",
"package p; public enum E { E1, E2 }\n",
"package p; public @interface A { int value(); }\n"
);
javadoc("-d", base.resolve("out").toString(),
"-sourcepath", src.toString(),
"p");
checkExit(Exit.OK);
checkOutput("p/C.html", true,
"<section class=\"summary\">\n"
+ "<ul class=\"summary-list\">\n"
+ "<!-- =========== FIELD SUMMARY =========== -->\n"
+ "<li>\n"
+ "<section class=\"field-summary\" id=\"field.summary\">\n"
+ "<h2>Field Summary</h2>\n"
+ "<div class=\"member-summary\">\n"
+ "<table>",
"</section>\n"
+ "</li>\n"
+ "<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n"
+ "<li>\n"
+ "<section class=\"constructor-summary\" id=\"constructor.summary\">\n"
+ "<h2>Constructor Summary</h2>\n"
+ "<div class=\"member-summary\">\n"
+ "<table>");
checkOutput("p/E.html", true,
"</section>\n"
+ "</li>\n"
+ "<!-- =========== ENUM CONSTANT SUMMARY =========== -->\n"
+ "<li>\n"
+ "<section class=\"constants-summary\" id=\"enum.constant.summary\">\n"
+ "<h2>Enum Constant Summary</h2>\n"
+ "<div class=\"member-summary\">\n"
+ "<table>");
checkOutput("p/A.html", true,
"<section class=\"summary\">\n"
+ "<ul class=\"summary-list\">\n"
+ "<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== -->\n"
+ "<li>\n"
+ "<section class=\"member-summary\" id=\"annotation.type.required.element.summary\">\n"
+ "<h2>Required Element Summary</h2>\n"
+ "<div class=\"member-summary\">\n"
+ "<table>");
}
}

@ -549,7 +549,7 @@ public class TestModules extends JavadocTester {
+ "<h1 title=\"Module\" class=\"title\">Module&nbsp;moduleA</h1>\n"
+ "</div>\n"
+ "<section class=\"summary\">\n"
+ "<ul class=\"block-list\">\n"
+ "<ul class=\"summary-list\">\n"
+ "<li>\n"
+ "<section class=\"packages-summary\" id=\"packages.summary\">\n"
+ "<!-- ============ PACKAGES SUMMARY =========== -->");
@ -561,7 +561,7 @@ public class TestModules extends JavadocTester {
+ "<h1 title=\"Module\" class=\"title\">Module&nbsp;moduleB</h1>\n"
+ "</div>\n"
+ "<section class=\"summary\">\n"
+ "<ul class=\"block-list\">\n"
+ "<ul class=\"summary-list\">\n"
+ "<li>\n"
+ "<section class=\"packages-summary\" id=\"packages.summary\">\n"
+ "<!-- ============ PACKAGES SUMMARY =========== -->");