public final class CellUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ALIGNMENT |
static String |
BORDER_BOTTOM |
static String |
BORDER_LEFT |
static String |
BORDER_RIGHT |
static String |
BORDER_TOP |
static String |
BOTTOM_BORDER_COLOR |
static String |
DATA_FORMAT |
static String |
FILL_BACKGROUND_COLOR |
static String |
FILL_FOREGROUND_COLOR |
static String |
FILL_PATTERN |
static String |
FONT |
static String |
HIDDEN |
static String |
INDENTION |
static String |
LEFT_BORDER_COLOR |
static String |
LOCKED |
static String |
RIGHT_BORDER_COLOR |
static String |
ROTATION |
static String |
TOP_BORDER_COLOR |
static String |
VERTICAL_ALIGNMENT |
static String |
WRAP_TEXT |
Modifier and Type | Method and Description |
---|---|
static Cell |
createCell(Row row,
int column,
String value)
Create a cell, and give it a value.
|
static Cell |
createCell(Row row,
int column,
String value,
CellStyle style)
Creates a cell, gives it a value, and applies a style if provided
|
static Cell |
getCell(Row row,
int columnIndex)
Get a specific cell from a row.
|
static Row |
getRow(int rowIndex,
Sheet sheet)
Get a row from the spreadsheet, and create it if it doesn't exist.
|
static void |
setAlignment(Cell cell,
Workbook workbook,
short align)
Take a cell, and align it.
|
static void |
setCellStyleProperty(Cell cell,
Workbook workbook,
String propertyName,
Object propertyValue)
This method attempt to find an already existing CellStyle that matches what you want the
style to be.
|
static void |
setFont(Cell cell,
Workbook workbook,
Font font)
Take a cell, and apply a font to it
|
static Cell |
translateUnicodeValues(Cell cell)
Looks for text in the cell that should be unicode, like α and provides the
unicode version of it.
|
public static final String ALIGNMENT
public static final String BORDER_BOTTOM
public static final String BORDER_LEFT
public static final String BORDER_RIGHT
public static final String BORDER_TOP
public static final String BOTTOM_BORDER_COLOR
public static final String DATA_FORMAT
public static final String FILL_BACKGROUND_COLOR
public static final String FILL_FOREGROUND_COLOR
public static final String FILL_PATTERN
public static final String FONT
public static final String HIDDEN
public static final String INDENTION
public static final String LEFT_BORDER_COLOR
public static final String LOCKED
public static final String RIGHT_BORDER_COLOR
public static final String ROTATION
public static final String TOP_BORDER_COLOR
public static final String VERTICAL_ALIGNMENT
public static final String WRAP_TEXT
public static Row getRow(int rowIndex, Sheet sheet)
rowIndex
- The 0 based row numbersheet
- The sheet that the row is part of.public static Cell getCell(Row row, int columnIndex)
row
- The row that the cell is part ofcolumnIndex
- The column index that the cell is in.public static Cell createCell(Row row, int column, String value, CellStyle style)
row
- the row to create the cell incolumn
- the column index to create the cell invalue
- The value of the cellstyle
- If the style is not null, then setpublic static Cell createCell(Row row, int column, String value)
row
- the row to create the cell incolumn
- the column index to create the cell invalue
- The value of the cellpublic static void setAlignment(Cell cell, Workbook workbook, short align)
cell
- the cell to set the alignment forworkbook
- The workbook that is being worked with.align
- the column alignment to use.for alignment options
public static void setFont(Cell cell, Workbook workbook, Font font)
cell
- the cell to set the alignment forworkbook
- The workbook that is being worked with.font
- The Font that you want to set...public static void setCellStyleProperty(Cell cell, Workbook workbook, String propertyName, Object propertyValue)
workbook
- The workbook that is being worked with.propertyName
- The name of the property that is to be changed.propertyValue
- The value of the property that is to be changed.cell
- The cell that needs it's style changesCopyright © 2020. All rights reserved.