Skip to content
Permalink
Browse files
8242326: use new "summary-list" CSS class instead of general "block-l…
…ist" for list of summary sections

Reviewed-by: hannesw
  • Loading branch information
jonathan-gibbons committed Apr 13, 2020
1 parent ea36a53 commit 7a608f40fcb4622298242f81e03bd34856f43190
Showing 25 changed files with 286 additions and 210 deletions.
@@ -74,9 +74,9 @@ public Content getMemberSummaryHeader(TypeElement typeElement,
}

@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 Content getMemberTreeHeader() {
}

@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 Content getMemberSummaryHeader(TypeElement typeElement,
}

@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 Content getMemberSummaryHeader(TypeElement typeElement,
}

@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 Content getMemberSummaryHeader(TypeElement typeElement,
}

@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 Content getMemberSummaryHeader(TypeElement typeElement, Content memberSum
}

@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 Content getContentHeader() {
* 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 @@ private Table getTable3(Content caption, String tableSummary, HtmlStyle tableSty
}

@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 void addModulesSummary(Content summaryContentTree) {
addModulesList(indirectModules, amrTable);
section.add(amrTable);
}
summaryContentTree.add(HtmlTree.LI(section));
summariesList.add(HtmlTree.LI(section));
}
}

@@ -535,7 +533,7 @@ private void addModulesList(Map<ModuleElement, Content> mdleMap, Table table) {
}

@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 void addPackagesSummary(Content summaryContentTree) {
addIndirectPackages(aopTable, indirectOpenPackages);
section.add(aopTable);
}
summaryContentTree.add(HtmlTree.LI(section));
summariesList.add(HtmlTree.LI(section));
}
}

@@ -706,7 +704,7 @@ public void addIndirectPackages(Table table, Map<ModuleElement, SortedSet<Packag
}

@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 void addServicesSummary(Content summaryContentTree) {
section.add(table);
}
}
summaryContentTree.add(HtmlTree.LI(section));
summariesList.add(HtmlTree.LI(section));
}
}

@@ -70,9 +70,9 @@ public Content getMemberSummaryHeader(TypeElement typeElement,
}

@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 void addDeprecationInfo(Content div) {
}

@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 Content getMemberSummaryHeader(TypeElement typeElement, Content memberSum
}

@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 Content getMemberTreeHeader() {
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 Content getMemberInheritedTree() {
}

/**
* 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 @@ void addInheritedMemberSummary(TypeElement typeElement,
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 @@ protected void buildClassTagInfo(Content classInfoTree) {
* @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));
}

/**

0 comments on commit 7a608f4

Please sign in to comment.