public enum BuiltInCellStyleName extends Enum<BuiltInCellStyleName> implements com.gembox.internal.core.DescriptionHolder
Conceptually, cell formatting is divided into following groups:
CellStyle.setNumberFormat(java.lang.String)
.
CellStyle.setHorizontalAlignment(com.gembox.spreadsheet.HorizontalAlignmentStyle)
, CellStyle.setVerticalAlignment(com.gembox.spreadsheet.VerticalAlignmentStyle)
, CellStyle.setIndent(int)
, CellStyle.setRotation(int)
, CellStyle.setTextVertical(boolean)
, CellStyle.setWrapText(boolean)
and CellStyle.setShrinkToFit(boolean)
.
CellStyle.setFont(com.gembox.spreadsheet.ExcelFont)
.
CellStyle.setBorders(com.gembox.spreadsheet.CellBorders)
.
CellStyle.setFillPattern(com.gembox.spreadsheet.ExcelFillPattern)
.
CellStyle.setLocked(boolean)
and CellStyle.setFormulaHidden(boolean)
.
Additional CellStyle
methods not associated with any formatting group are:
CellStyle.getName()
- name of the referenced workbook style
.
CellStyle.setQuotePrefix(boolean)
- true
to store numeric value of a cell as text; otherwise, false
.
CellStyle.isDefault()
- true
if referenced
workbook style
is default (
CellStyleCollection.getNormal()
) and there are no additional modifications of cell formatting; otherwise, false
.
Workbook
contains a set of master styles
which can be referenced by multiple cells.
Workbook
must always contain at least one master style
which cannot be removed and is, by default, referenced by all cells. This default style is
CellStyleCollection.getNormal()
.
Workbook style
can either be built-in or user-defined. Built-in style is accessible from workbook styles
via BuiltInCellStyleName
enumeration.
Cell formatting group (Number, Alignment, Font, Border, Fill or Protection) (and its associated methods) is resolved from referenced
workbook (master) style
, unless cell formatting group or its associated method is modified.
Cell formatting is available for one or more cells through AbstractRange.setStyle(com.gembox.spreadsheet.CellStyle)
method which is available on ExcelCell
and CellRange
types.
Cell formatting specified on ExcelColumn
and ExcelRow
types through ExcelColumnRowBase.setStyle(com.gembox.spreadsheet.CellStyle)
method is simply propagated to cell formatting of its ExcelColumnRowBase.getCells()
.
For performance reasons, cell formatting on CellRange
is resolved based just on its top-left cell formatting, except borders which are resolved based on corner cells depending on border side.
Setting cell formatting method on CellRange
is propagated to each cell in a range.
To set workbook (master) style
to one or more cells, simply assign it to AbstractRange.setStyle(com.gembox.spreadsheet.CellStyle)
method.
Preferable way to modify formatting method of multiple cells is to get CellRange
to which all those cells belong, and use AbstractRange.setStyle(com.gembox.spreadsheet.CellStyle)
method of that range to make the modification.
If modifying multiple formatting properties of a CellRange
, without preserving unmodified formatting properties, preferable way is to create new instance of CellStyle
, make modifications on it, and assign it using AbstractRange.setStyle(com.gembox.spreadsheet.CellStyle)
method of that range.
GemBox.Spreadsheet internally takes care not to allocate unnecessary cells when formatting a range of cells (for example, when formatting all worksheet cells
) and to cache formatting information of equally formatted cells, at the appropriate time, to reduce memory footprint.
Enum Constant and Description |
---|
ACCENT_1
'Accent1' built-in style.
|
ACCENT_1_PCT_20
'20% - Accent1' built-in style.
|
ACCENT_1_PCT_40
'40% - Accent1' built-in style.
|
ACCENT_1_PCT_60
'60% - Accent1' built-in style.
|
ACCENT_2
'Accent2' built-in style.
|
ACCENT_2_PCT_20
'20% - Accent2' built-in style.
|
ACCENT_2_PCT_40
'40% - Accent2' built-in style.
|
ACCENT_2_PCT_60
'60% - Accent2' built-in style.
|
ACCENT_3
'Accent3' built-in style.
|
ACCENT_3_PCT_20
'20% - Accent3' built-in style.
|
ACCENT_3_PCT_40
'40% - Accent3' built-in style.
|
ACCENT_3_PCT_60
'60% - Accent3' built-in style.
|
ACCENT_4
'Accent4' built-in style.
|
ACCENT_4_PCT_20
'20% - Accent4' built-in style.
|
ACCENT_4_PCT_40
'40% - Accent4' built-in style.
|
ACCENT_4_PCT_60
'60% - Accent4' built-in style.
|
ACCENT_5
'Accent5' built-in style.
|
ACCENT_5_PCT_20
'20% - Accent5' built-in style.
|
ACCENT_5_PCT_40
'40% - Accent5' built-in style.
|
ACCENT_5_PCT_60
'60% - Accent5' built-in style.
|
ACCENT_6
'Accent6' built-in style.
|
ACCENT_6_PCT_20
'20% - Accent6' built-in style.
|
ACCENT_6_PCT_40
'40% - Accent6' built-in style.
|
ACCENT_6_PCT_60
'60% - Accent6' built-in style.
|
BAD
'Bad' built-in style.
|
CALCULATION
'Calculation' built-in style.
|
CHECK_CELL
'Check Cell' built-in style.
|
COL_LEVEL_1
'ColLevel_1' built-in style.
|
COL_LEVEL_2
'ColLevel_2' built-in style.
|
COL_LEVEL_3
'ColLevel_3' built-in style.
|
COL_LEVEL_4
'ColLevel_4' built-in style.
|
COL_LEVEL_5
'ColLevel_5' built-in style.
|
COL_LEVEL_6
'ColLevel_6' built-in style.
|
COL_LEVEL_7
'ColLevel_7' built-in style.
|
COMMA
'Comma' built-in style.
|
COMMA_0
'Comma [0]' built-in style.
|
CURRENCY
'Currency' built-in style.
|
CURRENCY_0
'Currency [0]' built-in style.
|
EXPLANATORY_TEXT
'Explanatory Text' built-in style.
|
FOLLOWED_HYPERLINK
Followed Hyperlink built-in style.
|
GOOD
'Good' built-in style.
|
HEADING_1
'Heading 1' built-in style.
|
HEADING_2
'Heading 2' built-in style.
|
HEADING_3
'Heading 3' built-in style.
|
HEADING_4
'Heading 4' built-in style.
|
HYPERLINK
Hyperlink built-in style.
|
INPUT
'Input' built-in style.
|
LINKED_CELL
'Linked Cell' built-in style.
|
NEUTRAL
'Neutral' built-in style.
|
NORMAL
'
CellStyleCollection.getNormal() ' built-in style. |
NOTE
Note built-in style.
|
OUTPUT
'Output' built-in style.
|
PERCENT
'Percent' built-in style.
|
ROW_LEVEL_1
'RowLevel_1' built-in style.
|
ROW_LEVEL_2
'RowLevel_2' built-in style.
|
ROW_LEVEL_3
'RowLevel_3' built-in style.
|
ROW_LEVEL_4
'RowLevel_4' built-in style.
|
ROW_LEVEL_5
'RowLevel_5' built-in style.
|
ROW_LEVEL_6
'RowLevel_6' built-in style.
|
ROW_LEVEL_7
'RowLevel_7' built-in style.
|
TITLE
'Title' built-in style.
|
TOTAL
'Total' built-in style.
|
WARNING_TEXT
'Warning Text' built-in style.
|
Modifier and Type | Method and Description |
---|---|
static BuiltInCellStyleName |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BuiltInCellStyleName[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BuiltInCellStyleName ACCENT_1
public static final BuiltInCellStyleName ACCENT_1_PCT_20
public static final BuiltInCellStyleName ACCENT_1_PCT_40
public static final BuiltInCellStyleName ACCENT_1_PCT_60
public static final BuiltInCellStyleName ACCENT_2
public static final BuiltInCellStyleName ACCENT_2_PCT_20
public static final BuiltInCellStyleName ACCENT_2_PCT_40
public static final BuiltInCellStyleName ACCENT_2_PCT_60
public static final BuiltInCellStyleName ACCENT_3
public static final BuiltInCellStyleName ACCENT_3_PCT_20
public static final BuiltInCellStyleName ACCENT_3_PCT_40
public static final BuiltInCellStyleName ACCENT_3_PCT_60
public static final BuiltInCellStyleName ACCENT_4
public static final BuiltInCellStyleName ACCENT_4_PCT_20
public static final BuiltInCellStyleName ACCENT_4_PCT_40
public static final BuiltInCellStyleName ACCENT_4_PCT_60
public static final BuiltInCellStyleName ACCENT_5
public static final BuiltInCellStyleName ACCENT_5_PCT_20
public static final BuiltInCellStyleName ACCENT_5_PCT_40
public static final BuiltInCellStyleName ACCENT_5_PCT_60
public static final BuiltInCellStyleName ACCENT_6
public static final BuiltInCellStyleName ACCENT_6_PCT_20
public static final BuiltInCellStyleName ACCENT_6_PCT_40
public static final BuiltInCellStyleName ACCENT_6_PCT_60
public static final BuiltInCellStyleName BAD
public static final BuiltInCellStyleName CALCULATION
public static final BuiltInCellStyleName CHECK_CELL
public static final BuiltInCellStyleName COL_LEVEL_1
public static final BuiltInCellStyleName COL_LEVEL_2
public static final BuiltInCellStyleName COL_LEVEL_3
public static final BuiltInCellStyleName COL_LEVEL_4
public static final BuiltInCellStyleName COL_LEVEL_5
public static final BuiltInCellStyleName COL_LEVEL_6
public static final BuiltInCellStyleName COL_LEVEL_7
public static final BuiltInCellStyleName COMMA
public static final BuiltInCellStyleName COMMA_0
public static final BuiltInCellStyleName CURRENCY
public static final BuiltInCellStyleName CURRENCY_0
public static final BuiltInCellStyleName EXPLANATORY_TEXT
public static final BuiltInCellStyleName FOLLOWED_HYPERLINK
public static final BuiltInCellStyleName GOOD
public static final BuiltInCellStyleName HEADING_1
public static final BuiltInCellStyleName HEADING_2
public static final BuiltInCellStyleName HEADING_3
public static final BuiltInCellStyleName HEADING_4
public static final BuiltInCellStyleName HYPERLINK
public static final BuiltInCellStyleName INPUT
public static final BuiltInCellStyleName LINKED_CELL
public static final BuiltInCellStyleName NEUTRAL
public static final BuiltInCellStyleName NORMAL
CellStyleCollection.getNormal()
' built-in style.public static final BuiltInCellStyleName NOTE
public static final BuiltInCellStyleName OUTPUT
public static final BuiltInCellStyleName PERCENT
public static final BuiltInCellStyleName ROW_LEVEL_1
public static final BuiltInCellStyleName ROW_LEVEL_2
public static final BuiltInCellStyleName ROW_LEVEL_3
public static final BuiltInCellStyleName ROW_LEVEL_4
public static final BuiltInCellStyleName ROW_LEVEL_5
public static final BuiltInCellStyleName ROW_LEVEL_6
public static final BuiltInCellStyleName ROW_LEVEL_7
public static final BuiltInCellStyleName TITLE
public static final BuiltInCellStyleName TOTAL
public static final BuiltInCellStyleName WARNING_TEXT
public static BuiltInCellStyleName valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static BuiltInCellStyleName[] values()
for (BuiltInCellStyleName c : BuiltInCellStyleName.values()) System.out.println(c);
© GemBox Ltd. — All rights reserved.