Class DataTable
- Author:
- Dries Horions
<dries@quodlibet.be>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a CSVTable object to be able to add CSV document to a Table.DataTable(Table table, org.apache.pdfbox.pdmodel.PDPage page, UpdateCellProperty updateCellProperty) Create a CSVTable object to be able to add CSV document to a Table.Create a CSVTable object to be able to add CSV document to a Table.DataTable(Table table, org.apache.pdfbox.pdmodel.PDPage page, List<Float> colWidths, UpdateCellProperty updateCellProperty) Create a CSVTable object to be able to add CSV document to a Table. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCsvToTable(String data, Boolean hasHeader, char separator) Add a String representing a CSV document to the TablevoidaddListToTable(List<List> data, Boolean hasHeader) Add a List of Lists to the Tablereturn the column widths if provided otherwise nullDeprecated.Get the Cell Templates that will be assigned to Data cells that are in even rows, and it contain first and last column.Deprecated.Get the Cell Templates that will be assigned to Data cells that are in odd rows, and it contain first and last column.Get the Cell Template that will be assigned to cells in the first columnGet the Cell Template that will be assigned to cells in the first column that are in even rowsGet the Cell Template that will be assigned to cells in the first column that are in odd rowsGet the Cell Template that will be applied to header cells.Get the Cell Template that will be assigned to cells in the last columnsGet the Cell Template that will be assigned to cells in the last columns that are in even rowsGet the Cell Template that will be assigned to cells in the last columns that are in odd rowsgetTable()Get the table to add the csv content tovoidsetColWidths(List<Float> colWidths) Set the column widthsvoidSet the Table that the CSV document will be added to
-
Field Details
-
HASHEADER
-
NOHEADER
-
-
Constructor Details
-
DataTable
Create a CSVTable object to be able to add CSV document to a Table. A page needs to be passed to the constructor so the Template Cells can be created.
- Parameters:
table-Tablepage-PDPage- Throws:
IOException- If there is an error releasing resources
-
DataTable
public DataTable(Table table, org.apache.pdfbox.pdmodel.PDPage page, UpdateCellProperty updateCellProperty) throws IOException Create a CSVTable object to be able to add CSV document to a Table. A page needs to be passed to the constructor so the Template Cells can be created.The interface allows you to update the cell property
- Parameters:
table-Tablepage-PDPageupdateCellProperty-UpdateCellProperty- Throws:
IOException- If there is an error releasing resources
-
DataTable
public DataTable(Table table, org.apache.pdfbox.pdmodel.PDPage page, List<Float> colWidths) throws IOException Create a CSVTable object to be able to add CSV document to a Table. A page needs to be passed to the constructor so the Template Cells can be created. The column widths can be given
- Parameters:
table-Tablepage-PDPagecolWidths- column widths- Throws:
IOException- If there is an error releasing resources
-
DataTable
public DataTable(Table table, org.apache.pdfbox.pdmodel.PDPage page, List<Float> colWidths, UpdateCellProperty updateCellProperty) throws IOException Create a CSVTable object to be able to add CSV document to a Table. A page needs to be passed to the constructor so the Template Cells can be created. The column widths can be given and an interface allows you to update the cell property
- Parameters:
table-Tablepage-PDPagecolWidths- column widthsupdateCellProperty-UpdateCellProperty- Throws:
IOException- If there is an error releasing resources
-
-
Method Details
-
getTable
Get the table to add the csv content to
- Returns:
Table
-
setTable
Set the Table that the CSV document will be added to
- Parameters:
table-Table
-
getColWidths
return the column widths if provided otherwise null
- Returns:
- column widths
-
setColWidths
Set the column widths
- Parameters:
colWidths-
-
getHeaderCellTemplate
Get the Cell Template that will be applied to header cells.
- Returns:
- header
Cell's template
-
getDataCellTemplateEven
Deprecated.Get the Cell Template that will be assigned to Data cells that are in even rows, and are not the first or last column
- Returns:
- data
Cell's template
-
getDataCellTemplateOdd
Deprecated.Get the Cell Template that will be assigned to Data cells that are in odd rows, and are not the first or last column
- Returns:
- data
Cell's template
-
getDataCellTemplateEvenList
Get the Cell Templates that will be assigned to Data cells that are in even rows, and it contain first and last column. By default dataCellTemplateEvenList.get(1) will be used for all data even cells
- Returns:
- data
Cell's template
-
getDataCellTemplateOddList
Get the Cell Templates that will be assigned to Data cells that are in odd rows, and it contain first and last column. By default dataCellTemplateOddList.get(1) will be used for all data odd cells
- Returns:
- data
Cell's template
-
getFirstColumnCellTemplate
Get the Cell Template that will be assigned to cells in the first column
- Returns:
Cell's template
-
getLastColumnCellTemplate
Get the Cell Template that will be assigned to cells in the last columns
- Returns:
Cell's template
-
getFirstColumnCellTemplateOdd
Get the Cell Template that will be assigned to cells in the first column that are in odd rows
- Returns:
Cell's template
-
getLastColumnCellTemplateOdd
Get the Cell Template that will be assigned to cells in the last columns that are in odd rows
- Returns:
Cell's template
-
getFirstColumnCellTemplateEven
Get the Cell Template that will be assigned to cells in the first column that are in even rows
- Returns:
Cell's template
-
getLastColumnCellTemplateEven
Get the Cell Template that will be assigned to cells in the last columns that are in even rows
- Returns:
Cell's template
-
addListToTable
Add a List of Lists to the Table
- Parameters:
data-Table's datahasHeader- boolean ifTablehas header- Throws:
IOException- parsing error
-
addCsvToTable
Add a String representing a CSV document to the Table
- Parameters:
data-Table's datahasHeader- boolean ifTablehas headerseparator-charon which data will be parsed- Throws:
IOException- parsing error
-