Class Table
- java.lang.Object
-
- org.jacoco.report.internal.html.table.Table
-
public class Table extends java.lang.ObjectRenderer for a table ofITableItems.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classTable.Column
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Table.Column>columnsprivate java.util.Comparator<ITableItem>defaultComparator
-
Constructor Summary
Constructors Constructor Description Table()Create a new table without any columns yet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String header, java.lang.String style, IColumnRenderer renderer, boolean defaultSorting)Adds a new column with the given properties to the table.private voidbody(HTMLElement table, java.util.List<? extends ITableItem> items, Resources resources, ReportOutputFolder base)private voidfooter(HTMLElement table, ICoverageNode total, Resources resources, ReportOutputFolder base)private voidheader(HTMLElement table, java.util.List<? extends ITableItem> items, ICoverageNode total)voidrender(HTMLElement parent, java.util.List<? extends ITableItem> items, ICoverageNode total, Resources resources, ReportOutputFolder base)Renders a table for the given iconprivate java.util.List<? extends ITableItem>sort(java.util.List<? extends ITableItem> items)
-
-
-
Field Detail
-
columns
private final java.util.List<Table.Column> columns
-
defaultComparator
private java.util.Comparator<ITableItem> defaultComparator
-
-
Method Detail
-
add
public void add(java.lang.String header, java.lang.String style, IColumnRenderer renderer, boolean defaultSorting)Adds a new column with the given properties to the table.- Parameters:
header- column header captionstyle- optional CSS style class name for the td-Elements of this columnrenderer- callback for column renderingdefaultSorting- Iftrue, this column is the default sorting column. Only one column can be selected for default sorting.
-
render
public void render(HTMLElement parent, java.util.List<? extends ITableItem> items, ICoverageNode total, Resources resources, ReportOutputFolder base) throws java.io.IOException
Renders a table for the given icon- Parameters:
parent- parent element in which the table is createditems- items that will make the table rowstotal- the summary of all coverage data items in the table static resources that might be referencedresources- static resources that might be referencedbase- base folder of the table- Throws:
java.io.IOException- in case of IO problems with the element output
-
header
private void header(HTMLElement table, java.util.List<? extends ITableItem> items, ICoverageNode total) throws java.io.IOException
- Throws:
java.io.IOException
-
footer
private void footer(HTMLElement table, ICoverageNode total, Resources resources, ReportOutputFolder base) throws java.io.IOException
- Throws:
java.io.IOException
-
body
private void body(HTMLElement table, java.util.List<? extends ITableItem> items, Resources resources, ReportOutputFolder base) throws java.io.IOException
- Throws:
java.io.IOException
-
sort
private java.util.List<? extends ITableItem> sort(java.util.List<? extends ITableItem> items)
-
-