public class StyleSetter extends Object
For example:
Worksheet ws = ... ws.range(1, 1, 1, 10).style().borderStyle("thin").bold().fillColor(Color.GRAY4).horizontalAlignment("center").set();
Modifier and Type | Method and Description |
---|---|
StyleSetter |
bold()
Use bold text.
|
StyleSetter |
borderColor(BorderSide side,
String borderColor)
Set cell border color.
|
StyleSetter |
borderColor(String borderColor)
Set cell border color.
|
StyleSetter |
borderStyle(BorderSide side,
BorderStyle borderStyle)
Apply cell border style on a side.
|
StyleSetter |
borderStyle(BorderSide side,
String borderStyle)
Apply cell border style on a side.
|
StyleSetter |
borderStyle(BorderStyle borderStyle)
Apply cell border style on all sides, except diagonal.
|
StyleSetter |
borderStyle(String borderStyle)
Apply cell border style on all sides, except diagonal.
|
StyleSetter |
fillColor(String rgb)
Set fill color.
|
StyleSetter |
fontColor(String rgb)
Set font color.
|
StyleSetter |
fontName(String name)
Set font name.
|
StyleSetter |
fontSize(BigDecimal size)
Set font size.
|
StyleSetter |
fontSize(int size)
Set font size.
|
StyleSetter |
format(String numberingFormat)
Set numbering format.
|
StyleSetter |
horizontalAlignment(String alignment)
Define horizontal alignment.
|
StyleSetter |
italic()
Use italic text.
|
StyleSetter |
merge()
Merge cells in this style setter's range.
|
StyleSetter |
protectionOption(ProtectionOption option,
Boolean value)
Sets the value for a protection option.
|
void |
set()
Apply style elements.
|
StyleSetter |
shadeAlternateRows(String rgb)
Shade alternate rows.
|
StyleSetter |
shadeRows(String rgb,
int eachNRows)
Shade Nth rows.
|
StyleSetter |
underlined()
Use underlined text.
|
StyleSetter |
verticalAlignment(String alignment)
Define vertical alignment.
|
StyleSetter |
wrapText(boolean wrapText)
Enable or disable text wrapping in cells.
|
public StyleSetter format(String numberingFormat)
numberingFormat
- Numbering format. For more information, refer to
this
page.public StyleSetter fillColor(String rgb)
rgb
- RGB fill color. See Color
for predefined values.public StyleSetter shadeAlternateRows(String rgb)
rgb
- RGB shading color.public StyleSetter shadeRows(String rgb, int eachNRows)
rgb
- RGB shading color.eachNRows
- shading frequency.public StyleSetter fontColor(String rgb)
rgb
- RGB font color.public StyleSetter fontName(String name)
name
- Font name.public StyleSetter fontSize(BigDecimal size)
size
- Font size, in points.public StyleSetter fontSize(int size)
size
- Font size, in points.public StyleSetter bold()
public StyleSetter italic()
public StyleSetter underlined()
public StyleSetter horizontalAlignment(String alignment)
alignment
- Horizontal alignment. Possible values are defined
here.public StyleSetter verticalAlignment(String alignment)
alignment
- Vertical alignment. Possible values are defined
here.public StyleSetter wrapText(boolean wrapText)
wrapText
- true
to enable text wrapping (default is
false
).public StyleSetter borderStyle(BorderStyle borderStyle)
borderStyle
- Border style.public StyleSetter borderStyle(String borderStyle)
borderStyle
- Border style. Possible values are defined
here.public StyleSetter borderStyle(BorderSide side, BorderStyle borderStyle)
side
- Border side where to apply the given style.borderStyle
- Border style.public StyleSetter borderStyle(BorderSide side, String borderStyle)
side
- Border side where to apply the given style.borderStyle
- Border style. Possible values are defined
here.public StyleSetter borderColor(String borderColor)
borderColor
- RGB border color.public StyleSetter borderColor(BorderSide side, String borderColor)
side
- Border side where to apply the given border color.borderColor
- RGB border color.public StyleSetter protectionOption(ProtectionOption option, Boolean value)
option
- The option to setvalue
- The value to set for the given option.public StyleSetter merge()
public void set()
Copyright © 2022. All rights reserved.