public class TableBuilder extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
HEADER_HEIGHT |
static int |
PROPERTIES_MIN_WIDTH |
static String |
TABLE_PROPERTIES |
| Constructor and Description |
|---|
TableBuilder(XlsSheetGridModel gridModel)
Creates new instance.
|
TableBuilder(XlsSheetGridModel gridModel,
MetaInfoWriter metaInfoWriter) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginTable(IGridRegion regionToWrite)
Begins writing a table within the specified region.
|
void |
beginTable(int width,
int height)
Begins writing a table.
|
void |
endTable()
Finishes writing a table.
|
protected int |
getCurrentRow() |
protected org.apache.poi.ss.usermodel.CellStyle |
getDefaultCellStyle()
Initializes default cell style.
|
protected org.apache.poi.ss.usermodel.CellStyle |
getDefaultDateCellStyle() |
protected XlsSheetGridModel |
getGridModel() |
protected int |
getHeight() |
IGridRegion |
getTableRegion() |
protected int |
getWidth() |
protected void |
incCurrentRow() |
protected void |
incCurrentRow(int increment) |
void |
save() |
protected void |
writeCell(int x,
int y,
int width,
int height,
Object value)
Writes cell.
|
protected void |
writeCell(int x,
int y,
int width,
int height,
Object value,
ICellStyle style)
Writes cell.
|
protected void |
writeCell(int x,
int y,
Object value)
Writes cell.
|
void |
writeGridTable(IGridTable table)
Writes table grid.
|
void |
writeHeader(String header,
ICellStyle style)
Writes table header.
|
void |
writeProperties(Map<String,Object> properties,
ICellStyle style)
Writes table properties.
|
public static final String TABLE_PROPERTIES
public static final int HEADER_HEIGHT
public static final int PROPERTIES_MIN_WIDTH
public TableBuilder(XlsSheetGridModel gridModel)
gridModel - represents interface for operations with excel sheetspublic TableBuilder(XlsSheetGridModel gridModel, MetaInfoWriter metaInfoWriter)
public void beginTable(int width,
int height)
throws CreateTableException
width - table width in cellsheight - table height in cellsCreateTableException - if unable to create tableIllegalStateException - if beginTable() has already been called without subsequent
endTable()public void beginTable(IGridRegion regionToWrite) throws CreateTableException
regionToWrite - region to write table.CreateTableException - if unable to create tableIllegalStateException - if beginTable() has already been called without subsequent
endTable()public void endTable()
throws CreateTableException
IllegalStateException - if method is called without prior beginTable() callCreateTableException - if an exception occurred when savingpublic void save()
throws CreateTableException
CreateTableExceptionprotected int getCurrentRow()
protected org.apache.poi.ss.usermodel.CellStyle getDefaultCellStyle()
protected org.apache.poi.ss.usermodel.CellStyle getDefaultDateCellStyle()
protected XlsSheetGridModel getGridModel()
protected int getHeight()
public IGridRegion getTableRegion()
protected int getWidth()
protected void incCurrentRow()
protected void incCurrentRow(int increment)
protected void writeCell(int x,
int y,
int width,
int height,
Object value)
x - cell x coordinatey - cell y coordinatewidth - cell widthheight - cell heightvalue - cell valueprotected void writeCell(int x,
int y,
int width,
int height,
Object value,
ICellStyle style)
x - cell x coordinatey - cell y coordinatewidth - cell widthheight - cell heightvalue - cell valuestyle - cell styleprotected void writeCell(int x,
int y,
Object value)
x - cell x coordinatey - cell y coordinatevalue - cell valuepublic void writeGridTable(IGridTable table)
table - table gridIllegalArgumentException - if table is nullIllegalStateException - if method is called without prior beginTable() callpublic void writeHeader(String header, ICellStyle style)
header - header text for the tablestyle - header styleIllegalStateException - if method is called without prior beginTable() callpublic void writeProperties(Map<String,Object> properties, ICellStyle style)
properties - table propertiesstyle - properties styleIllegalArgumentException - if properties is nullIllegalStateException - if method is called without prior beginTable() callCopyright © 2004–2019 OpenL Tablets. All rights reserved.