public interface CellStyle
Modifier and Type | Method and Description |
---|---|
void |
cloneStyleFrom(CellStyle source)
Clones all the style information from another
CellStyle, onto this one.
|
HorizontalAlignment |
getAlignment()
get the type of horizontal alignment for the cell
|
BorderStyle |
getBorderBottom()
get the type of border to use for the bottom border of the cell
|
BorderStyle |
getBorderLeft()
get the type of border to use for the left border of the cell
|
BorderStyle |
getBorderRight()
get the type of border to use for the right border of the cell
|
BorderStyle |
getBorderTop()
get the type of border to use for the top border of the cell
|
short |
getBottomBorderColor()
get the color to use for the left border
|
short |
getDataFormat()
get the index of the data format.
|
java.lang.String |
getDataFormatString()
Get the format string
|
short |
getFillBackgroundColor()
get the background fill color, if the fill
is defined with an indexed color.
|
Color |
getFillBackgroundColorColor()
Gets the color object representing the current
background fill, resolving indexes using
the supplied workbook.
|
short |
getFillForegroundColor()
get the foreground fill color, if the fill
is defined with an indexed color.
|
Color |
getFillForegroundColorColor()
Gets the color object representing the current
foreground fill, resolving indexes using
the supplied workbook.
|
FillPatternType |
getFillPattern()
Get the fill pattern
|
int |
getFontIndex()
gets the index of the font for this style
|
int |
getFontIndexAsInt()
Deprecated.
use
getFontIndex() instead |
boolean |
getHidden()
get whether the cell's using this style are to be hidden
|
short |
getIndention()
get the number of spaces to indent the text in the cell
|
short |
getIndex()
get the index within the Workbook (sequence within the collection of ExtnededFormat objects)
|
short |
getLeftBorderColor()
get the color to use for the left border
|
boolean |
getLocked()
get whether the cell's using this style are to be locked
|
boolean |
getQuotePrefixed()
Is "Quote Prefix" or "123 Prefix" enabled for the cell?
Having this on is somewhat (but not completely, see
IgnoredErrorType )
like prefixing the cell value with a ' in Excel |
short |
getRightBorderColor()
get the color to use for the left border
|
short |
getRotation()
get the degree of rotation for the text in the cell.
|
boolean |
getShrinkToFit()
Should the Cell be auto-sized by Excel to shrink
it to fit if this text is too long?
|
short |
getTopBorderColor()
get the color to use for the top border
|
VerticalAlignment |
getVerticalAlignment()
get the type of vertical alignment for the cell
|
boolean |
getWrapText()
get whether the text should be wrapped
|
void |
setAlignment(HorizontalAlignment align)
set the type of horizontal alignment for the cell
|
void |
setBorderBottom(BorderStyle border)
set the type of border to use for the bottom border of the cell
|
void |
setBorderLeft(BorderStyle 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 |
setBorderTop(BorderStyle 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 |
setDataFormat(short fmt)
set the data format (must be a valid format).
|
void |
setFillBackgroundColor(short bg)
set the background fill color.
|
void |
setFillForegroundColor(short bg)
set the foreground fill color
Note: Ensure Foreground color is set prior to background color.
|
void |
setFillPattern(FillPatternType fp)
setting to one fills the cell with the foreground color...
|
void |
setFont(Font font)
set the font for this style
|
void |
setHidden(boolean hidden)
set the cell's using this style to be hidden
|
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
|
void |
setLocked(boolean locked)
set the cell's using this style to be locked
|
void |
setQuotePrefixed(boolean quotePrefix)
Turn on or off "Quote Prefix" or "123 Prefix" for the style,
which is used to tell Excel that the thing which looks like
a number or a formula shouldn't be treated as on.
|
void |
setRightBorderColor(short color)
set the color to use for the right border
|
void |
setRotation(short rotation)
set the degree of rotation for the text in the cell.
|
void |
setShrinkToFit(boolean shrinkToFit)
Controls if the Cell should be auto-sized
to shrink to fit if the text is too long
|
void |
setTopBorderColor(short color)
set the color to use for the top border
|
void |
setVerticalAlignment(VerticalAlignment align)
set the type of vertical alignment for the cell
|
void |
setWrapText(boolean wrapped)
Set whether the text should be wrapped.
|
short getIndex()
void setDataFormat(short fmt)
BuiltinFormats
.DataFormat
short getDataFormat()
BuiltinFormats
.DataFormat
java.lang.String getDataFormatString()
void setFont(Font font)
font
- a font object created or retrieved from the Workbook objectWorkbook.createFont()
,
Workbook.getFontAt(int)
int getFontIndex()
Workbook.getFontAt(int)
@Deprecated @Removal(version="6.0.0") int getFontIndexAsInt()
getFontIndex()
insteadWorkbook.getFontAt(int)
void setHidden(boolean hidden)
hidden
- - whether the cell using this style should be hiddenboolean getHidden()
void setLocked(boolean locked)
locked
- - whether the cell using this style should be lockedboolean getLocked()
void setQuotePrefixed(boolean quotePrefix)
IgnoredErrorType
)
like prefixing the cell value with a ' in Excelboolean getQuotePrefixed()
IgnoredErrorType
)
like prefixing the cell value with a ' in Excelvoid setAlignment(HorizontalAlignment align)
align
- - the type of alignmentHorizontalAlignment getAlignment()
void setWrapText(boolean wrapped)
true
make all content visible
within a cell by displaying it on multiple lineswrapped
- wrap text or notboolean getWrapText()
void setVerticalAlignment(VerticalAlignment align)
align
- the type of alignmentVerticalAlignment getVerticalAlignment()
void setRotation(short rotation)
rotation
- degrees (see note above)short getRotation()
void setIndention(short indent)
indent
- - number of spacesshort getIndention()
void setBorderLeft(BorderStyle border)
border
- typeBorderStyle getBorderLeft()
void setBorderRight(BorderStyle border)
border
- typeBorderStyle getBorderRight()
void setBorderTop(BorderStyle border)
border
- typeBorderStyle getBorderTop()
void setBorderBottom(BorderStyle border)
border
- typeBorderStyle getBorderBottom()
void setLeftBorderColor(short color)
color
- The index of the color definitionshort getLeftBorderColor()
void setRightBorderColor(short color)
color
- The index of the color definitionshort getRightBorderColor()
void setTopBorderColor(short color)
color
- The index of the color definitionshort getTopBorderColor()
void setBottomBorderColor(short color)
color
- The index of the color definitionshort getBottomBorderColor()
void setFillPattern(FillPatternType fp)
fp
- fill pattern (set to FillPatternType.SOLID_FOREGROUND
to fill w/foreground color)FillPatternType getFillPattern()
FillPatternType.NO_FILL
void setFillBackgroundColor(short bg)
bg
- colorshort getFillBackgroundColor()
Color getFillBackgroundColorColor()
void setFillForegroundColor(short bg)
bg
- colorshort getFillForegroundColor()
Color getFillForegroundColorColor()
void cloneStyleFrom(CellStyle source)
void setShrinkToFit(boolean shrinkToFit)
boolean getShrinkToFit()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.