mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8203791: Remove "compatibility" features from Table.java
Reviewed-by: jjg
This commit is contained in:
parent
73477220be
commit
38f91617c5
14 changed files with 36 additions and 87 deletions
|
@ -150,9 +150,7 @@ public class AllClassesIndexWriter extends HtmlDocletWriter {
|
|||
.addTab(resources.exceptionSummary, e -> utils.isException((TypeElement)e))
|
||||
.addTab(resources.errorSummary, e -> utils.isError((TypeElement)e))
|
||||
.addTab(resources.annotationTypeSummary, utils::isAnnotationType)
|
||||
.setTabScript(i -> "show(" + i + ");")
|
||||
.setUseTBody(false)
|
||||
.setPutIdFirst(true);
|
||||
.setTabScript(i -> "show(" + i + ");");
|
||||
for (Character unicode : indexbuilder.index()) {
|
||||
for (Element element : indexbuilder.getMemberList(unicode)) {
|
||||
TypeElement typeElement = (TypeElement) element;
|
||||
|
|
|
@ -221,8 +221,7 @@ public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
|
|||
.setCaption(caption)
|
||||
.setHeader(header)
|
||||
.setRowScopeColumn(1)
|
||||
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast)
|
||||
.setUseTBody(false); // temporary? compatibility mode for TBody
|
||||
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -242,8 +242,7 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
|
|||
.setCaption(getCaption())
|
||||
.setHeader(getSummaryTableHeader(typeElement))
|
||||
.setRowScopeColumn(1)
|
||||
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast)
|
||||
.setUseTBody(false); // temporary? compatibility mode for TBody
|
||||
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -268,8 +268,7 @@ public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
|
|||
.setCaption(contents.constructors)
|
||||
.setHeader(getSummaryTableHeader(typeElement))
|
||||
.setRowScopeColumn(rowScopeColumn)
|
||||
.setColumnStyles(bodyRowStyles)
|
||||
.setUseTBody(false); // temporary? compatibility mode for TBody
|
||||
.setColumnStyles(bodyRowStyles);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -212,8 +212,7 @@ public class EnumConstantWriterImpl extends AbstractMemberWriter
|
|||
.setSummary(summary)
|
||||
.setCaption(contents.getContent("doclet.Enum_Constants"))
|
||||
.setHeader(getSummaryTableHeader(typeElement))
|
||||
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast)
|
||||
.setUseTBody(false);
|
||||
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -218,8 +218,7 @@ public class FieldWriterImpl extends AbstractMemberWriter
|
|||
.setCaption(contents.fields)
|
||||
.setHeader(getSummaryTableHeader(typeElement))
|
||||
.setRowScopeColumn(1)
|
||||
.setColumnStyles(bodyRowStyles)
|
||||
.setUseTBody(false); // temporary? compatibility mode for TBody
|
||||
.setColumnStyles(bodyRowStyles);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -267,9 +267,7 @@ public class MethodWriterImpl extends AbstractExecutableMemberWriter
|
|||
.addTab(resources.getText("doclet.Default_Methods"), utils::isDefault)
|
||||
.addTab(resources.getText("doclet.Deprecated_Methods"),
|
||||
e -> utils.isDeprecated(e) || utils.isDeprecated(typeElement))
|
||||
.setTabScript(i -> "show(" + i + ");")
|
||||
.setUseTBody(false)
|
||||
.setPutIdFirst(true);
|
||||
.setTabScript(i -> "show(" + i + ");");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -121,8 +121,7 @@ public class NestedClassWriterImpl extends AbstractMemberWriter
|
|||
.setCaption(contents.getContent("doclet.Nested_Classes"))
|
||||
.setHeader(getSummaryTableHeader(typeElement))
|
||||
.setRowScopeColumn(1)
|
||||
.setColumnStyles(bodyRowStyles)
|
||||
.setUseTBody(false); // temporary? compatibility mode for TBody
|
||||
.setColumnStyles(bodyRowStyles);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -232,8 +232,7 @@ public class PropertyWriterImpl extends AbstractMemberWriter
|
|||
.setCaption(contents.properties)
|
||||
.setHeader(getSummaryTableHeader(typeElement))
|
||||
.setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast)
|
||||
.setRowScopeColumn(1)
|
||||
.setUseTBody(false);
|
||||
.setRowScopeColumn(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -81,10 +81,6 @@ public class Table {
|
|||
private final List<Integer> bodyRowMasks;
|
||||
private String rowIdPrefix = "i";
|
||||
|
||||
// compatibility flags
|
||||
private boolean putIdFirst = false;
|
||||
private boolean useTBody = true;
|
||||
|
||||
/**
|
||||
* Creates a builder for an HTML table.
|
||||
*
|
||||
|
@ -301,37 +297,6 @@ public class Table {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the {@code id} attribute should appear first in a {@code <tr>} tag.
|
||||
* The default is {@code false}.
|
||||
*
|
||||
* <b>This is a compatibility feature that should be removed when all tables use a
|
||||
* consistent policy.</b>
|
||||
*
|
||||
* @param first whether to put {@code id} attributes first
|
||||
* @return this object
|
||||
*/
|
||||
public Table setPutIdFirst(boolean first) {
|
||||
this.putIdFirst = first;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether or not to use an explicit {@code <tbody>} element to enclose the rows
|
||||
* of a table.
|
||||
* The default is {@code true}.
|
||||
*
|
||||
* <b>This is a compatibility feature that should be removed when all tables use a
|
||||
* consistent policy.</b>
|
||||
*
|
||||
* @param use whether o use a {@code <tbody> element
|
||||
* @return this object
|
||||
*/
|
||||
public Table setUseTBody(boolean use) {
|
||||
this.useTBody = use;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a row of data to the table.
|
||||
* Each item of content should be suitable for use as the content of a
|
||||
|
@ -399,11 +364,6 @@ public class Table {
|
|||
|
||||
HtmlTree row = new HtmlTree(HtmlTag.TR);
|
||||
|
||||
if (putIdFirst && tabMap != null) {
|
||||
int index = bodyRows.size();
|
||||
row.addAttr(HtmlAttr.ID, (rowIdPrefix + index));
|
||||
}
|
||||
|
||||
if (stripedStyles != null) {
|
||||
int rowIndex = bodyRows.size();
|
||||
row.addAttr(HtmlAttr.CLASS, stripedStyles.get(rowIndex % 2).name());
|
||||
|
@ -422,10 +382,8 @@ public class Table {
|
|||
bodyRows.add(row);
|
||||
|
||||
if (tabMap != null) {
|
||||
if (!putIdFirst) {
|
||||
int index = bodyRows.size() - 1;
|
||||
row.addAttr(HtmlAttr.ID, (rowIdPrefix + index));
|
||||
}
|
||||
int index = bodyRows.size() - 1;
|
||||
row.addAttr(HtmlAttr.ID, (rowIdPrefix + index));
|
||||
int mask = 0;
|
||||
int maskBit = 1;
|
||||
for (Map.Entry<String, Predicate<Element>> e : tabMap.entrySet()) {
|
||||
|
@ -493,13 +451,10 @@ public class Table {
|
|||
table.addContent(caption);
|
||||
}
|
||||
table.addContent(header.toContent());
|
||||
if (useTBody) {
|
||||
Content tbody = new HtmlTree(HtmlTag.TBODY);
|
||||
bodyRows.forEach(row -> tbody.addContent(row));
|
||||
table.addContent(tbody);
|
||||
} else {
|
||||
bodyRows.forEach(row -> table.addContent(row));
|
||||
}
|
||||
Content tbody = new HtmlTree(HtmlTag.TBODY);
|
||||
bodyRows.forEach(row -> tbody.addContent(row));
|
||||
table.addContent(tbody);
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue