public class NamedOdsDocument extends Object implements OdsDocument, StylesContainer
| Modifier and Type | Method and Description |
|---|---|
void |
addAutoFilter(AutoFilter autoFilter)
Add a new auto filter
|
void |
addAutoFilter(String rangeName,
Table table,
int r1,
int c1,
int r2,
int c2)
Deprecated.
|
void |
addCellStyle(TableCellStyle style,
CellType... types)
Add a cell style for a given data type.
|
TableCellStyle |
addChildCellStyle(TableCellStyle style,
DataStyle dataStyle)
Add a child style that mixes the cell style with a data style to the container
|
boolean |
addContentFontFaceContainerStyle(FontFaceContainerStyle objectStyle)
Add a cell style to the content container and register the font face
|
boolean |
addContentStyle(ObjectStyle objectStyle)
Add an object style (style:style) to content.xml/automatic-styles
|
boolean |
addDataStyle(DataStyle dataStyle)
Add a data style to this document.
|
void |
addEvents(ScriptEventListener... events)
Add some events to the document
|
void |
addExtraDir(String fullPath)
Add an extra directory to the manifest.
|
void |
addExtraFile(String fullPath,
String mediaType,
byte[] bytes)
Add an extra file to the document
|
void |
addExtraObject(String fullPath,
String mediaType,
String version)
Add an extra object (eg. a spreadsheet) to the manifest.
|
boolean |
addMasterPageStyle(MasterPageStyle masterPageStyle)
Create a new master page style into styles container.
|
boolean |
addNewDataStyleFromCellStyle(TableCellStyle style)
Add the data style taken from a cell style
|
boolean |
addPageLayoutStyle(PageLayoutStyle pageLayoutStyle)
Add a page layout style
|
boolean |
addPageStyle(PageStyle ps)
Add a page style
|
void |
addPilotTable(PilotTable pilot)
Add a new pilot table
|
boolean |
addStylesFontFaceContainerStyle(FontFaceContainerStyle ffcStyle)
Add a cell style to the content container and register the font face
|
boolean |
addStylesStyle(ObjectStyle objectStyle)
Add an object style to styles.xml/automatic-styles
|
Table |
addTable(String name)
Add a new table to the document, the new table is set to the active table.
|
Table |
addTable(String name,
int rowCapacity,
int columnCapacity)
Add a new table to the document, the new table is set to the active table.
|
boolean |
addTable(Table table)
Add a new table to the document, the new table is set to the active table.
|
Table |
createTable(String name)
*You probably need
addTable*
Create a new table, **but do not add it to the document**. |
Table |
createTable(String name,
int rowCapacity,
int columnCapacity)
*You probably need
addTable*
Create a new table, **but do not add it to the document**. |
void |
debugStyles()
Enable styles debugging
|
void |
freezeCells(Table table,
int rowCount,
int colCount) |
void |
freezeStyles()
Enable styles freeze
|
Table |
getOrAddTable(String name) |
Table |
getTable(int n)
Get a table by index
|
Table |
getTable(String name)
Get a table by name
|
String |
getTableName(int n)
Returns the name of the table.
|
int |
getTableNumber(String name)
Search a table by name and return its number.
|
List<Table> |
getTables() |
void |
prepare()
Prepare the document for flush (ie write empty elements, manifest, mime type, ...)
|
void |
save()
Save the document.
|
boolean |
setActiveTable(int tableIndex)
Set the active table, this is the table that is shown if you open the
file.
|
void |
setDataStylesMode(Container.Mode mode)
Set the new mode to use for data styles
|
void |
setMasterPageStyleMode(Container.Mode mode)
Set the new mode to use for master page style
|
void |
setObjectStyleMode(Container.Mode mode)
Set the new mode to use for styles in content.xml/automatic-styles, styles.xml/styles and
styles.xml/automatic-styles
|
void |
setPageLayoutStyleMode(Container.Mode mode)
Set the new mode to use for page layout style
|
void |
setPageStyleMode(Container.Mode mode)
Set the new mode to use for page style
|
void |
setViewSetting(String viewId,
String item,
String value)
Set a view setting
|
int |
tableCount()
Gets the number of the last table.
|
public Table addTable(String name) throws IOException
OdsDocumentaddTable in interface OdsDocumentname - - The name of the table to addIOException - if the table can't be added to documentpublic Table addTable(String name, int rowCapacity, int columnCapacity) throws IOException
OdsDocumentaddTable in interface OdsDocumentname - the name of the table to addrowCapacity - the initial row capacitycolumnCapacity - the initial column capacityIOException - if the table can't be added to documentpublic boolean addTable(Table table) throws IOException
OdsDocumentaddTable in interface OdsDocumenttable - the table to addIOException - if the table can't be added to documentpublic Table createTable(String name) throws IOException
OdsDocumentaddTable*
Create a new table, **but do not add it to the document**.
createTable in interface OdsDocumentname - - The name of the table to addIOException - if the table can't be added to documentpublic Table createTable(String name, int rowCapacity, int columnCapacity) throws IOException
OdsDocumentaddTable*
Create a new table, **but do not add it to the document**.
createTable in interface OdsDocumentname - - The name of the table to addrowCapacity - the initial row capacitycolumnCapacity - the initial column capacityIOException - if the table can't be added to documentpublic Table getTable(int n) throws FastOdsException
OdsDocumentgetTable in interface OdsDocumentn - the indexFastOdsException - if the table index is negative or ≥ number of tablespublic Table getTable(String name) throws FastOdsException
OdsDocumentgetTable in interface OdsDocumentname - the name of the tableFastOdsException - if the table does not exist.public Table getOrAddTable(String name) throws IOException
getOrAddTable in interface OdsDocumentname - the name of the tableIOException - if the table does not exist.public String getTableName(int n) throws FastOdsException
OdsDocumentgetTableName in interface OdsDocumentn - The number of the tableFastOdsException - if n is negativepublic int getTableNumber(String name)
OdsDocumentgetTableNumber in interface OdsDocumentname - The name of the tablepublic List<Table> getTables()
getTables in interface OdsDocumentpublic boolean setActiveTable(int tableIndex)
OdsDocumentsetActiveTable in interface OdsDocumenttableIndex - The table number, this table should already exist, otherwise
the first table is shownpublic void setViewSetting(String viewId, String item, String value)
OdsDocumentsetViewSetting in interface OdsDocumentviewId - the view iditem - the item namevalue - the valuepublic int tableCount()
OdsDocumenttableCount in interface OdsDocument@Deprecated public void addAutoFilter(String rangeName, Table table, int r1, int c1, int r2, int c2)
OdsDocumentaddAutoFilter in interface OdsDocumentrangeName - the name of the rangetable - the tabler1 - the top rowc1 - the left columnr2 - the bottom rowc2 - the right columnpublic void freezeCells(Table table, int rowCount, int colCount)
freezeCells in interface OdsDocumenttable - the tablerowCount - the number of rows to freezecolCount - the number of cols to freezepublic void addCellStyle(TableCellStyle style, CellType... types)
style - the styletypes - the typespublic boolean addDataStyle(DataStyle dataStyle)
addDataStyle in interface StylesContainerdataStyle - the data style to add to this documentpublic boolean addMasterPageStyle(MasterPageStyle masterPageStyle)
StylesContaineraddMasterPageStyle in interface StylesContainermasterPageStyle - the data style to addpublic boolean addNewDataStyleFromCellStyle(TableCellStyle style)
StylesContaineraddNewDataStyleFromCellStyle in interface StylesContainerstyle - the cell stylepublic boolean addPageLayoutStyle(PageLayoutStyle pageLayoutStyle)
StylesContaineraddPageLayoutStyle in interface StylesContainerpageLayoutStyle - the stylepublic boolean addPageStyle(PageStyle ps)
StylesContaineraddPageStyle in interface StylesContainerps - the stylepublic boolean addContentStyle(ObjectStyle objectStyle)
StylesContaineraddContentStyle in interface StylesContainerobjectStyle - the stylepublic boolean addStylesStyle(ObjectStyle objectStyle)
StylesContaineraddStylesStyle in interface StylesContainerobjectStyle - the stylepublic TableCellStyle addChildCellStyle(TableCellStyle style, DataStyle dataStyle)
StylesContaineraddChildCellStyle in interface StylesContainerstyle - the cell styledataStyle - the data stylepublic boolean addContentFontFaceContainerStyle(FontFaceContainerStyle objectStyle)
StylesContaineraddContentFontFaceContainerStyle in interface StylesContainerobjectStyle - the cell style or the text stylepublic boolean addStylesFontFaceContainerStyle(FontFaceContainerStyle ffcStyle)
StylesContaineraddStylesFontFaceContainerStyle in interface StylesContainerffcStyle - the cell style or the text stylepublic void setDataStylesMode(Container.Mode mode)
StylesModeSettersetDataStylesMode in interface StylesModeSettermode - the mode (CREATE, UPDATE, CREATE_OR_UPDATE)public void setMasterPageStyleMode(Container.Mode mode)
StylesModeSettersetMasterPageStyleMode in interface StylesModeSettermode - the mode (CREATE, UPDATE, CREATE_OR_UPDATE)public void setPageLayoutStyleMode(Container.Mode mode)
StylesModeSettersetPageLayoutStyleMode in interface StylesModeSettermode - the mode (CREATE, UPDATE, CREATE_OR_UPDATE)public void setPageStyleMode(Container.Mode mode)
StylesModeSettersetPageStyleMode in interface StylesModeSettermode - the mode (CREATE, UPDATE, CREATE_OR_UPDATE)public void setObjectStyleMode(Container.Mode mode)
StylesModeSettersetObjectStyleMode in interface StylesModeSettermode - the mode (CREATE, UPDATE, CREATE_OR_UPDATE)public void debugStyles()
public void freezeStyles()
public void prepare()
throws IOException
IOException - if an element can't be writtenpublic void addExtraFile(String fullPath, String mediaType, byte[] bytes)
OdsDocumentaddExtraFile in interface OdsDocumentfullPath - the path of the file in the sequencemediaType - the MIME type of the filebytes - the contentpublic void addExtraDir(String fullPath)
OdsDocumentaddExtraDir in interface OdsDocumentfullPath - the path of the dirpublic void addExtraObject(String fullPath, String mediaType, String version)
OdsDocumentaddExtraObject in interface OdsDocumentfullPath - the path of the dirmediaType - the type of the objectversion - the versionpublic void addEvents(ScriptEventListener... events)
OdsDocumentaddEvents in interface OdsDocumentevents - the events to addpublic void addPilotTable(PilotTable pilot)
OdsDocumentaddPilotTable in interface OdsDocumentpilot - the pilot tablepublic void addAutoFilter(AutoFilter autoFilter)
OdsDocumentaddAutoFilter in interface OdsDocumentautoFilter - the filterpublic void save()
throws IOException
IOException - if the save failsCopyright © 2016–2021. All rights reserved.