public interface CellStyle
Modifier and Type | Method and Description |
---|---|
void |
cloneStyleFrom(CellStyle source)
Clones all the style information from another CellStyle, onto this one.
(将另一个 CellStyle 中的所有样式信息克隆到这个上。)
|
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()
|
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)
(获取工作簿中的索引(ExtnededFormat 对象集合中的序列))
|
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
(单元格是否启用了“引用前缀”或“123 前缀”?启用此功能有点(但不完全,请参阅 IgnoredErrorType),例如在 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?
(如果此文本太长,是否应该由 Excel 自动调整单元格以缩小它以适应?)
|
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...
(设置为 1 用前景色填充单元格...)
|
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.
(打开或关闭样式的“引用前缀”或“123 前缀”,用于告诉 Excel 不应将看起来像数字或公式的东西视为打开。)
|
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
.
(设置数据格式(必须是有效格式)。内置格式在 BuiltinFormats 中定义。)
DataFormat
short getDataFormat()
BuiltinFormats
.
(获取数据格式的索引。内置格式在 BuiltinFormats 中定义。)
DataFormat
java.lang.String getDataFormatString()
void setFont(Font font)
font
- a font object created or retrieved from the Workbook object
(font - 从 Workbook 对象创建或检索的字体对象)
Workbook.createFont()
,
Workbook.getFontAt(int)
int getFontIndex()
Workbook.getFontAt(int)
@Deprecated @Removal(version="6.0.0") int getFontIndexAsInt()
getFontIndex()
instead
Workbook.getFontAt(int)
void setHidden(boolean hidden)
hidden
- - whether the cell using this style should be hidden
(hidden - - 使用该样式的单元格是否应该隐藏)
boolean getHidden()
void setLocked(boolean locked)
locked
- - whether the cell using this style should be locked
(锁定 - - 使用该样式的单元格是否应该被锁定)
boolean getLocked()
void setQuotePrefixed(boolean quotePrefix)
IgnoredErrorType
) like prefixing the cell value with a ' in Excel
(打开或关闭样式的“引用前缀”或“123 前缀”,用于告诉 Excel 不应将看起来像数字或公式的东西视为打开。打开它有点(但不完全,请参阅 IgnoredErrorType)就像在 Excel 中为单元格值添加前缀)
boolean getQuotePrefixed()
IgnoredErrorType
) like prefixing the cell value with a ' in Excel
(单元格是否启用了“引用前缀”或“123 前缀”?启用此功能有点(但不完全,请参阅 IgnoredErrorType),例如在 Excel 中为单元格值添加前缀)
void setAlignment(HorizontalAlignment align)
align
- - the type of alignment
(align - - 对齐类型)
HorizontalAlignment getAlignment()
void setWrapText(boolean wrapped)
true
make all content visible within a cell by displaying it on multiple lines
(设置文本是否应换行。将此标志设置为 true 通过在多行上显示单元格中的所有内容来使所有内容可见)
wrapped
- wrap text or not
(Wrapped - 是否换行)
boolean getWrapText()
void setVerticalAlignment(VerticalAlignment align)
align
- the type of alignment
(align - 对齐的类型)
VerticalAlignment getVerticalAlignment()
void setRotation(short rotation)
rotation
- degrees (see note above)
(旋转 - 度数(见上面的注释))
short getRotation()
void setIndention(short indent)
indent
- - number of spaces
(缩进 - - 空格数)
short getIndention()
void setBorderLeft(BorderStyle border)
border
- type
(边框类型)
BorderStyle getBorderLeft()
void setBorderRight(BorderStyle border)
border
- type
(边框类型)
BorderStyle getBorderRight()
void setBorderTop(BorderStyle border)
border
- type
(边框类型)
BorderStyle getBorderTop()
void setBorderBottom(BorderStyle border)
border
- type
(边框类型)
BorderStyle getBorderBottom()
void setLeftBorderColor(short color)
color
- The index of the color definition
(color - 颜色定义的索引)
short getLeftBorderColor()
void setRightBorderColor(short color)
color
- The index of the color definition
(color - 颜色定义的索引)
short getRightBorderColor()
void setTopBorderColor(short color)
color
- The index of the color definition
(color - 颜色定义的索引)
short getTopBorderColor()
void setBottomBorderColor(short color)
color
- The index of the color definition
(color - 颜色定义的索引)
short getBottomBorderColor()
void setFillPattern(FillPatternType fp)
fp
- fill pattern (set to
FillPatternType.SOLID_FOREGROUND
to fill w/foreground color)
(fp - 填充图案(设置为 FillPatternType.SOLID_FOREGROUND 以填充前景色))
FillPatternType getFillPattern()
FillPatternType.NO_FILL
(填充图案,默认值为 FillPatternType.NO_FILL)
void setFillBackgroundColor(short bg)
bg
- color
(bg - 颜色)
short getFillBackgroundColor()
Color getFillBackgroundColorColor()
void setFillForegroundColor(short bg)
bg
- color
(bg - 颜色)
short getFillForegroundColor()
Color getFillForegroundColorColor()
void cloneStyleFrom(CellStyle source)
void setShrinkToFit(boolean shrinkToFit)
boolean getShrinkToFit()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.