org.apache.poi.xssf.model
public class StylesTable extends POIXMLDocumentPart
Modifier and Type | Field and Description |
---|---|
static int |
FIRST_CUSTOM_STYLE_ID
The first style id available for use as a custom style
|
DEFAULT_XML_OPTIONS
Constructor and Description |
---|
StylesTable()
Create a new, empty StylesTable
|
StylesTable(PackagePart part,
PackageRelationship rel) |
Modifier and Type | Method and Description |
---|---|
int |
_getNumberFormatSize()
For unit testing only
|
int |
_getStyleXfsSize()
For unit testing only
|
int |
_getXfsSize()
For unit testing only
|
protected void |
commit()
Save the content in the underlying package part.
|
XSSFCellStyle |
createCellStyle() |
XSSFFont |
findFont(short boldWeight,
short color,
short fontHeight,
java.lang.String name,
boolean italic,
boolean strikeout,
short typeOffset,
byte underline)
Finds a font that matches the one with the supplied attributes
|
XSSFCellBorder |
getBorderAt(int idx) |
java.util.List<XSSFCellBorder> |
getBorders() |
CTXf |
getCellStyleXfAt(int idx) |
CTXf |
getCellXfAt(int idx) |
CTStylesheet |
getCTStylesheet()
For unit testing only!
|
protected CTDxf |
getDxf(int idx) |
XSSFCellFill |
getFillAt(int idx) |
java.util.List<XSSFCellFill> |
getFills() |
XSSFFont |
getFontAt(int idx) |
java.util.List<XSSFFont> |
getFonts() |
java.lang.String |
getNumberFormatAt(int idx) |
java.util.Map<java.lang.Integer,java.lang.String> |
getNumberFormats() |
int |
getNumCellStyles()
get the size of cell styles
|
XSSFCellStyle |
getStyleAt(int idx) |
int |
putBorder(XSSFCellBorder border) |
int |
putCellStyleXf(CTXf cellStyleXf) |
int |
putCellXf(CTXf cellXf) |
protected int |
putDxf(CTDxf dxf) |
int |
putFill(XSSFCellFill fill) |
int |
putFont(XSSFFont font) |
int |
putNumberFormat(java.lang.String fmt) |
int |
putStyle(XSSFCellStyle style) |
protected void |
readFrom(java.io.InputStream is)
Read this shared styles table from an XML file.
|
void |
writeTo(java.io.OutputStream out)
Write this table out as XML.
|
addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelations, onDocumentCreate, onDocumentRead, onSave, read, removeRelation, toString
public static final int FIRST_CUSTOM_STYLE_ID
public StylesTable()
public StylesTable(PackagePart part, PackageRelationship rel) throws java.io.IOException
java.io.IOException
protected void readFrom(java.io.InputStream is) throws java.io.IOException
is
- The input stream containing the XML document.java.io.IOException
- if an error occurs while reading.public java.lang.String getNumberFormatAt(int idx)
public int putNumberFormat(java.lang.String fmt)
public XSSFFont getFontAt(int idx)
public int putFont(XSSFFont font)
public XSSFCellStyle getStyleAt(int idx)
public int putStyle(XSSFCellStyle style)
public XSSFCellBorder getBorderAt(int idx)
public int putBorder(XSSFCellBorder border)
public XSSFCellFill getFillAt(int idx)
public java.util.List<XSSFCellBorder> getBorders()
public java.util.List<XSSFCellFill> getFills()
public java.util.List<XSSFFont> getFonts()
public java.util.Map<java.lang.Integer,java.lang.String> getNumberFormats()
public int putFill(XSSFCellFill fill)
public CTXf getCellXfAt(int idx)
public int putCellXf(CTXf cellXf)
public CTXf getCellStyleXfAt(int idx)
public int putCellStyleXf(CTXf cellStyleXf)
public int getNumCellStyles()
public int _getNumberFormatSize()
public int _getXfsSize()
public int _getStyleXfsSize()
public CTStylesheet getCTStylesheet()
public void writeTo(java.io.OutputStream out) throws java.io.IOException
out
- The stream to write to.java.io.IOException
- if an error occurs while writing.protected void commit() throws java.io.IOException
POIXMLDocumentPart
protected void commit() throws IOException {
PackagePart part = getPackagePart();
OutputStream out = part.getOutputStream();
XmlObject bean = getXmlBean(); //the "model" which holds changes in memory
bean.save(out, DEFAULT_XML_OPTIONS);
out.close();
}
commit
in class POIXMLDocumentPart
java.io.IOException
protected CTDxf getDxf(int idx)
protected int putDxf(CTDxf dxf)
public XSSFCellStyle createCellStyle()
public XSSFFont findFont(short boldWeight, short color, short fontHeight, java.lang.String name, boolean italic, boolean strikeout, short typeOffset, byte underline)
Copyright 2014 The Apache Software Foundation or its licensors, as applicable.