public class TableCellWalker extends Object implements RowCellWalker, TableRowWalker, TableColumn
| Modifier and Type | Method and Description |
|---|---|
void |
addData(DataWrapper data)
Add a wrapped data
|
int |
colIndex() |
int |
getColumnCount() |
Table |
getTable() |
boolean |
hasNext() |
boolean |
hasNextRow() |
boolean |
hasPrevious() |
boolean |
hasPreviousRow() |
boolean |
hasValue() |
boolean |
isCovered() |
void |
last()
Set the walker on the last cell of the row
|
void |
lastRow()
Set the walker on the last row of the table
|
void |
markColumnsSpanned(int n)
Mark the columns a spanned
|
void |
markRowsSpanned(int n)
Marks a number of rows with a span
|
void |
next()
Set the walker on the next cell of the row
|
void |
nextRow()
Set the walker on the next row of the table
|
void |
previous()
Set the walker on the previous cell of the row
|
void |
previousRow()
Set the walker on the previous row of the table
|
void |
removeRowStyle()
Remove the default row style
|
int |
rowIndex() |
void |
set(WritableTableCell cell)
Set a custom table cell.
|
void |
setAttribute(String attribute,
CharSequence value)
Add an attribute to a cell
|
void |
setBooleanValue(boolean value)
Set the boolean value of the cell.
|
void |
setCellMerge(int rowMerge,
int columnMerge)
Merge cells
|
void |
setCellValue(CellValue value)
Set the value for a cell.
|
void |
setColumnAttribute(String attribute,
CharSequence value)
Set a custom attribute for this column
|
void |
setColumnDefaultCellStyle(TableCellStyle cellStyle)
Set the cell style for the cell of this column to ts.
|
void |
setColumnsSpanned(int n)
Create a span over cells at the right
|
void |
setColumnStyle(TableColumnStyle columnStyle)
Set a style for this column
|
void |
setCovered()
Set the cell covered flag
|
void |
setCurrencyValue(float value,
String currency)
Set the currency value of the cell.
|
void |
setCurrencyValue(int value,
String currency)
Set the currency value of the cell.
|
void |
setCurrencyValue(Number value,
String currency)
Set the currency value of the cell.
|
void |
setDataStyle(DataStyle dataStyle)
Set a custom data style.
|
void |
setDateValue(Calendar cal)
Set the date value of the cell.
|
void |
setDateValue(Date value)
Set the date value of the cell.
|
void |
setFloatValue(float value)
Set the float value of the cell.
|
void |
setFloatValue(int value)
Set the float value of the cell.
|
void |
setFloatValue(Number value)
Set the float value of the cell.
|
void |
setFormula(String formula)
Sets a formula in an existing cell.
|
void |
setMatrixFormula(String formula)
Set a matrix formula
|
void |
setMatrixFormula(String formula,
int matrixRowsSpanned,
int matrixColumnsSpanned)
Set a matrix formula
|
void |
setNegTimeValue(long years,
long months,
long days,
long hours,
long minutes,
double seconds)
Set the time value of the cell.
|
void |
setPercentageValue(float value)
Set the percentage value of the cell.
|
void |
setPercentageValue(int value)
Set the percentage value of the cell.
|
void |
setPercentageValue(Number value)
Set the percentage value of the cell.
|
void |
setRowAttribute(String attribute,
CharSequence value)
Add an attribute to a row
|
void |
setRowDefaultCellStyle(TableCellStyle ts)
Set the cell style for the cell of this row to ts.
|
void |
setRowFormat(DataStyles format)
Add a format to this TableRow
|
void |
setRowsSpanned(int n)
Create a span over cells below
|
void |
setRowStyle(TableRowStyle rowStyle)
Set the row style
|
void |
setStringValue(String value)
Set the string value for a cell.
|
void |
setStyle(TableCellStyle style)
Set a style for this cell
|
void |
setText(Text text)
Set a text in this cell.
|
void |
setTimeValue(long timeInMillis)
Set the time value of the cell.
|
void |
setTimeValue(long years,
long months,
long days,
long hours,
long minutes,
double seconds)
Set the time value of the cell.
|
void |
setTooltip(String tooltipText)
Add a tooltip to the cell
|
void |
setTooltip(String tooltipText,
Length width,
Length height,
boolean visible)
Add a tooltip to the cell
|
void |
setTooltip(Tooltip tooltip)
Add a tooltip to the cell
|
void |
setValidation(Validation validation)
Set a content validation on this cell
|
void |
setVoidValue()
Set a void value in this cell
|
void |
to(int c)
Set the walker on the row
|
void |
toRow(int r)
Set the walker on the table
|
public void markRowsSpanned(int n)
TableCellmarkRowsSpanned in interface TableCelln - the number of rowspublic void setBooleanValue(boolean value)
TableCellsetBooleanValue in interface TableCellvalue - true or falsepublic void setText(Text text)
TableCellpublic void setCellMerge(int rowMerge,
int columnMerge)
throws IOException
TableCellsetCellMerge in interface TableCellrowMerge - number of rows belowcolumnMerge - number of rows at the rightIOException - if the cell can't be merged (only when flushing data)public void setColumnsSpanned(int n)
TableCellsetColumnsSpanned in interface TableCelln - the number of cells to be spannedpublic void markColumnsSpanned(int n)
TableCellmarkColumnsSpanned in interface TableCelln - the number of columnspublic void setDateValue(Date value)
TableCellsetDateValue in interface TableCellvalue - a Date objectpublic void setFloatValue(Number value)
TableCellsetFloatValue in interface TableCellvalue - a double object with the value to be usedpublic void setPercentageValue(Number value)
TableCellsetPercentageValue in interface TableCellvalue - a double object with the value to be used.public void setRowsSpanned(int n)
throws IOException
TableCellsetRowsSpanned in interface TableCelln - the number of cells to be spannedIOException - if the cell can't be merged (only when flushing data)public void setVoidValue()
TableCellsetVoidValue in interface TableCellpublic void setMatrixFormula(String formula)
TableCellsetMatrixFormula in interface TableCellformula - the formulapublic void setMatrixFormula(String formula, int matrixRowsSpanned, int matrixColumnsSpanned)
TableCellsetMatrixFormula in interface TableCellformula - the formulamatrixRowsSpanned - the number of rowsmatrixColumnsSpanned - the number of columnspublic void setStringValue(String value)
TableCellNote that this will not set the data style of the cell to "text" but let it to "standard", hence the quote before numbers in LO. This is the same behavior as LO (see https://github.com/jferard/fastods/issues/148)
setStringValue in interface TableCellvalue - a double object with the value to be usedpublic void setTimeValue(long timeInMillis)
TableCellsetTimeValue in interface TableCelltimeInMillis - the duration in millisecondspublic void setTimeValue(long years,
long months,
long days,
long hours,
long minutes,
double seconds)
TableCellsetTimeValue in interface TableCellyears - number of yearsmonths - number of monthsdays - number of dayshours - number of hoursminutes - number of minutesseconds - number of secondspublic void setNegTimeValue(long years,
long months,
long days,
long hours,
long minutes,
double seconds)
TableCellsetNegTimeValue in interface TableCellyears - number of yearsmonths - number of monthsdays - number of dayshours - number of hoursminutes - number of minutesseconds - number of secondspublic void setTooltip(String tooltipText)
TableCellsetTooltip in interface TableCelltooltipText - the text of the tooltippublic void setTooltip(String tooltipText, Length width, Length height, boolean visible)
TableCellsetTooltip in interface TableCelltooltipText - the text of the tooltipwidth - the width of the tooltipheight - the height of the tooltipvisible - if the tooltip should be visible.public void setTooltip(Tooltip tooltip)
TableCellsetTooltip in interface TableCelltooltip - the tooltippublic void setFormula(String formula)
TableCell
walker.setFloatValue(2.0);
walker.setFormula("1+1");
One can type Shift+Ctrl+F9 to recalculate the right value in LibreOffice.
setFormula in interface TableCellformula - the formula, without '=' sign.public boolean hasValue()
public boolean isCovered()
public void setCovered()
TableCellsetCovered in interface TableCellpublic void setCellValue(CellValue value)
TableCellCellValue object.setCellValue in interface TableCellvalue - the value as a CellValue object.public void setCurrencyValue(float value,
String currency)
TableCellsetCurrencyValue in interface TableCellvalue - the value as a floatcurrency - The currency valuepublic void setCurrencyValue(int value,
String currency)
TableCellsetCurrencyValue in interface TableCellvalue - the value as an intcurrency - The currency valuepublic void setCurrencyValue(Number value, String currency)
TableCellsetCurrencyValue in interface TableCellvalue - the value as a Numbercurrency - the currency valuepublic void setDateValue(Calendar cal)
TableCellsetDateValue in interface TableCellcal - a Calendar object with the date to be usedpublic void setFloatValue(float value)
TableCellsetFloatValue in interface TableCellvalue - a double object with the value to be usedpublic void setFloatValue(int value)
TableCellsetFloatValue in interface TableCellvalue - a double object with the value to be usedpublic void setPercentageValue(float value)
TableCellsetPercentageValue in interface TableCellvalue - a float object with the value to be usedpublic void setPercentageValue(int value)
TableCellsetPercentageValue in interface TableCellvalue - an int with the value to be usedpublic void setStyle(TableCellStyle style)
TableCellpublic void setDataStyle(DataStyle dataStyle)
TableCellsetDataStyle in interface TableCelldataStyle - the data stylepublic void setValidation(Validation validation)
TableCellsetValidation in interface TableCellvalidation - the validationpublic void setColumnStyle(TableColumnStyle columnStyle)
TableColumnsetColumnStyle in interface TableColumncolumnStyle - the stylepublic void setColumnDefaultCellStyle(TableCellStyle cellStyle)
TableColumnsetColumnDefaultCellStyle in interface TableColumncellStyle - The table rowStyle to be usedpublic void setColumnAttribute(String attribute, CharSequence value)
TableColumnsetColumnAttribute in interface TableColumnattribute - the attributevalue - the valuepublic void setRowFormat(DataStyles format)
TableRowsetRowFormat in interface TableRowformat - the formatpublic void setRowStyle(TableRowStyle rowStyle)
TableRowsetRowStyle in interface TableRowrowStyle - the stylepublic int getColumnCount()
getColumnCount in interface TableRowpublic void setRowDefaultCellStyle(TableCellStyle ts)
TableRowsetRowDefaultCellStyle in interface TableRowts - The table rowStyle to be usedpublic int rowIndex()
public int colIndex()
public void removeRowStyle()
TableRowremoveRowStyle in interface TableRowpublic void setRowAttribute(String attribute, CharSequence value)
TableRowsetRowAttribute in interface TableRowattribute - the attribute namevalue - the valuepublic boolean hasNext()
hasNext in interface RowCellWalkerpublic boolean hasPrevious()
hasPrevious in interface RowCellWalkerpublic void last()
RowCellWalkerlast in interface RowCellWalkerpublic void next()
RowCellWalkernext in interface RowCellWalkerpublic void set(WritableTableCell cell)
cell - the cellpublic void previous()
RowCellWalkerprevious in interface RowCellWalkerpublic void to(int c)
RowCellWalkerto in interface RowCellWalkerc - the index of the cellpublic boolean hasNextRow()
hasNextRow in interface TableRowWalkerpublic boolean hasPreviousRow()
hasPreviousRow in interface TableRowWalkerpublic void lastRow()
throws IOException
TableRowWalkerlastRow in interface TableRowWalkerIOException - if an I/O error occurspublic void nextRow()
throws IOException
TableRowWalkernextRow in interface TableRowWalkerIOException - if an I/O error occurspublic void previousRow()
throws IOException
TableRowWalkerpreviousRow in interface TableRowWalkerIOException - if an I/O error occurspublic void toRow(int r)
throws IOException
TableRowWalkertoRow in interface TableRowWalkerr - the index of the rowIOException - if an I/O error occurspublic Table getTable()
public void addData(DataWrapper data) throws IOException
data - the wrapped dataIOException - if an error occurspublic void setAttribute(String attribute, CharSequence value)
TableCellsetAttribute in interface TableCellattribute - the attribute namevalue - the valueCopyright © 2016–2021. All rights reserved.