public class JxlsStyle extends java.lang.Object implements JxlsConstants
JxlsWorkbook wb = new JxlsWorkbook("Test");
JxlsSheet sheet = wb.addSheet("Test");
JxlsStyle boldCenteredTextS = wb.addStyle(TEXT).setAlign(CENTER).setBold();
JxlsStyle boldCenteredTextBorderedS = wb.addClonedStyle(boldCenteredTextS).setBorder(BOTTOM, BORDER_THIN);
sheet.setValue(3, 4, "Pi", boldCenteredTextS);
sheet.setValue(4, 4, "Pi", boldCenteredTextBorderedS);
Modifier and Type | Field and Description |
---|---|
protected org.apache.poi.ss.usermodel.CellStyle |
cellStyle |
ALL, AUTO_SIZE, BLACK, BLUE, BOLD, BORDER_NONE, BORDER_THICK, BORDER_THIN, BOTTOM, CENTER, DATE, EMPTY, FLOAT, GREEN, INTEGER, LEFT, LEFT_RIGHT, LIGHT_GREEN, LIGHT_GREY, LIGHT_YELLOW, NONE, PLAIN, RED, RIGHT, TEXT, TOP, TOP_BOTTOM, WHITE
Modifier | Constructor and Description |
---|---|
protected |
JxlsStyle(JxlsWorkbook workbook,
java.lang.String name,
int type) |
protected |
JxlsStyle(JxlsWorkbook workbook,
java.lang.String name,
java.lang.String format) |
Modifier and Type | Method and Description |
---|---|
protected JxlsStyle |
clone(JxlsWorkbook workbook,
java.lang.String name) |
protected void |
createPOICellStyle(JxlsWorkbook workbook,
org.apache.poi.ss.usermodel.Workbook poiWorkbook) |
JxlsStyle |
setAlign(short align)
Sets the justification to use to render the content of the cell
|
JxlsStyle |
setBold()
Make the cell using this style bold
|
JxlsStyle |
setBold(boolean isBold)
Make the cell using this style bold or not
|
JxlsStyle |
setBorder(short place,
short borderStyle)
Sets the borders for some of the sides of the cell
|
JxlsStyle |
setBorderColor(short borderColor)
Sets the border color for the 4 sides of the cell
|
JxlsStyle |
setBorders(short top,
short bottom,
short left,
short right)
Sets the borders for the 4 sides of the cell
|
JxlsStyle |
setCellColor(short bgColor)
Sets the color to use to render the background of the cell
|
JxlsStyle |
setFontName(java.lang.String fontName)
Sets the font name to use in this style
|
JxlsStyle |
setFontSize(int fontSize)
Sets the font size to use in this style
|
JxlsStyle |
setFormat(java.lang.String format)
Sets the format to use to display numbers using this style
|
JxlsStyle |
setTextColor(short textColor)
Sets the color to use to render the writing of the cell
|
JxlsStyle |
setWrap(boolean wraps)
Make the cell wraps its content
|
protected JxlsStyle(JxlsWorkbook workbook, java.lang.String name, int type)
protected JxlsStyle(JxlsWorkbook workbook, java.lang.String name, java.lang.String format)
protected JxlsStyle clone(JxlsWorkbook workbook, java.lang.String name)
public JxlsStyle setFontName(java.lang.String fontName)
fontName
- the name of the fontpublic JxlsStyle setFontSize(int fontSize)
fontSize
- the size in points of the fontpublic JxlsStyle setFormat(java.lang.String format)
format
- the format encoded as per xlspublic JxlsStyle setBold()
public JxlsStyle setWrap(boolean wraps)
public JxlsStyle setBold(boolean isBold)
isBold
- true to set bold, false otherwisepublic JxlsStyle setTextColor(short textColor)
textColor
- the color (one of JxlsConstants color, or one of HSSFColor.color.index)public JxlsStyle setCellColor(short bgColor)
bgColor
- the color (one of JxlsConstants color, or one of HSSFColor.?.index)public JxlsStyle setAlign(short align)
align
- the alignment (one of LEFT, CENTER, RIGHT)public JxlsStyle setBorders(short top, short bottom, short left, short right)
top
- the border to use at the top (one of BORDER_NONE, BORDER_THIN, BORDER_THICK or CellStyle.BORDER_?)bottom
- the border to use at the bottomleft
- the border to use at the leftright
- the border to use at the rightpublic JxlsStyle setBorder(short place, short borderStyle)
place
- the borders to sets (TOP, TOP+LEFT, TOP+BOTTOM...)borderStyle
- the border style to use (one of BORDER_NONE, BORDER_THIN, BORDER_THICK or CellStyle.BORDER_?)public JxlsStyle setBorderColor(short borderColor)
borderColor
- the color (one of JxlsConstants color, or one of HSSFColor.color.index)protected void createPOICellStyle(JxlsWorkbook workbook, org.apache.poi.ss.usermodel.Workbook poiWorkbook)