public class XSSFCellStyle extends Object implements CellStyle
XSSFWorkbook.createCellStyle(),
org.zkoss.poi.xssf.usermodel.XSSFWorkbook#getCellStyleAt(short),
XSSFCell.setCellStyle(org.zkoss.poi.ss.usermodel.CellStyle)ALIGN_CENTER, ALIGN_CENTER_SELECTION, ALIGN_FILL, ALIGN_GENERAL, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_RIGHT, ALT_BARS, BIG_SPOTS, BORDER_DASH_DOT, BORDER_DASH_DOT_DOT, BORDER_DASHED, BORDER_DOTTED, BORDER_DOUBLE, BORDER_HAIR, BORDER_MEDIUM, BORDER_MEDIUM_DASH_DOT, BORDER_MEDIUM_DASH_DOT_DOT, BORDER_MEDIUM_DASHED, BORDER_NONE, BORDER_SLANTED_DASH_DOT, BORDER_THICK, BORDER_THIN, BRICKS, DIAMONDS, FINE_DOTS, LEAST_DOTS, LESS_DOTS, NO_FILL, SOLID_FOREGROUND, SPARSE_DOTS, SQUARES, THICK_BACKWARD_DIAG, THICK_FORWARD_DIAG, THICK_HORZ_BANDS, THICK_VERT_BANDS, THIN_BACKWARD_DIAG, THIN_FORWARD_DIAG, THIN_HORZ_BANDS, THIN_VERT_BANDS, VERTICAL_BOTTOM, VERTICAL_CENTER, VERTICAL_JUSTIFY, VERTICAL_TOP| Constructor and Description |
|---|
XSSFCellStyle(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf cellStyleXf,
StylesTable stylesSource,
ThemesTable theme) |
XSSFCellStyle(int cellXfId,
int cellStyleXfId,
StylesTable stylesSource,
ThemesTable theme)
Creates a Cell Style from the supplied parts
|
XSSFCellStyle(StylesTable stylesSource)
Creates an empty Cell Style
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Make a copy of this style.
|
void |
cloneStyleFrom(CellStyle source)
Clones all the style information from another
XSSFCellStyle, onto this one.
|
boolean |
equals(Object o)
Checks is the supplied style is equal to this style
|
short |
getAlignment()
Get the type of horizontal alignment for the cell
|
HorizontalAlignment |
getAlignmentEnum()
Get the type of horizontal alignment for the cell
|
short |
getBorderBottom()
Get the type of border to use for the bottom border of the cell
|
BorderStyle |
getBorderBottomEnum()
Get the type of border to use for the bottom border of the cell
|
XSSFColor |
getBorderColor(XSSFCellBorder.BorderSide side)
Gets border color
|
short |
getBorderDiagonal()
get the type of border to use for the diagonal border of the cell
|
short |
getBorderLeft()
Get the type of border to use for the left border of the cell
|
BorderStyle |
getBorderLeftEnum()
Get the type of border to use for the left border of the cell
|
short |
getBorderRight()
Get the type of border to use for the right border of the cell
|
BorderStyle |
getBorderRightEnum()
Get the type of border to use for the right border of the cell
|
short |
getBorderTop()
Get the type of border to use for the top border of the cell
|
BorderStyle |
getBorderTopEnum()
Get the type of border to use for the top border of the cell
|
short |
getBottomBorderColor()
Get the color to use for the bottom border
Color is optional. |
XSSFColor |
getBottomBorderColorColor() |
XSSFColor |
getBottomBorderXSSFColor()
Get the color to use for the bottom border as a
XSSFColor |
protected XSSFCellAlignment |
getCellAlignment()
get the cellAlignment object to use for manage alignment
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf |
getCellXf() |
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf |
getCoreXf()
Used so that StylesSource can figure out our location
|
short |
getDataFormat()
Get the index of the number format (numFmt) record used by this cell format.
|
String |
getDataFormatString()
Get the contents of the format string, by looking up
the StylesSource
|
short |
getDiagonalBorderColor()
get the color to use for the diagonal border
|
Color |
getDiagonalBorderColorColor() |
XSSFColor |
getDiagonalBorderXSSFColor()
Get the color to use for the left border
|
short |
getFillBackgroundColor()
Get the background fill color.
|
XSSFColor |
getFillBackgroundColorColor()
Gets the color object representing the current
background fill, resolving indexes using
the supplied workbook.
|
XSSFColor |
getFillBackgroundXSSFColor()
Get the background fill color.
|
short |
getFillForegroundColor()
Get the foreground fill color.
|
XSSFColor |
getFillForegroundColorColor()
Gets the color object representing the current
foreground fill, resolving indexes using
the supplied workbook.
|
XSSFColor |
getFillForegroundXSSFColor()
Get the foreground fill color.
|
short |
getFillPattern()
Get the fill pattern
|
FillPatternType |
getFillPatternEnum()
Get the fill pattern
|
XSSFFont |
getFont()
Gets the font for this style
|
short |
getFontIndex()
Gets the index of the font for this style
|
boolean |
getHidden()
Get whether the cell's using this style are to be hidden
|
XSSFColor |
getHorizontalBorderXSSFColor()
Get the color to use for the horizontal border
|
short |
getIndention()
Get the number of spaces to indent the text in the cell
|
int |
getIndex()
Get the index within the StylesTable (sequence within the collection of CTXf elements)
|
short |
getLeftBorderColor()
Get the color to use for the left border
|
XSSFColor |
getLeftBorderColorColor() |
XSSFColor |
getLeftBorderXSSFColor()
Get the color to use for the left border
|
boolean |
getLocked()
Get whether the cell's using this style are locked
|
String |
getRawDataFormatString()
Get the raw data format string that are not transfered by ZSS Context Locale
|
short |
getRightBorderColor()
Get the color to use for the right border
|
XSSFColor |
getRightBorderColorColor() |
XSSFColor |
getRightBorderXSSFColor()
Get the color to use for the right border
|
short |
getRotation()
Get the degree of rotation for the text in the cell
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf |
getStyleXf()
Used so that StylesSource can figure out our location
|
short |
getTopBorderColor()
Get the color to use for the top border
|
XSSFColor |
getTopBorderColorColor() |
XSSFColor |
getTopBorderXSSFColor()
Get the color to use for the top border
|
short |
getVerticalAlignment()
Get the type of vertical alignment for the cell
|
VerticalAlignment |
getVerticalAlignmentEnum()
Get the type of vertical alignment for the cell
|
XSSFColor |
getVerticalBorderXSSFColor()
Get the color to use for the left border
|
boolean |
getWrapText()
Whether the text should be wrapped
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isBuiltinDataFormat()
Check if the data format is build in format
|
boolean |
isShowDiagonalDownBorder()
Whether show diagonalDown diagonal border
|
boolean |
isShowDiagonalUpBorder()
Whether show diagonalUp diagonal border
|
void |
setAlignment(HorizontalAlignment align)
Set the type of horizontal alignment for the cell
|
void |
setAlignment(short align)
Set the type of horizontal alignment for the cell
|
void |
setBorder(short left,
Color leftColor,
short top,
Color topColor,
short right,
Color rightColor,
short bottom,
Color bottomColor) |
void |
setBorder(short left,
Color leftColor,
short top,
Color topColor,
short right,
Color rightColor,
short bottom,
Color bottomColor,
short diagonal,
Color diagonalColor,
short horizontal,
Color horizontalColor,
short vertical,
Color verticalColor,
boolean diaUp,
boolean diaDown) |
void |
setBorderBottom(BorderStyle border)
Set the type of border to use for the bottom border of the cell
|
void |
setBorderBottom(short border)
Set the type of border to use for the bottom border of the cell
|
void |
setBorderColor(XSSFCellBorder.BorderSide side,
XSSFColor color)
Set the color to use for the selected border
|
void |
setBorderDiagonal(short border)
set the type of border to use for the diagonal border of the cell
|
void |
setBorderLeft(BorderStyle border)
Set the type of border to use for the left border of the cell
|
void |
setBorderLeft(short border)
Set the type of border to use for the left border of the cell
|
void |
setBorderRight(BorderStyle border)
Set the type of border to use for the right border of the cell
|
void |
setBorderRight(short border)
Set the type of border to use for the right border of the cell
|
void |
setBorderTop(BorderStyle border)
Set the type of border to use for the top border of the cell
|
void |
setBorderTop(short border)
Set the type of border to use for the top border of the cell
|
void |
setBottomBorderColor(short color)
Set the color to use for the bottom border
|
void |
setBottomBorderColor(XSSFColor color)
Set the color to use for the bottom border
|
void |
setCellAlignment(short hAlign,
short vAlign,
boolean wrapText)
Deprecated.
|
void |
setCellAlignment(short hAlign,
short vAlign,
boolean wrapText,
short rotation)
[MS-OI29500: Microsoft Office Implementation Information for ISO/IEC-29500 Standard Compliance]
18.8.1.
|
void |
setDataFormat(short fmt)
Set the index of a data format
|
void |
setDefaultCellAlignment(short hAlign,
short vAlign,
boolean wrapText) |
void |
setDefaultProtection(boolean locked,
boolean hidden) |
void |
setDiagonalBorderColor(short color)
set the color to use for the diagonal border
|
void |
setDiagonalBorderColor(XSSFColor color)
Set the color to use for the left border as a
XSSFColor value |
void |
setFill(Color fillColor,
Color backColor,
short patternType) |
void |
setFillBackgroundColor(short bg)
Set the background fill color represented as a indexed color value.
|
void |
setFillBackgroundColor(XSSFColor color)
Set the background fill color represented as a
XSSFColor value. |
void |
setFillForegroundColor(short fg)
Set the foreground fill color as a indexed color value
Note: Ensure Foreground color is set prior to background color. |
void |
setFillForegroundColor(XSSFColor color)
Set the foreground fill color represented as a
XSSFColor value. |
void |
setFillPattern(FillPatternType ptrn)
This element is used to specify cell fill information for pattern and solid color cell fills.
|
void |
setFillPattern(short fp)
This element is used to specify cell fill information for pattern and solid color cell fills.
|
void |
setFont(Font font)
Set the font for this style
|
void |
setFontColorColor(Color color) |
void |
setHidden(boolean hidden)
Set the cell's using this style to be hidden
|
void |
setHorizontalBorderColor(XSSFColor color)
Set the color to use for the left border as a
XSSFColor value |
void |
setIndention(short indent)
Set the number of spaces to indent the text in the cell
|
void |
setLeftBorderColor(short color)
Set the color to use for the left border as a indexed color value
|
void |
setLeftBorderColor(XSSFColor color)
Set the color to use for the left border as a
XSSFColor value |
void |
setLocked(boolean locked)
Set the cell's using this style to be locked
|
void |
setProtection(boolean locked,
boolean hidden) |
void |
setRightBorderColor(short color)
Set the color to use for the right border
|
void |
setRightBorderColor(XSSFColor color)
Set the color to use for the right border as a
XSSFColor value |
void |
setRotation(short rotation)
Set the degree of rotation for the text in the cell
|
void |
setShowDiagonalDownBorder(boolean down)
Whether show diagonalDown diagonal border
|
void |
setShowDiagonalUpBorder(boolean up)
Whether show diagonalUp diagonal border
|
void |
setTopBorderColor(short color)
Set the color to use for the top border
|
void |
setTopBorderColor(XSSFColor color)
Set the color to use for the top border as a
XSSFColor value |
void |
setVerticalAlignment(short align)
Set the type of vertical alignment for the cell
|
void |
setVerticalAlignment(VerticalAlignment align)
Set the type of vertical alignment for the cell
|
void |
setVerticalBorderColor(XSSFColor color)
Set the color to use for the left border as a
XSSFColor value |
void |
setWrapText(boolean wrapped)
Set whether the text should be wrapped.
|
void |
verifyBelongsToStylesSource(StylesTable src)
Verifies that this style belongs to the supplied Workbook
Styles Source.
|
public XSSFCellStyle(int cellXfId,
int cellStyleXfId,
StylesTable stylesSource,
ThemesTable theme)
cellXfId - The main XF for the cell. Must be a valid 0-based index into the XF tablecellStyleXfId - Optional, style xf. A value of -1 means no xf.stylesSource - Styles Source to work offpublic XSSFCellStyle(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf cellStyleXf,
StylesTable stylesSource,
ThemesTable theme)
public XSSFCellStyle(StylesTable stylesSource)
@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf getCoreXf()
@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf getStyleXf()
public void verifyBelongsToStylesSource(StylesTable src)
IllegalArgumentException - if there's a workbook mis-matchpublic void cloneStyleFrom(CellStyle source)
cloneStyleFrom in interface CellStylepublic short getAlignment()
getAlignment in interface CellStyleCellStyle.ALIGN_GENERAL,
CellStyle.ALIGN_LEFT,
CellStyle.ALIGN_CENTER,
CellStyle.ALIGN_RIGHT,
CellStyle.ALIGN_FILL,
CellStyle.ALIGN_JUSTIFY,
CellStyle.ALIGN_CENTER_SELECTIONpublic HorizontalAlignment getAlignmentEnum()
HorizontalAlignmentpublic short getBorderBottom()
getBorderBottom in interface CellStyleCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic BorderStyle getBorderBottomEnum()
BorderStylepublic short getBorderLeft()
getBorderLeft in interface CellStyleCellStyle.BORDER_NONECellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic BorderStyle getBorderLeftEnum()
BorderStyle.NONEpublic short getBorderRight()
getBorderRight in interface CellStyleCellStyle.BORDER_NONECellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic BorderStyle getBorderRightEnum()
BorderStyle.NONEpublic short getBorderTop()
getBorderTop in interface CellStyleCellStyle.BORDER_NONECellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
#BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic BorderStyle getBorderTopEnum()
BorderStyle.NONEpublic short getBottomBorderColor()
getBottomBorderColor in interface CellStyleIndexedColors.AUTOMATICIndexedColorspublic XSSFColor getBottomBorderXSSFColor()
XSSFColornull if not setpublic short getDataFormat()
getDataFormat in interface CellStyleDataFormatpublic String getDataFormatString()
getDataFormatString in interface CellStylepublic String getRawDataFormatString()
CellStylegetRawDataFormatString in interface CellStylepublic boolean isBuiltinDataFormat()
CellStyleisBuiltinDataFormat in interface CellStylepublic short getFillBackgroundColor()
Note - many cells are actually filled with a foreground
fill, not a background fill - see getFillForegroundColor()
getFillBackgroundColor in interface CellStyleIndexedColors.AUTOMATICIndexedColorspublic XSSFColor getFillBackgroundColorColor()
CellStylegetFillBackgroundColorColor in interface CellStylepublic XSSFColor getFillBackgroundXSSFColor()
Note - many cells are actually filled with a foreground
fill, not a background fill - see getFillForegroundColor()
null if not setXSSFColor.getRgb()public short getFillForegroundColor()
Many cells are filled with this, instead of a
background color (getFillBackgroundColor())
getFillForegroundColor in interface CellStyleIndexedColors.AUTOMATICIndexedColorspublic XSSFColor getFillForegroundColorColor()
CellStylegetFillForegroundColorColor in interface CellStylepublic XSSFColor getFillForegroundXSSFColor()
null if not setpublic short getFillPattern()
getFillPattern in interface CellStyleCellStyle.NO_FILLCellStyle.NO_FILL,
CellStyle.SOLID_FOREGROUND,
CellStyle.FINE_DOTS,
CellStyle.ALT_BARS,
CellStyle.SPARSE_DOTS,
CellStyle.THICK_HORZ_BANDS,
CellStyle.THICK_VERT_BANDS,
CellStyle.THICK_BACKWARD_DIAG,
CellStyle.THICK_FORWARD_DIAG,
CellStyle.BIG_SPOTS,
CellStyle.BRICKS,
CellStyle.THIN_HORZ_BANDS,
CellStyle.THIN_VERT_BANDS,
CellStyle.THIN_BACKWARD_DIAG,
CellStyle.THIN_FORWARD_DIAG,
CellStyle.SQUARES,
CellStyle.DIAMONDSpublic FillPatternType getFillPatternEnum()
FillPatternType.NO_FILLpublic XSSFFont getFont()
public short getFontIndex()
getFontIndex in interface CellStyleXSSFWorkbook.getFontAt(short)public boolean getHidden()
public short getIndention()
getIndention in interface CellStylepublic int getIndex()
public short getLeftBorderColor()
getLeftBorderColor in interface CellStyleIndexedColors.BLACKIndexedColorspublic XSSFColor getLeftBorderXSSFColor()
null if not setIndexedColorspublic boolean getLocked()
public short getRightBorderColor()
getRightBorderColor in interface CellStyleIndexedColors.BLACKIndexedColorspublic XSSFColor getRightBorderXSSFColor()
null if not setpublic short getRotation()
Expressed in degrees. Values range from 0 to 180. The first letter of
the text is considered the center-point of the arc.
For 0 - 90, the value represents degrees above horizon. For 91-180 the degrees below the
horizon is calculated as:
[degrees below horizon] = 90 - textRotation.
getRotation in interface CellStylepublic short getTopBorderColor()
getTopBorderColor in interface CellStyleIndexedColors.BLACKIndexedColorspublic XSSFColor getTopBorderXSSFColor()
null if not setpublic short getVerticalAlignment()
getVerticalAlignment in interface CellStyleCellStyle.VERTICAL_BOTTOMCellStyle.VERTICAL_TOP,
CellStyle.VERTICAL_CENTER,
CellStyle.VERTICAL_BOTTOM,
CellStyle.VERTICAL_JUSTIFYpublic VerticalAlignment getVerticalAlignmentEnum()
VerticalAlignment.BOTTOMVerticalAlignmentpublic boolean getWrapText()
getWrapText in interface CellStylepublic void setAlignment(short align)
setAlignment in interface CellStylealign - - the type of alignmentCellStyle.ALIGN_GENERAL,
CellStyle.ALIGN_LEFT,
CellStyle.ALIGN_CENTER,
CellStyle.ALIGN_RIGHT,
CellStyle.ALIGN_FILL,
CellStyle.ALIGN_JUSTIFY,
CellStyle.ALIGN_CENTER_SELECTIONpublic void setAlignment(HorizontalAlignment align)
align - - the type of alignmentHorizontalAlignmentpublic void setBorderBottom(short border)
setBorderBottom in interface CellStyleborder - the type of border to useCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic void setBorderBottom(BorderStyle border)
border - - type of border to useBorderStylepublic void setBorderLeft(short border)
setBorderLeft in interface CellStyleborder - the type of border to useCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic void setBorderLeft(BorderStyle border)
border - the type of border to usepublic void setBorderRight(short border)
setBorderRight in interface CellStyleborder - the type of border to useCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic void setBorderRight(BorderStyle border)
border - the type of border to usepublic void setBorderTop(short border)
setBorderTop in interface CellStyleborder - the type of border to useCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic void setBorderTop(BorderStyle border)
border - the type of border to usepublic void setBottomBorderColor(short color)
setBottomBorderColor in interface CellStylecolor - the index of the color definitionIndexedColorspublic void setBottomBorderColor(XSSFColor color)
color - the color to use, null means no colorpublic void setDataFormat(short fmt)
setDataFormat in interface CellStylefmt - the index of a data formatDataFormatpublic void setFillBackgroundColor(XSSFColor color)
XSSFColor value.
For example:
cs.setFillPattern(XSSFCellStyle.FINE_DOTS ); cs.setFillBackgroundXSSFColor(new XSSFColor(java.awt.Color.RED));optionally a Foreground and background fill can be applied: Note: Ensure Foreground color is set prior to background
cs.setFillPattern(XSSFCellStyle.FINE_DOTS ); cs.setFillForegroundColor(new XSSFColor(java.awt.Color.BLUE)); cs.setFillBackgroundColor(new XSSFColor(java.awt.Color.GREEN));or, for the special case of SOLID_FILL:
cs.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND ); cs.setFillForegroundColor(new XSSFColor(java.awt.Color.GREEN));It is necessary to set the fill style in order for the color to be shown in the cell.
color - - the color to usepublic void setFillBackgroundColor(short bg)
For example:
cs.setFillPattern(XSSFCellStyle.FINE_DOTS ); cs.setFillBackgroundXSSFColor(IndexedColors.RED.getIndex());optionally a Foreground and background fill can be applied: Note: Ensure Foreground color is set prior to background
cs.setFillPattern(XSSFCellStyle.FINE_DOTS ); cs.setFillForegroundColor(IndexedColors.BLUE.getIndex()); cs.setFillBackgroundColor(IndexedColors.RED.getIndex());or, for the special case of SOLID_FILL:
cs.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND ); cs.setFillForegroundColor(IndexedColors.RED.getIndex());It is necessary to set the fill style in order for the color to be shown in the cell.
setFillBackgroundColor in interface CellStylebg - - the color to useIndexedColorspublic void setFillForegroundColor(XSSFColor color)
XSSFColor value.
color - the color to use)public void setFillForegroundColor(short fg)
setFillForegroundColor in interface CellStylefg - the color to useIndexedColorspublic void setFillPattern(short fp)
setFillPattern in interface CellStylefp - fill pattern (set to CellStyle.SOLID_FOREGROUND to fill w/foreground color)CellStyle.NO_FILL,
CellStyle.SOLID_FOREGROUND,
CellStyle.FINE_DOTS,
CellStyle.ALT_BARS,
CellStyle.SPARSE_DOTS,
CellStyle.THICK_HORZ_BANDS,
CellStyle.THICK_VERT_BANDS,
CellStyle.THICK_BACKWARD_DIAG,
CellStyle.THICK_FORWARD_DIAG,
CellStyle.BIG_SPOTS,
CellStyle.BRICKS,
CellStyle.THIN_HORZ_BANDS,
CellStyle.THIN_VERT_BANDS,
CellStyle.THIN_BACKWARD_DIAG,
CellStyle.THIN_FORWARD_DIAG,
CellStyle.SQUARES,
CellStyle.DIAMONDS,
setFillBackgroundColor(short),
setFillForegroundColor(short)public void setFillPattern(FillPatternType ptrn)
ptrn - the fill pattern to usesetFillBackgroundColor(short),
setFillForegroundColor(short),
FillPatternTypepublic void setFont(Font font)
setFont in interface CellStylefont - a font object created or retreived from the XSSFWorkbook objectXSSFWorkbook.createFont(),
XSSFWorkbook.getFontAt(short)public void setHidden(boolean hidden)
public void setIndention(short indent)
setIndention in interface CellStyleindent - - number of spacespublic void setLeftBorderColor(short color)
setLeftBorderColor in interface CellStylecolor - the index of the color definitionIndexedColorspublic void setLeftBorderColor(XSSFColor color)
XSSFColor valuecolor - the color to usepublic void setLocked(boolean locked)
public void setRightBorderColor(short color)
setRightBorderColor in interface CellStylecolor - the index of the color definitionIndexedColorspublic void setRightBorderColor(XSSFColor color)
XSSFColor valuecolor - the color to usepublic void setRotation(short rotation)
Expressed in degrees. Values range from 0 to 180. The first letter of
the text is considered the center-point of the arc.
For 0 - 90, the value represents degrees above horizon. For 91-180 the degrees below the
horizon is calculated as:
[degrees below horizon] = 90 - textRotation.
setRotation in interface CellStylerotation - - the rotation degrees (between 0 and 180 degrees)public void setTopBorderColor(short color)
setTopBorderColor in interface CellStylecolor - the index of the color definitionIndexedColorspublic void setTopBorderColor(XSSFColor color)
XSSFColor valuecolor - the color to usepublic void setVerticalAlignment(short align)
setVerticalAlignment in interface CellStylealign - - align the type of alignmentCellStyle.VERTICAL_TOP,
CellStyle.VERTICAL_CENTER,
CellStyle.VERTICAL_BOTTOM,
CellStyle.VERTICAL_JUSTIFY,
VerticalAlignmentpublic void setVerticalAlignment(VerticalAlignment align)
align - - the type of alignmentpublic void setWrapText(boolean wrapped)
Setting this flag to true make all content visible
whithin a cell by displaying it on multiple lines
setWrapText in interface CellStylewrapped - a boolean value indicating if the text in a cell should be line-wrapped within the cell.public XSSFColor getBorderColor(XSSFCellBorder.BorderSide side)
side - the border sidepublic void setBorderColor(XSSFCellBorder.BorderSide side, XSSFColor color)
side - - where to apply the color definitioncolor - - the color to useprotected XSSFCellAlignment getCellAlignment()
public int hashCode()
public boolean equals(Object o)
public Object clone()
public XSSFColor getLeftBorderColorColor()
getLeftBorderColorColor in interface CellStylepublic XSSFColor getRightBorderColorColor()
getRightBorderColorColor in interface CellStylepublic XSSFColor getTopBorderColorColor()
getTopBorderColorColor in interface CellStylepublic XSSFColor getBottomBorderColorColor()
getBottomBorderColorColor in interface CellStylepublic void setFontColorColor(Color color)
setFontColorColor in interface CellStyle@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf getCellXf()
@Internal public void setBorder(short left, Color leftColor, short top, Color topColor, short right, Color rightColor, short bottom, Color bottomColor)
@Deprecated public void setCellAlignment(short hAlign, short vAlign, boolean wrapText)
setCellAlignment in interface CellStylepublic void setCellAlignment(short hAlign,
short vAlign,
boolean wrapText,
short rotation)
setCellAlignment in interface CellStylehAlign - vAlign - wrapText - rotation - public void setProtection(boolean locked,
boolean hidden)
setProtection in interface CellStylepublic void setBorderDiagonal(short border)
CellStylesetBorderDiagonal in interface CellStyleborder - typeCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic short getBorderDiagonal()
CellStylegetBorderDiagonal in interface CellStyleCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic Color getDiagonalBorderColorColor()
getDiagonalBorderColorColor in interface CellStylepublic void setDiagonalBorderColor(short color)
CellStylesetDiagonalBorderColor in interface CellStylecolor - The index of the color definitionpublic short getDiagonalBorderColor()
CellStylegetDiagonalBorderColor in interface CellStylepublic XSSFColor getDiagonalBorderXSSFColor()
null if not setIndexedColorspublic XSSFColor getVerticalBorderXSSFColor()
null if not setIndexedColorspublic XSSFColor getHorizontalBorderXSSFColor()
null if not setIndexedColorspublic void setDiagonalBorderColor(XSSFColor color)
XSSFColor valuecolor - the color to usepublic void setHorizontalBorderColor(XSSFColor color)
XSSFColor valuecolor - the color to usepublic void setVerticalBorderColor(XSSFColor color)
XSSFColor valuecolor - the color to usepublic boolean isShowDiagonalUpBorder()
CellStyleisShowDiagonalUpBorder in interface CellStylepublic boolean isShowDiagonalDownBorder()
CellStyleisShowDiagonalDownBorder in interface CellStylepublic void setShowDiagonalUpBorder(boolean up)
CellStylesetShowDiagonalUpBorder in interface CellStylepublic void setShowDiagonalDownBorder(boolean down)
CellStylesetShowDiagonalDownBorder in interface CellStyle@Internal public void setBorder(short left, Color leftColor, short top, Color topColor, short right, Color rightColor, short bottom, Color bottomColor, short diagonal, Color diagonalColor, short horizontal, Color horizontalColor, short vertical, Color verticalColor, boolean diaUp, boolean diaDown)
public void setDefaultCellAlignment(short hAlign,
short vAlign,
boolean wrapText)
public void setDefaultProtection(boolean locked,
boolean hidden)
Copyright © 2020. All rights reserved.