APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.javadoc.internal.doclets.formats.html

public Class TableHeader

extends Content
Class Inheritance
Imports
java.io.IOException, .Writer, java.util.Arrays, .List, jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyles, jdk.javadoc.internal.html.Content, .ContentBuilder, .HtmlAttr, .HtmlStyle, .HtmlTree

A row of header cells for an HTML table. The header contains a list of <th> cells, providing the column headers. The attribute 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.

Field Summary

Modifier and TypeField and Description
private final List<Content>
cellContents

The content to be put in each of the <th> cells in the header row.

private boolean[]
private List<HtmlStyle>
styles

The style class names for each of the <th> cells in the header row.

Constructor Summary

AccessConstructor and Description
public
TableHeader(Contents
a factory to get the content for each header cell.
contents
,
String...
the resource keys for the content in each cell.
colHeaderKeys
)

Creates a header row, with localized content for each cell.

public
TableHeader(Content...
a content object for each header cell
headerCellContents
)

Creates a header row, with specified content for each cell.

public
TableHeader(List<Content>
a content object for each header cell
headerCellContents
)

Creates a header row, with specified content for each cell.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

false
isEmpty
()

Implements abstract jdk.javadoc.internal.html.Content.isEmpty.

Returns true if the content is empty.

public TableHeader

Returns:

this object
sortable
(boolean...
boolean array specifying sortable columns
sortable
)

Makes the table sortable by the content of columns for which the argument boolean array contains true.

public TableHeader

Returns:

this object
styles
(HtmlStyle...
the style class names
styles
)

Set the style class names for each header cell.

public TableHeader

Returns:

this object
styles
(List<HtmlStyle>
the style class names
styles
)

Set the style class names for each header cell.

private Content

Returns:

a Content object
toContent
()

Converts this header to a Content object, for use in an HtmlTree.

public boolean
write(Writer out, String newline, boolean atNewline)

Implements abstract jdk.javadoc.internal.html.Content.write.

Writes content to a writer, using a given newline sequence, which should be either \n or the platform line separator.

Inherited from jdk.javadoc.internal.html.Content:
addaddaddAllcharCountisDiscardableisPhrasingContentstripTagstoString

Field Detail

cellContentsback to summary
private final List<Content> cellContents

The content to be put in each of the <th> cells in the header row.

sortableback to summary
private boolean[] sortable
stylesback to summary
private List<HtmlStyle> styles

The style class names for each of the <th> cells in the header row. If not set, default style names will be used.

Constructor Detail

TableHeaderback to summary
public TableHeader(Contents contents, String... colHeaderKeys)

Creates a header row, with localized content for each cell. Resources keys will be converted to content using Contents#getContent(String).

Parameters
contents:Contents

a factory to get the content for each header cell.

colHeaderKeys:String[]

the resource keys for the content in each cell.

TableHeaderback to summary
public TableHeader(Content... headerCellContents)

Creates a header row, with specified content for each cell.

Parameters
headerCellContents:Content[]

a content object for each header cell

TableHeaderback to summary
public TableHeader(List<Content> headerCellContents)

Creates a header row, with specified content for each cell.

Parameters
headerCellContents:List<Content>

a content object for each header cell

Method Detail

isEmptyback to summary
public boolean isEmpty()

Implements abstract jdk.javadoc.internal.html.Content.isEmpty.

Doc from jdk.javadoc.internal.html.Content.isEmpty.

Returns true if the content is empty.

Implementation Specification

This implementation always returns false.

Returns:boolean

false

Annotations
@Override
sortableback to summary
public TableHeader sortable(boolean... sortable)

Makes the table sortable by the content of columns for which the argument boolean array contains true.

Parameters
sortable:boolean[]

boolean array specifying sortable columns

Returns:TableHeader

this object

stylesback to summary
public TableHeader styles(HtmlStyle... styles)

Set the style class names for each header cell. The number of names must match the number of cells given to the constructor.

Parameters
styles:HtmlStyle[]

the style class names

Returns:TableHeader

this object

stylesback to summary
public TableHeader styles(List<HtmlStyle> styles)

Set the style class names for each header cell. The number of names must match the number of cells given to the constructor.

Parameters
styles:List<HtmlStyle>

the style class names

Returns:TableHeader

this object

toContentback to summary
private Content toContent()

Converts this header to a Content object, for use in an HtmlTree.

Returns:Content

a Content object

writeback to summary
public boolean write(Writer out, String newline, boolean atNewline) throws IOException

Implements abstract jdk.javadoc.internal.html.Content.write.

Doc from jdk.javadoc.internal.html.Content.write.

Writes content to a writer, using a given newline sequence, which should be either \n or the platform line separator.

Annotations
@Override
Exceptions
IOException:
if an error occurs while writing the output