--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Fri Oct 20 11:08:18 2017 -0700
@@ -36,6 +36,7 @@
import javax.lang.model.type.TypeMirror;
import com.sun.source.doctree.DocTree;
+import jdk.javadoc.internal.doclets.formats.html.TableHeader;
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;
@@ -123,7 +124,7 @@
* @param member the member to be documented
* @return the summary table header
*/
- public abstract List<String> getSummaryTableHeader(Element member);
+ public abstract TableHeader getSummaryTableHeader(Element member);
/**
* Add inherited summary label for the member.
@@ -428,8 +429,7 @@
for (Element element : members) {
TypeElement te = utils.getEnclosingTypeElement(element);
if (!printedUseTableHeader) {
- table.addContent(writer.getSummaryTableHeader(
- this.getSummaryTableHeader(element), "col"));
+ table.addContent(getSummaryTableHeader(element).toContent());
printedUseTableHeader = true;
}
HtmlTree tr = new HtmlTree(HtmlTag.TR);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java Fri Oct 20 11:08:18 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, 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
@@ -25,14 +25,12 @@
package jdk.javadoc.internal.doclets.formats.html;
-import java.util.Arrays;
-import java.util.List;
-
import javax.lang.model.element.Element;
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.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;
@@ -218,10 +216,10 @@
/**
* {@inheritDoc}
*/
- public List<String> getSummaryTableHeader(Element member) {
- List<String> header = Arrays.asList(writer.getModifierTypeHeader(),
- resources.getText("doclet.Fields"), resources.getText("doclet.Description"));
- return header;
+ @Override
+ public TableHeader getSummaryTableHeader(Element member) {
+ return new TableHeader(contents.modifierAndTypeLabel, contents.fields,
+ contents.descriptionLabel);
}
/**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java Fri Oct 20 11:08:18 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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,6 +33,7 @@
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
+import jdk.javadoc.internal.doclets.formats.html.TableHeader;
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.StringContent;
@@ -131,11 +132,10 @@
/**
* {@inheritDoc}
*/
- public List<String> getSummaryTableHeader(Element member) {
- List<String> header = Arrays.asList(writer.getModifierTypeHeader(),
- resources.getText("doclet.Annotation_Type_Optional_Member"),
- resources.getText("doclet.Description"));
- return header;
+ @Override
+ public TableHeader getSummaryTableHeader(Element member) {
+ return new TableHeader(contents.modifierAndTypeLabel,
+ contents.annotationTypeOptionalMemberLabel, contents.descriptionLabel);
}
/**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java Fri Oct 20 11:08:18 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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,6 +33,7 @@
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
+import jdk.javadoc.internal.doclets.formats.html.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;
@@ -220,10 +221,9 @@
/**
* {@inheritDoc}
*/
- public List<String> getSummaryTableHeader(Element member) {
- List<String> header = Arrays.asList(writer.getModifierTypeHeader(),
- resources.getText("doclet.Annotation_Type_Required_Member"), resources.getText("doclet.Description"));
- return header;
+ public TableHeader getSummaryTableHeader(Element member) {
+ return new TableHeader(contents.modifierAndTypeLabel,
+ contents.annotationTypeRequiredMemberLabel, contents.descriptionLabel);
}
/**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java Fri Oct 20 11:08:18 2017 -0700
@@ -25,6 +25,7 @@
package jdk.javadoc.internal.doclets.formats.html;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -101,6 +102,7 @@
final String fieldUseTableSummary;
final String methodUseTableSummary;
final String constructorUseTableSummary;
+ final String packageUseTableSummary;
/**
* The HTML tree for main tag.
@@ -152,22 +154,27 @@
"Internal error: package sets don't match: "
+ pkgSet + " with: " + mapper.classToPackage.get(this.typeElement));
}
+
methodSubWriter = new MethodWriterImpl(this);
constrSubWriter = new ConstructorWriterImpl(this);
fieldSubWriter = new FieldWriterImpl(this);
classSubWriter = new NestedClassWriterImpl(this);
- classUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
- configuration.getText("doclet.classes"));
- subclassUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
- configuration.getText("doclet.subclasses"));
- subinterfaceUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
- configuration.getText("doclet.subinterfaces"));
- fieldUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
- configuration.getText("doclet.fields"));
- methodUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
- configuration.getText("doclet.methods"));
- constructorUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
- configuration.getText("doclet.constructors"));
+
+ String useTableSummary = resources.getText("doclet.Use_Table_Summary");
+ classUseTableSummary = MessageFormat.format(useTableSummary,
+ resources.getText("doclet.classes"));
+ subclassUseTableSummary = MessageFormat.format(useTableSummary,
+ resources.getText("doclet.subclasses"));
+ subinterfaceUseTableSummary = MessageFormat.format(useTableSummary,
+ resources.getText("doclet.subinterfaces"));
+ fieldUseTableSummary = MessageFormat.format(useTableSummary,
+ resources.getText("doclet.fields"));
+ methodUseTableSummary = MessageFormat.format(useTableSummary,
+ resources.getText("doclet.methods"));
+ constructorUseTableSummary = MessageFormat.format(useTableSummary,
+ resources.getText("doclet.constructors"));
+ packageUseTableSummary = MessageFormat.format(useTableSummary,
+ resources.getText("doclet.packages"));
}
/**
@@ -290,8 +297,8 @@
LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement))));
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
- : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption);
- table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
+ : HtmlTree.TABLE(HtmlStyle.useSummary, packageUseTableSummary, caption);
+ table.addContent(getPackageTableHeader().toContent());
Content tbody = new HtmlTree(HtmlTag.TBODY);
boolean altColor = true;
for (PackageElement pkg : pkgSet) {
@@ -323,8 +330,8 @@
LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement))));
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
- : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption);
- table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
+ : HtmlTree.TABLE(HtmlStyle.useSummary, packageUseTableSummary, caption);
+ table.addContent(getPackageTableHeader().toContent());
Content tbody = new HtmlTree(HtmlTag.TBODY);
boolean altColor = true;
for (PackageElement pkg : pkgToPackageAnnotations) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java Fri Oct 20 11:08:18 2017 -0700
@@ -70,7 +70,7 @@
private final String constantsTableSummary;
- private final List<String> constantsTableHeader;
+ private final TableHeader constantsTableHeader;
/**
* The HTML tree for main tag.
@@ -92,10 +92,8 @@
this.configuration = configuration;
constantsTableSummary = configuration.getText("doclet.Constants_Table_Summary",
configuration.getText("doclet.Constants_Summary"));
- constantsTableHeader = new ArrayList<>();
- constantsTableHeader.add(getModifierTypeHeader());
- constantsTableHeader.add(configuration.getText("doclet.ConstantField"));
- constantsTableHeader.add(configuration.getText("doclet.Value"));
+ constantsTableHeader = new TableHeader(
+ contents.modifierAndTypeLabel, contents.constantFieldLabel, contents.valueLabel);
}
/**
@@ -261,7 +259,7 @@
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(HtmlStyle.constantsSummary, caption)
: HtmlTree.TABLE(HtmlStyle.constantsSummary, constantsTableSummary, caption);
- table.addContent(getSummaryTableHeader(constantsTableHeader, "col"));
+ table.addContent(constantsTableHeader.toContent());
return table;
}
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java Fri Oct 20 11:08:18 2017 -0700
@@ -31,6 +31,7 @@
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
+import jdk.javadoc.internal.doclets.formats.html.TableHeader;
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;
@@ -260,14 +261,13 @@
* {@inheritDoc}
*/
@Override
- public List<String> getSummaryTableHeader(Element member) {
- List<String> header = new ArrayList<>();
+ public TableHeader getSummaryTableHeader(Element member) {
if (foundNonPubConstructor) {
- header.add(resources.getText("doclet.Modifier"));
+ return new TableHeader(contents.modifierLabel, contents.constructorLabel,
+ contents.descriptionLabel);
+ } else {
+ return new TableHeader(contents.constructorLabel, contents.descriptionLabel);
}
- header.add(resources.getText("doclet.Constructor"));
- header.add(resources.getText("doclet.Description"));
- return header;
}
/**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java Fri Oct 20 11:08:18 2017 -0700
@@ -56,15 +56,20 @@
public final Content allPackagesLabel;
public final Content allSuperinterfacesLabel;
public final Content also;
+ public final Content annotationTypeOptionalMemberLabel;
+ public final Content annotationTypeRequiredMemberLabel;
public final Content annotateTypeOptionalMemberSummaryLabel;
public final Content annotateTypeRequiredMemberSummaryLabel;
public final Content annotationType;
public final Content annotationTypeDetailsLabel;
public final Content annotationTypeMemberDetail;
+ public final Content annotationtypes;
public final Content annotationTypes;
public final Content classLabel;
public final Content classes;
+ public final Content constantFieldLabel;
public final Content constantsSummaryTitle;
+ public final Content constructorLabel;
public final Content constructorDetailsLabel;
public final Content constructorSummaryLabel;
public final Content constructors;
@@ -81,16 +86,21 @@
public final Content detailLabel;
public final Content enclosingClassLabel;
public final Content enclosingInterfaceLabel;
+ public final Content enumConstantLabel;
public final Content enumConstantDetailLabel;
public final Content enumConstantSummary;
public final Content enum_;
public final Content enums;
+ public final Content error;
public final Content errors;
+ public final Content exception;
public final Content exceptions;
+ public final Content fieldLabel;
public final Content fieldDetailsLabel;
public final Content fieldSummaryLabel;
public final Content fields;
public final Content framesLabel;
+ public final Content fromLabel;
public final Content functionalInterface;
public final Content functionalInterfaceMessage;
public final Content helpLabel;
@@ -100,11 +110,15 @@
public final Content inClass;
public final Content inInterface;
public final Content indexLabel;
+ public final Content interfaceLabel;
public final Content interfaces;
public final Content interfacesItalic;
public final Content methodDetailLabel;
+ public final Content methodLabel;
public final Content methodSummary;
public final Content methods;
+ public final Content modifierAndTypeLabel;
+ public final Content modifierLabel;
public final Content moduleLabel;
public final Content module_;
public final Content moduleSubNavLabel;
@@ -143,6 +157,7 @@
public final Content prevModuleLabel;
public final Content prevPackageLabel;
public final Content properties;
+ public final Content propertyLabel;
public final Content propertyDetailsLabel;
public final Content propertySummary;
public final Content seeLabel;
@@ -152,7 +167,9 @@
public final Content subinterfacesLabel;
public final Content summaryLabel;
public final Content treeLabel;
+ public final Content typeLabel;
public final Content useLabel;
+ public final Content valueLabel;
private final Resources resources;
@@ -171,15 +188,20 @@
allPackagesLabel = getNonBreakContent("doclet.All_Packages");
allSuperinterfacesLabel = getContent("doclet.All_Superinterfaces");
also = getContent("doclet.also");
+ annotationTypeOptionalMemberLabel = getContent("doclet.Annotation_Type_Optional_Member");
+ annotationTypeRequiredMemberLabel = getContent("doclet.Annotation_Type_Required_Member");
annotateTypeOptionalMemberSummaryLabel = getContent("doclet.Annotation_Type_Optional_Member_Summary");
annotateTypeRequiredMemberSummaryLabel = getContent("doclet.Annotation_Type_Required_Member_Summary");
annotationType = getContent("doclet.AnnotationType");
annotationTypeDetailsLabel = getContent("doclet.Annotation_Type_Member_Detail");
annotationTypeMemberDetail = getContent("doclet.Annotation_Type_Member_Detail");
annotationTypes = getContent("doclet.AnnotationTypes");
+ annotationtypes = getContent("doclet.annotationtypes");
classLabel = getContent("doclet.Class");
classes = getContent("doclet.Classes");
+ constantFieldLabel = getContent("doclet.ConstantField");
constantsSummaryTitle = getContent("doclet.Constants_Summary");
+ constructorLabel = getContent("doclet.Constructor");
constructorDetailsLabel = getContent("doclet.Constructor_Detail");
constructorSummaryLabel = getContent("doclet.Constructor_Summary");
constructors = getContent("doclet.Constructors");
@@ -196,16 +218,21 @@
detailLabel = getContent("doclet.Detail");
enclosingClassLabel = getContent("doclet.Enclosing_Class");
enclosingInterfaceLabel = getContent("doclet.Enclosing_Interface");
+ enumConstantLabel = getContent("doclet.Enum_Constant");
enumConstantDetailLabel = getContent("doclet.Enum_Constant_Detail");
enumConstantSummary = getContent("doclet.Enum_Constant_Summary");
enum_ = getContent("doclet.Enum");
enums = getContent("doclet.Enums");
+ error = getContent("doclet.Error");
errors = getContent("doclet.Errors");
+ exception = getContent("doclet.Exception");
exceptions = getContent("doclet.Exceptions");
fieldDetailsLabel = getContent("doclet.Field_Detail");
fieldSummaryLabel = getContent("doclet.Field_Summary");
+ fieldLabel = getContent("doclet.Field");
fields = getContent("doclet.Fields");
framesLabel = getContent("doclet.Frames");
+ fromLabel = getContent("doclet.From");
functionalInterface = getContent("doclet.Functional_Interface");
functionalInterfaceMessage = getContent("doclet.Functional_Interface_Message");
helpLabel = getContent("doclet.Help");
@@ -215,11 +242,15 @@
inClass = getContent("doclet.in_class");
inInterface = getContent("doclet.in_interface");
indexLabel = getContent("doclet.Index");
+ interfaceLabel = getContent("doclet.Interface");
interfaces = getContent("doclet.Interfaces");
interfacesItalic = getContent("doclet.Interfaces_Italic");
methodDetailLabel = getContent("doclet.Method_Detail");
methodSummary = getContent("doclet.Method_Summary");
+ methodLabel = getContent("doclet.Method");
methods = getContent("doclet.Methods");
+ modifierLabel = getContent("doclet.Modifier");
+ modifierAndTypeLabel = getContent("doclet.Modifier_and_Type");
moduleLabel = getContent("doclet.Module");
module_ = getContent("doclet.module");
moduleSubNavLabel = getContent("doclet.Module_Sub_Nav");
@@ -258,6 +289,7 @@
prevModuleLabel = getNonBreakContent("doclet.Prev_Module");
prevPackageLabel = getNonBreakContent("doclet.Prev_Package");
properties = getContent("doclet.Properties");
+ propertyLabel = getContent("doclet.Property");
propertyDetailsLabel = getContent("doclet.Property_Detail");
propertySummary = getContent("doclet.Property_Summary");
seeLabel = getContent("doclet.See");
@@ -267,7 +299,9 @@
subinterfacesLabel = getContent("doclet.Subinterfaces");
summaryLabel = getContent("doclet.Summary");
treeLabel = getContent("doclet.Tree");
+ typeLabel = getContent("doclet.Type");
useLabel = getContent("doclet.navClassUse");
+ valueLabel = getContent("doclet.Value");
}
/**
@@ -286,7 +320,6 @@
* a given key in the doclet's resources, formatted with
* given arguments.
*
- * @param key the key to look for in the configuration fil
* @param key the key for the desired string
* @param o0 string or content argument to be formatted into the result
* @return a content tree for the text
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java Fri Oct 20 11:08:18 2017 -0700
@@ -25,7 +25,6 @@
package jdk.javadoc.internal.doclets.formats.html;
-import java.util.ArrayList;
import java.util.EnumMap;
import java.util.List;
import java.util.SortedSet;
@@ -286,13 +285,11 @@
for (DeprElementKind kind : DeprElementKind.values()) {
if (deprapi.hasDocumentation(kind)) {
addAnchor(deprapi, kind, div);
- memberTableSummary
- = resources.getText("doclet.Member_Table_Summary",
- resources.getText(getHeadingKey(kind)),
- resources.getText(getSummaryKey(kind)));
- List<String> memberTableHeader = new ArrayList<>();
- memberTableHeader.add(resources.getText(getHeaderKey(kind)));
- memberTableHeader.add(resources.getText("doclet.Description"));
+ memberTableSummary = resources.getText("doclet.Member_Table_Summary",
+ resources.getText(getHeadingKey(kind)),
+ resources.getText(getSummaryKey(kind)));
+ TableHeader memberTableHeader = new TableHeader(
+ contents.getContent(getHeaderKey(kind)), contents.descriptionLabel);
addDeprecatedAPI(deprapi.getSet(kind),
getHeadingKey(kind), memberTableSummary, memberTableHeader, div);
}
@@ -405,13 +402,13 @@
* @param contentTree the content tree to which the deprecated table will be added
*/
protected void addDeprecatedAPI(SortedSet<Element> deprList, String headingKey,
- String tableSummary, List<String> tableHeader, Content contentTree) {
+ String tableSummary, TableHeader tableHeader, Content contentTree) {
if (deprList.size() > 0) {
Content caption = getTableCaption(configuration.getContent(headingKey));
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(HtmlStyle.deprecatedSummary, caption)
: HtmlTree.TABLE(HtmlStyle.deprecatedSummary, tableSummary, caption);
- table.addContent(getSummaryTableHeader(tableHeader, "col"));
+ table.addContent(tableHeader.toContent());
Content tbody = new HtmlTree(HtmlTag.TBODY);
boolean altColor = true;
for (Element e : deprList) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java Fri Oct 20 11:08:18 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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,6 +33,7 @@
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
+import jdk.javadoc.internal.doclets.formats.html.TableHeader;
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;
@@ -213,10 +214,8 @@
* {@inheritDoc}
*/
@Override
- public List<String> getSummaryTableHeader(Element member) {
- List<String> header = Arrays.asList(resources.getText("doclet.Enum_Constant"),
- resources.getText("doclet.Description"));
- return header;
+ public TableHeader getSummaryTableHeader(Element member) {
+ return new TableHeader(contents.enumConstantLabel, contents.descriptionLabel);
}
/**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java Fri Oct 20 11:08:18 2017 -0700
@@ -25,13 +25,11 @@
package jdk.javadoc.internal.doclets.formats.html;
-import java.util.Arrays;
-import java.util.List;
-
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.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;
@@ -212,10 +210,9 @@
* {@inheritDoc}
*/
@Override
- public List<String> getSummaryTableHeader(Element member) {
- List<String> header = Arrays.asList(writer.getModifierTypeHeader(),
- resources.getText("doclet.Field"), resources.getText("doclet.Description"));
- return header;
+ public TableHeader getSummaryTableHeader(Element member) {
+ return new TableHeader(contents.modifierAndTypeLabel, contents.fieldLabel,
+ contents.descriptionLabel);
}
/**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java Fri Oct 20 11:08:18 2017 -0700
@@ -75,12 +75,10 @@
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.HtmlVersion;
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter;
import jdk.javadoc.internal.doclets.toolkit.ClassWriter;
-import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.Messages;
import jdk.javadoc.internal.doclets.toolkit.PackageSummaryWriter;
@@ -390,46 +388,6 @@
DocPaths.moduleSummary(mdle)), label, "", target);
}
- public void addClassesSummary(SortedSet<TypeElement> classes, String label,
- String tableSummary, List<String> tableHeader, Content summaryContentTree) {
- if (!classes.isEmpty()) {
- Content caption = getTableCaption(new RawHtml(label));
- Content table = (configuration.isOutputHtml5())
- ? HtmlTree.TABLE(HtmlStyle.typeSummary, caption)
- : HtmlTree.TABLE(HtmlStyle.typeSummary, tableSummary, caption);
- table.addContent(getSummaryTableHeader(tableHeader, "col"));
- Content tbody = new HtmlTree(HtmlTag.TBODY);
- boolean altColor = true;
- for (TypeElement te : classes) {
- if (!utils.isCoreClass(te) ||
- !configuration.isGeneratedDoc(te)) {
- continue;
- }
- Content classContent = getLink(new LinkInfoImpl(
- configuration, LinkInfoImpl.Kind.PACKAGE, te));
- Content tdClass = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, classContent);
- HtmlTree tr = HtmlTree.TR(tdClass);
- tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
- altColor = !altColor;
- HtmlTree tdClassDescription = new HtmlTree(HtmlTag.TD);
- tdClassDescription.addStyle(HtmlStyle.colLast);
- if (utils.isDeprecated(te)) {
- tdClassDescription.addContent(getDeprecatedPhrase(te));
- List<? extends DocTree> tags = utils.getDeprecatedTrees(te);
- if (!tags.isEmpty()) {
- addSummaryDeprecatedComment(te, tags.get(0), tdClassDescription);
- }
- } else {
- addSummaryComment(te, tdClassDescription);
- }
- tr.addContent(tdClassDescription);
- tbody.addContent(tr);
- }
- table.addContent(tbody);
- summaryContentTree.addContent(table);
- }
- }
-
/**
* Generates the HTML document tree and prints it out.
*
@@ -939,41 +897,9 @@
}
/**
- * Get summary table header.
- *
- * @param header the header for the table
- * @param scope the scope of the headers
- * @return a content tree for the header
- */
- public Content getSummaryTableHeader(List<String> header, String scope) {
- Content tr = new HtmlTree(HtmlTag.TR);
- final int size = header.size();
- Content tableHeader;
- if (size == 2) {
- tableHeader = new StringContent(header.get(0));
- tr.addContent(HtmlTree.TH(HtmlStyle.colFirst, scope, tableHeader));
- tableHeader = new StringContent(header.get(1));
- tr.addContent(HtmlTree.TH(HtmlStyle.colLast, scope, tableHeader));
- return tr;
- }
- for (int i = 0; i < size; i++) {
- tableHeader = new StringContent(header.get(i));
- if (i == 0)
- tr.addContent(HtmlTree.TH(HtmlStyle.colFirst, scope, tableHeader));
- else if (i == 1)
- tr.addContent(HtmlTree.TH(HtmlStyle.colSecond, scope, tableHeader));
- else if (i == (size - 1))
- tr.addContent(HtmlTree.TH(HtmlStyle.colLast, scope, tableHeader));
- else
- tr.addContent(HtmlTree.TH(scope, tableHeader));
- }
- return tr;
- }
-
- /**
* Get table caption.
*
- * @param rawText the caption for the table which could be raw Html
+ * @param title the content for the caption
* @return a content tree for the caption
*/
public Content getTableCaption(Content title) {
@@ -2615,13 +2541,7 @@
}.visit(annotationValue);
}
- /**
- * Return the configuration for this doclet.
- *
- * @return the configuration for this doclet.
- */
- @Override
- public BaseConfiguration configuration() {
- return configuration;
+ protected TableHeader getPackageTableHeader() {
+ return new TableHeader(contents.packageLabel, contents.descriptionLabel);
}
}
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java Fri Oct 20 11:08:18 2017 -0700
@@ -29,7 +29,6 @@
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.DocType;
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.HtmlDocument;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java Fri Oct 20 11:08:18 2017 -0700
@@ -35,6 +35,7 @@
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
+import jdk.javadoc.internal.doclets.formats.html.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;
@@ -259,10 +260,9 @@
* {@inheritDoc}
*/
@Override
- public List<String> getSummaryTableHeader(Element member) {
- List<String> header = Arrays.asList(writer.getModifierTypeHeader(),
- resources.getText("doclet.Method"), resources.getText("doclet.Description"));
- return header;
+ public TableHeader getSummaryTableHeader(Element member) {
+ return new TableHeader(contents.modifierAndTypeLabel, contents.methodLabel,
+ contents.descriptionLabel);
}
/**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java Fri Oct 20 11:08:18 2017 -0700
@@ -30,7 +30,6 @@
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;
@@ -145,7 +144,8 @@
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(HtmlStyle.overviewSummary, getTableCaption(new RawHtml(text)))
: HtmlTree.TABLE(HtmlStyle.overviewSummary, tableSummary, getTableCaption(new RawHtml(text)));
- table.addContent(getSummaryTableHeader(moduleTableHeader, "col"));
+ Content header = new TableHeader(contents.moduleLabel, contents.descriptionLabel).toContent();
+ table.addContent(header);
Content tbody = new HtmlTree(HtmlTag.TBODY);
addModulesList(modules, tbody);
table.addContent(tbody);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java Fri Oct 20 11:08:18 2017 -0700
@@ -457,14 +457,15 @@
* @param heading the heading for the section
* @param htmltree the content tree to which the information is added
*/
- public void addSummaryHeader(Content startMarker, SectionName markerAnchor, Content heading, Content htmltree) {
+ public void addSummaryHeader(Content startMarker, SectionName markerAnchor, Content heading,
+ Content htmltree) {
htmltree.addContent(startMarker);
htmltree.addContent(getMarkerAnchor(markerAnchor));
htmltree.addContent(HtmlTree.HEADING(HtmlTag.H3, heading));
}
/**
- * Get table header.
+ * Get a table.
*
* @param text the table caption
* @param tableSummary the summary for the table
@@ -472,13 +473,13 @@
* @param tableHeader the table header
* @return a content object
*/
- public Content getTableHeader(String text, String tableSummary, HtmlStyle tableStyle,
- List<String> tableHeader) {
- return getTableHeader(getTableCaption(new RawHtml(text)), tableSummary, tableStyle, tableHeader);
+ Content getTable(String text, String tableSummary, HtmlStyle tableStyle,
+ TableHeader tableHeader) {
+ return getTable(getTableCaption(new RawHtml(text)), tableSummary, tableStyle, tableHeader);
}
/**
- * Get table header.
+ * Get a table.
*
* @param caption the table caption
* @param tableSummary the summary for the table
@@ -486,20 +487,24 @@
* @param tableHeader the table header
* @return a content object
*/
- public Content getTableHeader(Content caption, String tableSummary, HtmlStyle tableStyle,
- List<String> tableHeader) {
+ Content getTable(Content caption, String tableSummary, HtmlStyle tableStyle,
+ TableHeader tableHeader) {
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(tableStyle, caption)
: HtmlTree.TABLE(tableStyle, tableSummary, caption);
- table.addContent(getSummaryTableHeader(tableHeader, "col"));
+ table.addContent(tableHeader.toContent());
return table;
}
/**
* {@inheritDoc}
*/
+ @Override
public void addModulesSummary(Content summaryContentTree) {
if (display(requires) || display(indirectModules)) {
+ TableHeader requiresTableHeader =
+ new TableHeader(contents.modifierLabel, contents.moduleLabel,
+ contents.descriptionLabel);
HtmlTree li = new HtmlTree(HtmlTag.LI);
li.addStyle(HtmlStyle.blockList);
addSummaryHeader(HtmlConstants.START_OF_MODULES_SUMMARY, SectionName.MODULES,
@@ -507,9 +512,10 @@
if (display(requires)) {
String text = configuration.getText("doclet.Requires_Summary");
String tableSummary = configuration.getText("doclet.Member_Table_Summary",
- configuration.getText("doclet.Requires_Summary"),
+ text,
configuration.getText("doclet.modules"));
- Content table = getTableHeader(text, tableSummary, HtmlStyle.requiresSummary, requiresTableHeader);
+ Content table = getTable(text, tableSummary, HtmlStyle.requiresSummary,
+ requiresTableHeader);
Content tbody = new HtmlTree(HtmlTag.TBODY);
addModulesList(requires, tbody);
table.addContent(tbody);
@@ -519,9 +525,10 @@
if (display(indirectModules)) {
String amrText = configuration.getText("doclet.Indirect_Requires_Summary");
String amrTableSummary = configuration.getText("doclet.Member_Table_Summary",
- configuration.getText("doclet.Indirect_Requires_Summary"),
+ amrText,
configuration.getText("doclet.modules"));
- Content amrTable = getTableHeader(amrText, amrTableSummary, HtmlStyle.requiresSummary, requiresTableHeader);
+ Content amrTable = getTable(amrText, amrTableSummary, HtmlStyle.requiresSummary,
+ requiresTableHeader);
Content amrTbody = new HtmlTree(HtmlTag.TBODY);
addModulesList(indirectModules, amrTbody);
amrTable.addContent(amrTbody);
@@ -556,6 +563,7 @@
}
}
+ @Override
public void addPackagesSummary(Content summaryContentTree) {
if (display(exportedPackages) || display(openedPackages) || display(concealedPackages)
|| display(indirectPackages) || display(indirectOpenPackages)) {
@@ -569,14 +577,16 @@
if (display(exportedPackages) || display(openedPackages) || display(concealedPackages)) {
addPackageSummary(tableSummary, li);
}
+ TableHeader indirectPackagesHeader =
+ new TableHeader(contents.fromLabel, contents.packagesLabel);
if (display(indirectPackages)) {
String aepText = configuration.getText("doclet.Indirect_Exports_Summary");
String aepTableSummary = configuration.getText("doclet.Indirect_Packages_Table_Summary",
- configuration.getText("doclet.Indirect_Exports_Summary"),
+ aepText,
configuration.getText("doclet.modules"),
configuration.getText("doclet.packages"));
- Content aepTable = getTableHeader(aepText, aepTableSummary, HtmlStyle.packagesSummary,
- indirectPackagesTableHeader);
+ Content aepTable = getTable(aepText, aepTableSummary, HtmlStyle.packagesSummary,
+ indirectPackagesHeader);
Content aepTbody = new HtmlTree(HtmlTag.TBODY);
addIndirectPackages(aepTbody, indirectPackages);
aepTable.addContent(aepTbody);
@@ -585,11 +595,11 @@
if (display(indirectOpenPackages)) {
String aopText = configuration.getText("doclet.Indirect_Opens_Summary");
String aopTableSummary = configuration.getText("doclet.Indirect_Packages_Table_Summary",
- configuration.getText("doclet.Indirect_Opens_Summary"),
+ aopText,
configuration.getText("doclet.modules"),
configuration.getText("doclet.packages"));
- Content aopTable = getTableHeader(aopText, aopTableSummary, HtmlStyle.packagesSummary,
- indirectPackagesTableHeader);
+ Content aopTable = getTable(aopText, aopTableSummary, HtmlStyle.packagesSummary,
+ indirectPackagesHeader);
Content aopTbody = new HtmlTree(HtmlTag.TBODY);
addIndirectPackages(aopTbody, indirectOpenPackages);
aopTable.addContent(aopTbody);
@@ -616,7 +626,10 @@
ModulePackageTypes type = modulePackageTypes.iterator().next();
caption = getTableCaption(configuration.getContent(type.tableTabs().resourceKey()));
}
- Content table = getTableHeader(caption, tableSummary, HtmlStyle.packagesSummary, exportedPackagesTableHeader);
+ TableHeader header = (configuration.docEnv.getModuleMode() == ModuleMode.ALL)
+ ? new TableHeader(contents.packageLabel, contents.moduleLabel, contents.descriptionLabel)
+ : new TableHeader(contents.packageLabel, contents.descriptionLabel);
+ Content table = getTable(caption, tableSummary, HtmlStyle.packagesSummary, header);
table.addContent(tbody);
li.addContent(table);
}
@@ -698,20 +711,20 @@
HtmlTree tdModules = new HtmlTree(HtmlTag.TD);
tdModules.addStyle(HtmlStyle.colSecond);
tdModules.addContent(configuration.getText("doclet.None"));
- HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
- tdSummary.addStyle(HtmlStyle.colLast);
+ HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
+ tdSummary.addStyle(HtmlStyle.colLast);
addSummaryComment(pkg, tdSummary);
- HtmlTree tr = HtmlTree.TR(thPackage);
+ HtmlTree tr = HtmlTree.TR(thPackage);
tr.addContent(tdModules);
- tr.addContent(tdSummary);
- tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
+ tr.addContent(tdSummary);
+ tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
int pkgType = ModulePackageTypes.CONCEALED.tableTabs().value();
packageTypesOr = packageTypesOr | pkgType;
String tableId = "i" + counter;
counter++;
typeMap.put(tableId, pkgType);
tr.addAttr(HtmlAttr.ID, tableId);
- tbody.addContent(tr);
+ tbody.addContent(tr);
altColor = !altColor;
}
}
@@ -793,6 +806,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public void addServicesSummary(Content summaryContentTree) {
boolean haveUses = displayServices(uses, usesTrees);
@@ -803,14 +817,14 @@
li.addStyle(HtmlStyle.blockList);
addSummaryHeader(HtmlConstants.START_OF_SERVICES_SUMMARY, SectionName.SERVICES,
contents.navServices, li);
- String text;
- String tableSummary;
+ TableHeader usesProvidesTableHeader =
+ new TableHeader(contents.typeLabel, contents.descriptionLabel);
if (haveProvides) {
- text = configuration.getText("doclet.Provides_Summary");
- tableSummary = configuration.getText("doclet.Member_Table_Summary",
- configuration.getText("doclet.Provides_Summary"),
- configuration.getText("doclet.types"));
- Content table = getTableHeader(text, tableSummary, HtmlStyle.providesSummary, providesTableHeader);
+ String label = resources.getText("doclet.Provides_Summary");
+ String tableSummary = resources.getText("doclet.Member_Table_Summary",
+ label, resources.getText("doclet.types"));
+ Content table = getTable(label, tableSummary, HtmlStyle.providesSummary,
+ usesProvidesTableHeader);
Content tbody = new HtmlTree(HtmlTag.TBODY);
addProvidesList(tbody);
if (!tbody.isEmpty()) {
@@ -819,11 +833,11 @@
}
}
if (haveUses){
- text = configuration.getText("doclet.Uses_Summary");
- tableSummary = configuration.getText("doclet.Member_Table_Summary",
- configuration.getText("doclet.Uses_Summary"),
- configuration.getText("doclet.types"));
- Content table = getTableHeader(text, tableSummary, HtmlStyle.usesSummary, usesTableHeader);
+ String label = resources.getText("doclet.Uses_Summary");
+ String tableSummary = resources.getText("doclet.Member_Table_Summary",
+ label, resources.getText("doclet.types"));
+ Content table = getTable(label, tableSummary, HtmlStyle.usesSummary,
+ usesProvidesTableHeader);
Content tbody = new HtmlTree(HtmlTag.TBODY);
addUsesList(tbody);
if (!tbody.isEmpty()) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java Fri Oct 20 11:08:18 2017 -0700
@@ -25,12 +25,10 @@
package jdk.javadoc.internal.doclets.formats.html;
-import java.util.Arrays;
-import java.util.List;
-
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
+import jdk.javadoc.internal.doclets.formats.html.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.HtmlTree;
@@ -77,6 +75,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public void addMemberTree(Content memberSummaryTree, Content memberTree) {
writer.addMemberTree(memberSummaryTree, memberTree);
}
@@ -113,14 +112,14 @@
* {@inheritDoc}
*/
@Override
- public List<String> getSummaryTableHeader(Element member) {
+ public TableHeader getSummaryTableHeader(Element member) {
if (utils.isInterface(member)) {
- return Arrays.asList(writer.getModifierTypeHeader(),
- resources.getText("doclet.Interface"), resources.getText("doclet.Description"));
+ return new TableHeader(contents.modifierAndTypeLabel, contents.interfaceLabel,
+ contents.descriptionLabel);
} else {
- return Arrays.asList(writer.getModifierTypeHeader(),
- resources.getText("doclet.Class"), resources.getText("doclet.Description"));
+ return new TableHeader(contents.modifierAndTypeLabel, contents.classLabel,
+ contents.descriptionLabel);
}
}
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java Fri Oct 20 11:08:18 2017 -0700
@@ -128,7 +128,7 @@
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(HtmlStyle.overviewSummary, getTableCaption(new RawHtml(text)))
: HtmlTree.TABLE(HtmlStyle.overviewSummary, tableSummary, getTableCaption(new RawHtml(text)));
- table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
+ table.addContent(getPackageTableHeader().toContent());
Content tbody = new HtmlTree(HtmlTag.TBODY);
addPackagesList(packages, tbody);
table.addContent(tbody);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java Fri Oct 20 11:08:18 2017 -0700
@@ -58,11 +58,15 @@
final PackageElement packageElement;
final SortedMap<String, Set<TypeElement>> usingPackageToUsedClasses = new TreeMap<>();
protected HtmlTree mainTree = HtmlTree.MAIN();
+ final String packageUseTableSummary;
/**
* Constructor.
*
- * @param filename the file to be generated.
+ * @param configuration the configuration
+ * @param mapper a mapper to provide details of where elements are used
+ * @param filename the file to be generated
+ * @param pkgElement the package element to be documented
*/
public PackageUseWriter(HtmlConfiguration configuration,
ClassUseMapper mapper, DocPath filename,
@@ -89,6 +93,9 @@
}
}
}
+
+ packageUseTableSummary = resources.getText("doclet.Use_Table_Summary",
+ resources.getText("doclet.packages"));
}
/**
@@ -163,8 +170,8 @@
getPackageLink(packageElement, utils.getPackageName(packageElement))));
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
- : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption);
- table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
+ : HtmlTree.TABLE(HtmlStyle.useSummary, packageUseTableSummary, caption);
+ table.addContent(getPackageTableHeader().toContent());
Content tbody = new HtmlTree(HtmlTag.TBODY);
boolean altColor = true;
for (String pkgname: usingPackageToUsedClasses.keySet()) {
@@ -186,8 +193,8 @@
* @param contentTree the content tree to which the class list will be added
*/
protected void addClassList(Content contentTree) {
- List<String> classTableHeader = Arrays.asList(
- resources.getText("doclet.Class"), resources.getText("doclet.Description"));
+ TableHeader classTableHeader = new TableHeader(
+ contents.classLabel, contents.descriptionLabel);
for (String packageName : usingPackageToUsedClasses.keySet()) {
PackageElement usingPackage = utils.elementUtils.getPackageElement(packageName);
HtmlTree li = new HtmlTree(HtmlTag.LI);
@@ -204,7 +211,7 @@
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
: HtmlTree.TABLE(HtmlStyle.useSummary, tableSummary, caption);
- table.addContent(getSummaryTableHeader(classTableHeader, "col"));
+ table.addContent(classTableHeader.toContent());
Content tbody = new HtmlTree(HtmlTag.TBODY);
boolean altColor = true;
for (TypeElement te : usingPackageToUsedClasses.get(packageName)) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java Fri Oct 20 11:08:18 2017 -0700
@@ -198,14 +198,97 @@
* {@inheritDoc}
*/
@Override
+ public void addInterfaceSummary(SortedSet<TypeElement> interfaces, Content summaryContentTree) {
+ String label = resources.getText("doclet.Interface_Summary");
+ String tableSummary = resources.getText("doclet.Member_Table_Summary",
+ resources.getText("doclet.Interface_Summary"),
+ resources.getText("doclet.interfaces"));
+ TableHeader tableHeader= new TableHeader(contents.interfaceLabel, contents.descriptionLabel);
+
+ addClassesSummary(interfaces, label, tableSummary, tableHeader, summaryContentTree);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void addClassSummary(SortedSet<TypeElement> classes, Content summaryContentTree) {
+ String label = resources.getText("doclet.Class_Summary");
+ String tableSummary = resources.getText("doclet.Member_Table_Summary",
+ resources.getText("doclet.Class_Summary"),
+ resources.getText("doclet.classes"));
+ TableHeader tableHeader= new TableHeader(contents.classLabel, contents.descriptionLabel);
+
+ addClassesSummary(classes, label, tableSummary, tableHeader, summaryContentTree);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void addEnumSummary(SortedSet<TypeElement> enums, Content summaryContentTree) {
+ String label = resources.getText("doclet.Enum_Summary");
+ String tableSummary = resources.getText("doclet.Member_Table_Summary",
+ resources.getText("doclet.Enum_Summary"),
+ resources.getText("doclet.enums"));
+ TableHeader tableHeader= new TableHeader(contents.enum_, contents.descriptionLabel);
+
+ addClassesSummary(enums, label, tableSummary, tableHeader, summaryContentTree);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void addExceptionSummary(SortedSet<TypeElement> exceptions, Content summaryContentTree) {
+ String label = resources.getText("doclet.Exception_Summary");
+ String tableSummary = resources.getText("doclet.Member_Table_Summary",
+ resources.getText("doclet.Exception_Summary"),
+ resources.getText("doclet.exceptions"));
+ TableHeader tableHeader= new TableHeader(contents.exception, contents.descriptionLabel);
+
+ addClassesSummary(exceptions, label, tableSummary, tableHeader, summaryContentTree);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void addErrorSummary(SortedSet<TypeElement> errors, Content summaryContentTree) {
+ String label = resources.getText("doclet.Error_Summary");
+ String tableSummary = resources.getText("doclet.Member_Table_Summary",
+ resources.getText("doclet.Error_Summary"),
+ resources.getText("doclet.errors"));
+ TableHeader tableHeader= new TableHeader(contents.error, contents.descriptionLabel);
+
+ addClassesSummary(errors, label, tableSummary, tableHeader, summaryContentTree);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void addAnnotationTypeSummary(SortedSet<TypeElement> annoTypes, Content summaryContentTree) {
+ String label = resources.getText("doclet.Annotation_Types_Summary");
+ String tableSummary = resources.getText("doclet.Member_Table_Summary",
+ resources.getText("doclet.Annotation_Types_Summary"),
+ resources.getText("doclet.annotationtypes"));
+ TableHeader tableHeader= new TableHeader(contents.annotationType, contents.descriptionLabel);
+
+ addClassesSummary(annoTypes, label, tableSummary, tableHeader, summaryContentTree);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public void addClassesSummary(SortedSet<TypeElement> classes, String label,
- String tableSummary, List<String> tableHeader, Content summaryContentTree) {
+ String tableSummary, TableHeader tableHeader, Content summaryContentTree) {
if(!classes.isEmpty()) {
Content caption = getTableCaption(new RawHtml(label));
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(HtmlStyle.typeSummary, caption)
: HtmlTree.TABLE(HtmlStyle.typeSummary, tableSummary, caption);
- table.addContent(getSummaryTableHeader(tableHeader, "col"));
+ table.addContent(tableHeader.toContent());
Content tbody = new HtmlTree(HtmlTag.TBODY);
boolean altColor = false;
for (TypeElement klass : classes) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java Fri Oct 20 11:08:18 2017 -0700
@@ -25,13 +25,12 @@
package jdk.javadoc.internal.doclets.formats.html;
-import java.util.Arrays;
-import java.util.List;
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.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;
@@ -66,8 +65,7 @@
* {@inheritDoc}
*/
@Override
- public Content getMemberSummaryHeader(TypeElement typeElement,
- Content memberSummaryTree) {
+ public Content getMemberSummaryHeader(TypeElement typeElement, Content memberSummaryTree) {
memberSummaryTree.addContent(HtmlConstants.START_OF_PROPERTY_SUMMARY);
Content memberTree = writer.getMemberTreeHeader();
writer.addSummaryHeader(this, typeElement, memberTree);
@@ -82,6 +80,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public void addMemberTree(Content memberSummaryTree, Content memberTree) {
writer.addMemberTree(memberSummaryTree, memberTree);
}
@@ -237,10 +236,9 @@
* {@inheritDoc}
*/
@Override
- public List<String> getSummaryTableHeader(Element member) {
- List<String> header = Arrays.asList(resources.getText("doclet.Type"),
- resources.getText("doclet.Property"), resources.getText("doclet.Description"));
- return header;
+ public TableHeader getSummaryTableHeader(Element member) {
+ return new TableHeader(contents.typeLabel, contents.propertyLabel,
+ contents.descriptionLabel);
}
/**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java Fri Oct 20 11:08:18 2017 -0700
@@ -25,7 +25,6 @@
package jdk.javadoc.internal.doclets.formats.html;
-import java.io.*;
import java.util.*;
import javax.lang.model.element.Element;
@@ -105,7 +104,7 @@
Content table = (configuration.isOutputHtml5())
? HtmlTree.TABLE(HtmlStyle.memberSummary, caption)
: HtmlTree.TABLE(HtmlStyle.memberSummary, mw.getTableSummary(), caption);
- table.addContent(getSummaryTableHeader(mw.getSummaryTableHeader(typeElement), "col"));
+ table.addContent(mw.getSummaryTableHeader(typeElement).toContent());
for (Content tableContent : tableContents) {
table.addContent(tableContent);
}
@@ -356,6 +355,7 @@
*
* @param style the style class to be added to the content tree
* @param contentTree the tree used to generate the complete member tree
+ * @return the member tree
*/
public Content getMemberTree(HtmlStyle style, Content contentTree) {
Content div = HtmlTree.DIV(style, getMemberTree(contentTree));
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TableHeader.java Fri Oct 20 11:08:18 2017 -0700
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2017, 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 java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+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.toolkit.Content;
+
+/**
+ * A row header for an HTML table.
+ *
+ * The header contains a list of {@code <th>} cells, providing the column headers.
+ * The attribute {@code scope="col"} is automatically added to each header cell.
+ * In addition, a series of style class names can be specified, to be applied one per cell.
+ *
+ */
+public class TableHeader {
+
+ /**
+ * The content to be put in each of the {@code <th>} cells in the header row.
+ */
+ private final List<Content> cellContents;
+ /**
+ * The style class names for each of the {@code <th>} cells in the header row.
+ * If not set, default style names will be used.
+ */
+ private List<HtmlStyle> styles;
+
+ /**
+ * Creates a header row, with localized content for each cell.
+ * Resources keys will be converted to content using {@link Contents#getContent(String)}.
+ * @param contents a factory to get the content for each header cell.
+ * @param colHeaderKeys the resource keys for the content in each cell.
+ */
+ TableHeader(Contents contents, String... colHeaderKeys) {
+ this.cellContents = Arrays.stream(colHeaderKeys)
+ .map((key) -> contents.getContent(key))
+ .collect(Collectors.toList());
+ }
+
+ /**
+ * Creates a header row, with specified content for each cell.
+ * @param headerCellContents a content object for each header cell
+ */
+ TableHeader(Content... headerCellContents) {
+ this.cellContents = Arrays.asList(headerCellContents);
+ }
+
+ /**
+ * Set the style class names for each header cell.
+ * The number of names must match the number of cells given to the constructor.
+ * @param styles the style class names
+ * @return this object
+ */
+ TableHeader styles(HtmlStyle... styles) {
+ if (styles.length != cellContents.size()) {
+ throw new IllegalStateException();
+ }
+ this.styles = Arrays.asList(styles);
+ return this;
+ }
+
+ /**
+ * Converts this header to a {@link Content} object, for use in an {@link HtmlTree}.
+ * @returns a Content object
+ */
+ Content toContent() {
+ String scope = "col";
+ Content tr = new HtmlTree(HtmlTag.TR);
+ int i = 0;
+ for (Content cellContent : cellContents) {
+ HtmlStyle style = (styles != null) ? styles.get(i)
+ : (i == 0) ? HtmlStyle.colFirst
+ : (i == (cellContents.size() - 1)) ? HtmlStyle.colLast
+ : (i == 1) ? HtmlStyle.colSecond : null;
+ Content cell = (style == null) ? HtmlTree.TH(scope, cellContent)
+ : HtmlTree.TH(style, scope, cellContent);
+ tr.addContent(cell);
+ i++;
+ }
+ return tr;
+ }
+
+}
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocWriter.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlDocWriter.java Fri Oct 20 11:08:18 2017 -0700
@@ -33,7 +33,6 @@
import jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration;
import jdk.javadoc.internal.doclets.formats.html.SectionName;
-import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.Messages;
import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
@@ -78,14 +77,6 @@
DocFile.createFileForOutput(configuration, filename).getPath());
}
- /**
- * Accessor for configuration.
- * @return the configuration for this doclet
- */
- public BaseConfiguration configuration() {
- return configuration;
- }
-
public Content getHyperLink(DocPath link, String label) {
return getHyperLink(link, new StringContent(label), false, "", "", "");
}
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlWriter.java Fri Oct 20 11:08:18 2017 -0700
@@ -28,8 +28,7 @@
import java.io.*;
import java.util.*;
-import jdk.javadoc.doclet.DocletEnvironment.ModuleMode;
-import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
+import jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration;
import jdk.javadoc.internal.doclets.toolkit.Content;
import jdk.javadoc.internal.doclets.toolkit.Resources;
import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
@@ -55,59 +54,14 @@
public class HtmlWriter {
/**
- * The window title of this file
+ * The window title of this file.
*/
protected String winTitle;
/**
- * The configuration
- */
- protected BaseConfiguration configuration;
-
- /**
- * Header for table displaying modules and description.
- */
- protected final List<String> moduleTableHeader;
-
- /**
- * Header for tables displaying packages and description.
- */
- protected final List<String> packageTableHeader;
-
- /**
- * Header for tables displaying modules and description.
- */
- protected final List<String> requiresTableHeader;
-
- /**
- * Header for tables displaying packages and description.
+ * The configuration.
*/
- protected final List<String> exportedPackagesTableHeader;
-
- /**
- * Header for tables displaying modules and exported packages.
- */
- protected final List<String> indirectPackagesTableHeader;
-
- /**
- * Header for tables displaying types and description.
- */
- protected final List<String> usesTableHeader;
-
- /**
- * Header for tables displaying types and description.
- */
- protected final List<String> providesTableHeader;
-
- /**
- * Summary for use tables displaying class and package use.
- */
- protected final String useTableSummary;
-
- /**
- * Column header for class docs displaying Modifier and Type header.
- */
- protected final String modifierTypeHeader;
+ protected HtmlConfiguration configuration;
private final DocFile docFile;
@@ -117,47 +71,18 @@
/**
* Constructor.
*
- * @param path The directory path to be created for this file
- * or null if none to be created.
+ * @param configuration the configuration
+ * @param path the directory path to be created for this file,
+ * or null if none to be created
*/
- public HtmlWriter(BaseConfiguration configuration, DocPath path) {
+ public HtmlWriter(HtmlConfiguration configuration, DocPath path) {
+ this.configuration = configuration;
docFile = DocFile.createFileForOutput(configuration, path);
- this.configuration = configuration;
// The following should be converted to shared Content objects
// and moved to Contents, but that will require additional
// changes at the use sites.
Resources resources = configuration.getResources();
- moduleTableHeader = Arrays.asList(
- resources.getText("doclet.Module"),
- resources.getText("doclet.Description"));
- packageTableHeader = new ArrayList<>();
- packageTableHeader.add(resources.getText("doclet.Package"));
- packageTableHeader.add(resources.getText("doclet.Description"));
- requiresTableHeader = new ArrayList<>();
- requiresTableHeader.add(resources.getText("doclet.Modifier"));
- requiresTableHeader.add(resources.getText("doclet.Module"));
- requiresTableHeader.add(resources.getText("doclet.Description"));
- exportedPackagesTableHeader = new ArrayList<>();
- exportedPackagesTableHeader.add(resources.getText("doclet.Package"));
- if (configuration.docEnv.getModuleMode() == ModuleMode.ALL) {
- exportedPackagesTableHeader.add(resources.getText("doclet.Module"));
- }
- exportedPackagesTableHeader.add(resources.getText("doclet.Description"));
- indirectPackagesTableHeader = new ArrayList<>();
- indirectPackagesTableHeader.add(resources.getText("doclet.From"));
- indirectPackagesTableHeader.add(resources.getText("doclet.Packages"));
- usesTableHeader = new ArrayList<>();
- usesTableHeader.add(resources.getText("doclet.Type"));
- usesTableHeader.add(resources.getText("doclet.Description"));
- providesTableHeader = new ArrayList<>();
- providesTableHeader.add(resources.getText("doclet.Type"));
- providesTableHeader.add(resources.getText("doclet.Description"));
- useTableSummary = resources.getText("doclet.Use_Table_Summary",
- resources.getText("doclet.packages"));
- modifierTypeHeader = resources.getText("doclet.0_and_1",
- resources.getText("doclet.Modifier"),
- resources.getText("doclet.Type"));
}
public void write(Content c) throws DocFileIOException {
@@ -392,11 +317,4 @@
HtmlTree title = HtmlTree.TITLE(new StringContent(winTitle));
return title;
}
-
- /*
- * Returns a header for Modifier and Type column of a table.
- */
- public String getModifierTypeHeader() {
- return modifierTypeHeader;
- }
}
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseConfiguration.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/BaseConfiguration.java Fri Oct 20 11:08:18 2017 -0700
@@ -564,7 +564,7 @@
new Option(resources, "-linkoffline", 2) {
@Override
public boolean process(String opt, List<String> args) {
- linkOfflineList.add(new Pair<String, String>(args.get(0), args.get(1)));
+ linkOfflineList.add(new Pair<>(args.get(0), args.get(1)));
return true;
}
},
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/PackageSummaryWriter.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/PackageSummaryWriter.java Fri Oct 20 11:08:18 2017 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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
@@ -25,7 +25,6 @@
package jdk.javadoc.internal.doclets.toolkit;
-import java.util.List;
import java.util.SortedSet;
import javax.lang.model.element.TypeElement;
@@ -69,16 +68,58 @@
public abstract Content getSummaryHeader();
/**
+ * Adds the table of interfaces to the documentation tree.
+ *
+ * @param interfaces the interfaces to document.
+ * @param summaryContentTree the content tree to which the summaries will be added
+ */
+ public abstract void addInterfaceSummary(SortedSet<TypeElement> interfaces,
+ Content summaryContentTree);
+
+ /**
* Adds the table of classes to the documentation tree.
*
- * @param classes the array of classes to document.
- * @param label the label for this table.
- * @param tableSummary the summary string for the table
- * @param tableHeader array of table headers
+ * @param classes the classes to document.
+ * @param summaryContentTree the content tree to which the summaries will be added
+ */
+ public abstract void addClassSummary(SortedSet<TypeElement> classes,
+ Content summaryContentTree);
+
+ /**
+ * Adds the table of enums to the documentation tree.
+ *
+ * @param enums the enums to document.
+ * @param summaryContentTree the content tree to which the summaries will be added
+ */
+ public abstract void addEnumSummary(SortedSet<TypeElement> enums,
+ Content summaryContentTree);
+
+ /**
+ * Adds the table of exceptions to the documentation tree.
+ *
+ * @param exceptions the exceptions to document.
* @param summaryContentTree the content tree to which the summaries will be added
*/
- public abstract void addClassesSummary(SortedSet<TypeElement> classes, String label,
- String tableSummary, List<String> tableHeader, Content summaryContentTree);
+ public abstract void addExceptionSummary(SortedSet<TypeElement> exceptions,
+ Content summaryContentTree);
+
+ /**
+ * Adds the table of errors to the documentation tree.
+ *
+ * @param errors the errors to document.
+ * @param summaryContentTree the content tree to which the summaries will be added
+ */
+ public abstract void addErrorSummary(SortedSet<TypeElement> errors,
+ Content summaryContentTree);
+
+ /**
+ * Adds the table of annotation types to the documentation tree.
+ *
+ * @param annoTypes the annotation types to document.
+ * @param summaryContentTree the content tree to which the summaries will be added
+ */
+ public abstract void addAnnotationTypeSummary(SortedSet<TypeElement> annoTypes,
+ Content summaryContentTree);
/**
* Adds the package description from the "packages.html" file to the documentation
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java Fri Oct 20 11:08:18 2017 -0700
@@ -25,8 +25,6 @@
package jdk.javadoc.internal.doclets.toolkit.builders;
-import java.util.Arrays;
-import java.util.List;
import java.util.Set;
import java.util.SortedSet;
@@ -171,21 +169,12 @@
* will be added
*/
protected void buildInterfaceSummary(Content summaryContentTree) {
- String interfaceTableSummary =
- configuration.getText("doclet.Member_Table_Summary",
- configuration.getText("doclet.Interface_Summary"),
- configuration.getText("doclet.interfaces"));
- List<String> interfaceTableHeader = Arrays.asList(configuration.getText("doclet.Interface"),
- configuration.getText("doclet.Description"));
-
SortedSet<TypeElement> ilist = utils.isSpecified(packageElement)
? utils.getTypeElementsAsSortedSet(utils.getInterfaces(packageElement))
: configuration.typeElementCatalog.interfaces(packageElement);
SortedSet<TypeElement> interfaces = utils.filterOutPrivateClasses(ilist, configuration.javafx);
if (!interfaces.isEmpty()) {
- packageWriter.addClassesSummary(interfaces,
- configuration.getText("doclet.Interface_Summary"),
- interfaceTableSummary, interfaceTableHeader, summaryContentTree);
+ packageWriter.addInterfaceSummary(interfaces, summaryContentTree);
}
}
@@ -196,20 +185,12 @@
* be added
*/
protected void buildClassSummary(Content summaryContentTree) {
- String classTableSummary =
- configuration.getText("doclet.Member_Table_Summary",
- configuration.getText("doclet.Class_Summary"),
- configuration.getText("doclet.classes"));
- List<String> classTableHeader = Arrays.asList(configuration.getText("doclet.Class"),
- configuration.getText("doclet.Description"));
SortedSet<TypeElement> clist = utils.isSpecified(packageElement)
? utils.getTypeElementsAsSortedSet(utils.getOrdinaryClasses(packageElement))
: configuration.typeElementCatalog.ordinaryClasses(packageElement);
SortedSet<TypeElement> classes = utils.filterOutPrivateClasses(clist, configuration.javafx);
if (!classes.isEmpty()) {
- packageWriter.addClassesSummary(classes,
- configuration.getText("doclet.Class_Summary"),
- classTableSummary, classTableHeader, summaryContentTree);
+ packageWriter.addClassSummary(classes, summaryContentTree);
}
}
@@ -220,20 +201,12 @@
* be added
*/
protected void buildEnumSummary(Content summaryContentTree) {
- String enumTableSummary =
- configuration.getText("doclet.Member_Table_Summary",
- configuration.getText("doclet.Enum_Summary"),
- configuration.getText("doclet.enums"));
- List<String> enumTableHeader = Arrays.asList(configuration.getText("doclet.Enum"),
- configuration.getText("doclet.Description"));
SortedSet<TypeElement> elist = utils.isSpecified(packageElement)
? utils.getTypeElementsAsSortedSet(utils.getEnums(packageElement))
: configuration.typeElementCatalog.enums(packageElement);
SortedSet<TypeElement> enums = utils.filterOutPrivateClasses(elist, configuration.javafx);
if (!enums.isEmpty()) {
- packageWriter.addClassesSummary(enums,
- configuration.getText("doclet.Enum_Summary"),
- enumTableSummary, enumTableHeader, summaryContentTree);
+ packageWriter.addEnumSummary(enums, summaryContentTree);
}
}
@@ -244,12 +217,6 @@
* be added
*/
protected void buildExceptionSummary(Content summaryContentTree) {
- String exceptionTableSummary =
- configuration.getText("doclet.Member_Table_Summary",
- configuration.getText("doclet.Exception_Summary"),
- configuration.getText("doclet.exceptions"));
- List<String> exceptionTableHeader = Arrays.asList(configuration.getText("doclet.Exception"),
- configuration.getText("doclet.Description"));
Set<TypeElement> iexceptions =
utils.isSpecified(packageElement)
? utils.getTypeElementsAsSortedSet(utils.getExceptions(packageElement))
@@ -257,9 +224,7 @@
SortedSet<TypeElement> exceptions = utils.filterOutPrivateClasses(iexceptions,
configuration.javafx);
if (!exceptions.isEmpty()) {
- packageWriter.addClassesSummary(exceptions,
- configuration.getText("doclet.Exception_Summary"),
- exceptionTableSummary, exceptionTableHeader, summaryContentTree);
+ packageWriter.addExceptionSummary(exceptions, summaryContentTree);
}
}
@@ -270,21 +235,13 @@
* be added
*/
protected void buildErrorSummary(Content summaryContentTree) {
- String errorTableSummary =
- configuration.getText("doclet.Member_Table_Summary",
- configuration.getText("doclet.Error_Summary"),
- configuration.getText("doclet.errors"));
- List<String> errorTableHeader = Arrays.asList(configuration.getText("doclet.Error"),
- configuration.getText("doclet.Description"));
Set<TypeElement> ierrors =
utils.isSpecified(packageElement)
? utils.getTypeElementsAsSortedSet(utils.getErrors(packageElement))
: configuration.typeElementCatalog.errors(packageElement);
SortedSet<TypeElement> errors = utils.filterOutPrivateClasses(ierrors, configuration.javafx);
if (!errors.isEmpty()) {
- packageWriter.addClassesSummary(errors,
- configuration.getText("doclet.Error_Summary"),
- errorTableSummary, errorTableHeader, summaryContentTree);
+ packageWriter.addErrorSummary(errors, summaryContentTree);
}
}
@@ -295,13 +252,6 @@
* summary will be added
*/
protected void buildAnnotationTypeSummary(Content summaryContentTree) {
- String annotationtypeTableSummary =
- configuration.getText("doclet.Member_Table_Summary",
- configuration.getText("doclet.Annotation_Types_Summary"),
- configuration.getText("doclet.annotationtypes"));
- List<String> annotationtypeTableHeader = Arrays.asList(
- configuration.getText("doclet.AnnotationType"),
- configuration.getText("doclet.Description"));
SortedSet<TypeElement> iannotationTypes =
utils.isSpecified(packageElement)
? utils.getTypeElementsAsSortedSet(utils.getAnnotationTypes(packageElement))
@@ -309,10 +259,7 @@
SortedSet<TypeElement> annotationTypes = utils.filterOutPrivateClasses(iannotationTypes,
configuration.javafx);
if (!annotationTypes.isEmpty()) {
- packageWriter.addClassesSummary(annotationTypes,
- configuration.getText("doclet.Annotation_Types_Summary"),
- annotationtypeTableSummary, annotationtypeTableHeader,
- summaryContentTree);
+ packageWriter.addAnnotationTypeSummary(annotationTypes, summaryContentTree);
}
}
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties Fri Oct 20 09:49:02 2017 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties Fri Oct 20 11:08:18 2017 -0700
@@ -207,6 +207,7 @@
doclet.subinterfaces=subinterfaces
doclet.Modifier=Modifier
doclet.Type=Type
+doclet.Modifier_and_Type=Modifier and Type
doclet.Implementation=Implementation(s):
doclet.Types=Types
doclet.Members=Members
@@ -224,7 +225,6 @@
doclet.Description=Description
doclet.ConstantField=Constant Field
doclet.Value=Value
-doclet.0_and_1={0} and {1}
#Documentation for Enums
doclet.enum_values_doc.fullbody=\