public class Table extends Object implements NamedObject, FrameContent
| Modifier and Type | Method and Description |
|---|---|
void |
addAutoFilter(String rangeName,
int r1,
int c1,
int r2,
int c2)
Add a new auto filter
|
void |
addObserver(NamedOdsFileWriter observer)
Add an observer to this table
|
void |
addPrintRange(int r1,
int c1,
int r2,
int c2) |
void |
addShape(Shape shape)
Add a shape
|
void |
appendXMLContent(XMLUtil util,
Appendable appendable)
Add XML to content.xml
|
void |
asyncFlush()
Deprecated.
use asyncFlushBeginTable, asyncFlushAvailableRows or asyncFlushEndTable
|
void |
asyncFlushBeginTable()
Async flush the XML
|
void |
asyncFlushEndTable()
Async flush the XML
|
static Table |
create(ContentElement contentElement,
PositionUtil positionUtil,
IntegerRepresentationCache cache,
XMLUtil xmlUtil,
String name,
int rowCapacity,
int columnCapacity,
StylesContainer stylesContainer,
DataStyles format,
boolean libreOfficeMode,
ValidationsContainer validationsContainer)
Create a new Table with a name and a row/column capacity
|
TableCellStyle |
findDefaultCellStyle(int columnIndex)
Find the default cell style for a column
|
void |
flushAllAvailableRows(XMLUtil util,
Appendable appendable)
Open the table, flush all rows from start, but do not freeze the table
|
void |
flushRemainingRowsFrom(XMLUtil util,
Appendable appendable,
int rowIndex)
Flush all rows from a given position, and do freeze the table
|
void |
flushSomeAvailableRowsFrom(XMLUtil util,
Appendable appendable,
int rowIndex)
Flush all rows from a given position, but do not freeze the table
|
ConfigItemMapEntry |
getConfigEntry() |
String |
getName()
Get the name of this table.
|
TableRowImpl |
getRow(int rowIndex)
Return a row from an index
|
int |
getRowCount() |
String |
getStyleName()
Get the current Table Style
|
TableCellWalker |
getWalker() |
TableRowImpl |
nextRow()
Deprecated.
|
void |
protect(Protection protection) |
void |
setAttribute(String attribute,
CharSequence value)
Set a custom attribute
|
void |
setCellMerge(int rowIndex,
int colIndex,
int rowMerge,
int columnMerge)
Set a span over cells
|
void |
setCellMerge(String address,
int rowMerge,
int columnMerge)
Deprecated.
|
void |
setColumnAttribute(int col,
String attribute,
CharSequence value)
Set a custom attribute for a column
|
void |
setColumnDefaultCellStyle(int col,
TableCellStyle cellStyle) |
void |
setColumnStyle(int col,
TableColumnStyle ts)
Set the style of a column.
|
void |
setConfigItem(String name,
String type,
String value)
Set a config item
|
void |
setHeaderColumnsCount(int headerColumnsCount) |
void |
setHeaderRowsCount(int headerRowsCount) |
void |
setRowsSpanned(int rowIndex,
int colIndex,
int n)
Set a span over rows
|
void |
setStyle(TableStyle style)
Set a new TableFamilyStyle
|
void |
updateConfigItem(ConfigElement element,
String value)
Set one of the settings
|
public static Table create(ContentElement contentElement, PositionUtil positionUtil, IntegerRepresentationCache cache, XMLUtil xmlUtil, String name, int rowCapacity, int columnCapacity, StylesContainer stylesContainer, DataStyles format, boolean libreOfficeMode, ValidationsContainer validationsContainer)
contentElement - the content.xml representationpositionUtil - an utilcache - an utilxmlUtil - an utilname - the name of the tablesrowCapacity - the row capacitycolumnCapacity - the column capacitystylesContainer - the container for stylesformat - the data styleslibreOfficeMode - try to get full compatibility with LO if truevalidationsContainer - the validations containerpublic void addObserver(NamedOdsFileWriter observer)
observer - the observerpublic void appendXMLContent(XMLUtil util, Appendable appendable) throws IOException
appendXMLContent in interface XMLConvertibleutil - an utilappendable - the outputIOException - if the XML could not be written@Deprecated public void asyncFlush() throws IOException
IOException - if an error occurspublic void asyncFlushBeginTable()
throws IOException
IOException - if an error occurspublic void asyncFlushEndTable()
throws IOException
IOException - if an error occurspublic void flushAllAvailableRows(XMLUtil util, Appendable appendable) throws IOException
util - a XMLUtil instance for writing XMLappendable - where to writeIOException - if an I/O error occurs during the flushpublic void flushRemainingRowsFrom(XMLUtil util, Appendable appendable, int rowIndex) throws IOException
util - a XMLUtil instance for writing XMLappendable - where to writerowIndex - the first index to use.IOException - if an I/O error occurs during the flushpublic void flushSomeAvailableRowsFrom(XMLUtil util, Appendable appendable, int rowIndex) throws IOException
util - a XMLUtil instance for writing XMLappendable - where to writerowIndex - the index of the rowIOException - if an I/O error occurs during the flushpublic ConfigItemMapEntry getConfigEntry()
public int getRowCount()
public String getName()
getName in interface NamedObjectpublic TableRowImpl getRow(int rowIndex) throws IOException
rowIndex - the indexIllegalArgumentException - if the index is invalidIOException - if the row was flushedpublic String getStyleName()
@Deprecated public TableRowImpl nextRow() throws IOException
IOException - if an error occurspublic TableCellWalker getWalker() throws IOException
IOException - if the first row was flushedpublic void setCellMerge(int rowIndex,
int colIndex,
int rowMerge,
int columnMerge)
throws IOException
rowIndex - the top rowcolIndex - the leftmost colrowMerge - the number of rowscolumnMerge - the number of colsIOException - if an error occurs@Deprecated public void setCellMerge(String address, int rowMerge, int columnMerge) throws IOException, ParseException
address - The cell position e.g. 'A1'rowMerge - the number of rows to mergecolumnMerge - the number of cells to mergeIOException - if the cells can't be mergedParseException - if the address can't be parsedpublic void setColumnStyle(int col,
TableColumnStyle ts)
col - The column numberts - The style to be usedIllegalStateException - if the preamble was already writtenIllegalArgumentException - if col has an invalid value.public void setColumnAttribute(int col,
String attribute,
CharSequence value)
col - the columnattribute - the attributevalue - the valuepublic void setColumnDefaultCellStyle(int col,
TableCellStyle cellStyle)
public void setAttribute(String attribute, CharSequence value)
attribute - the attributevalue - the valuepublic void setConfigItem(String name, String type, String value)
name - the item nametype - the item typevalue - the item valuepublic void updateConfigItem(ConfigElement element, String value)
element - the config elementvalue - the item valuepublic void setStyle(TableStyle style)
style - The new TableStyle to be usedpublic void setRowsSpanned(int rowIndex,
int colIndex,
int n)
throws IOException
rowIndex - the row indexcolIndex - the col indexn - the number of rowsIOException - if an error occurspublic TableCellStyle findDefaultCellStyle(int columnIndex)
columnIndex - the column indexpublic void addAutoFilter(String rangeName, int r1, int c1, int r2, int c2)
rangeName - the name of the ranger1 - first row of the rangec1 - first col of the ranger2 - last rowc2 - last colpublic void addShape(Shape shape)
shape - the shapepublic void protect(Protection protection) throws NoSuchAlgorithmException
protection - the protectionNoSuchAlgorithmException - should not happenpublic void addPrintRange(int r1,
int c1,
int r2,
int c2)
public void setHeaderRowsCount(int headerRowsCount)
public void setHeaderColumnsCount(int headerColumnsCount)
Copyright © 2016–2021. All rights reserved.