org.apache.poi.xssf.model
Class StylesTable
- java.lang.Object
-
- org.apache.poi.POIXMLDocumentPart
-
- org.apache.poi.xssf.model.StylesTable
-
public class StylesTable extends POIXMLDocumentPart
Table of styles shared across all sheets in a workbook.
-
-
Field Summary
Fields Modifier and Type Field and Description static intFIRST_CUSTOM_STYLE_IDThe first style id available for use as a custom style-
Fields inherited from class org.apache.poi.POIXMLDocumentPart
DEFAULT_XML_OPTIONS
-
-
Constructor Summary
Constructors Constructor and Description StylesTable()Create a new, empty StylesTableStylesTable(PackagePart part, PackageRelationship rel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description int_getDXfsSize()int_getNumberFormatSize()For unit testing onlyint_getStyleXfsSize()For unit testing onlyint_getXfsSize()For unit testing onlyXSSFCellStylecreateCellStyle()XSSFFontfindFont(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 attributesXSSFCellBordergetBorderAt(int idx)java.util.List<XSSFCellBorder>getBorders()org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXfgetCellStyleXfAt(int idx)org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXfgetCellXfAt(int idx)org.openxmlformats.schemas.spreadsheetml.x2006.main.CTStylesheetgetCTStylesheet()For unit testing only!org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDxfgetDxfAt(int idx)XSSFCellFillgetFillAt(int idx)java.util.List<XSSFCellFill>getFills()XSSFFontgetFontAt(int idx)java.util.List<XSSFFont>getFonts()java.lang.StringgetNumberFormatAt(int idx)java.util.Map<java.lang.Integer,java.lang.String>getNumberFormats()intgetNumCellStyles()get the size of cell stylesXSSFCellStylegetStyleAt(int idx)ThemesTablegetTheme()intputBorder(XSSFCellBorder border)intputCellStyleXf(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf cellStyleXf)intputCellXf(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf cellXf)intputDxf(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDxf dxf)intputFill(XSSFCellFill fill)intputFont(XSSFFont font)intputFont(XSSFFont font, boolean forceRegistration)Records the given font in the font table.intputNumberFormat(java.lang.String fmt)intputStyle(XSSFCellStyle style)voidreplaceCellStyleXfAt(int idx, org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf cellStyleXf)voidreplaceCellXfAt(int idx, org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf cellXf)voidsetTheme(ThemesTable theme)voidwriteTo(java.io.OutputStream out)Write this table out as XML.-
Methods inherited from class org.apache.poi.POIXMLDocumentPart
addRelation, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationId, getRelations, toString
-
-
-
-
Field Detail
-
FIRST_CUSTOM_STYLE_ID
public static final int FIRST_CUSTOM_STYLE_ID
The first style id available for use as a custom style- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StylesTable
public StylesTable()
Create a new, empty StylesTable
-
StylesTable
public StylesTable(PackagePart part, PackageRelationship rel) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getTheme
public ThemesTable getTheme()
-
setTheme
public void setTheme(ThemesTable theme)
-
getNumberFormatAt
public java.lang.String getNumberFormatAt(int idx)
-
putNumberFormat
public int putNumberFormat(java.lang.String fmt)
-
getFontAt
public XSSFFont getFontAt(int idx)
-
putFont
public int putFont(XSSFFont font, boolean forceRegistration)
Records the given font in the font table. Will re-use an existing font index if this font matches another, EXCEPT if forced registration is requested. This allows people to create several fonts then customise them later. Note - End Users probably want to callXSSFFont.registerTo(StylesTable)
-
putFont
public int putFont(XSSFFont font)
-
getStyleAt
public XSSFCellStyle getStyleAt(int idx)
-
putStyle
public int putStyle(XSSFCellStyle style)
-
getBorderAt
public XSSFCellBorder getBorderAt(int idx)
-
putBorder
public int putBorder(XSSFCellBorder border)
-
getFillAt
public XSSFCellFill getFillAt(int idx)
-
getBorders
public java.util.List<XSSFCellBorder> getBorders()
-
getFills
public java.util.List<XSSFCellFill> getFills()
-
getFonts
public java.util.List<XSSFFont> getFonts()
-
getNumberFormats
public java.util.Map<java.lang.Integer,java.lang.String> getNumberFormats()
-
putFill
public int putFill(XSSFCellFill fill)
-
getCellXfAt
public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf getCellXfAt(int idx)
-
putCellXf
public int putCellXf(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf cellXf)
-
replaceCellXfAt
public void replaceCellXfAt(int idx, org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf cellXf)
-
getCellStyleXfAt
public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf getCellStyleXfAt(int idx)
-
putCellStyleXf
public int putCellStyleXf(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf cellStyleXf)
-
replaceCellStyleXfAt
public void replaceCellStyleXfAt(int idx, org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf cellStyleXf)
-
getNumCellStyles
public int getNumCellStyles()
get the size of cell styles
-
_getNumberFormatSize
public int _getNumberFormatSize()
For unit testing only
-
_getXfsSize
public int _getXfsSize()
For unit testing only
-
_getStyleXfsSize
public int _getStyleXfsSize()
For unit testing only
-
getCTStylesheet
public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTStylesheet getCTStylesheet()
For unit testing only!
-
_getDXfsSize
public int _getDXfsSize()
-
writeTo
public void writeTo(java.io.OutputStream out) throws java.io.IOExceptionWrite this table out as XML.- Parameters:
out- The stream to write to.- Throws:
java.io.IOException- if an error occurs while writing.
-
getDxfAt
public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDxf getDxfAt(int idx)
-
putDxf
public int putDxf(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDxf dxf)
-
createCellStyle
public XSSFCellStyle createCellStyle()
-
findFont
public 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
-
-
DataMelt 3.0 © DataMelt by jWork.ORG