|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.hssf.usermodel.contrib.HSSFCellUtil
public class HSSFCellUtil
Various utility functions that make working with a cells and rows easier. The various methods that deal with style's allow you to create your HSSFCellStyles as you need them. When you apply a style change to a cell, the code will attempt to see if a style already exists that meets your needs. If not, then it will create a new style. This is to prevent creating too many styles. there is an upper limit in Excel on the number of styles that can be supported.
Constructor Summary | |
---|---|
HSSFCellUtil()
|
Method Summary | |
---|---|
static HSSFCell |
createCell(HSSFRow row,
int column,
java.lang.String value)
Create a cell, and give it a value. |
static HSSFCell |
createCell(HSSFRow row,
int column,
java.lang.String value,
HSSFCellStyle style)
Creates a cell, gives it a value, and applies a style if provided |
static HSSFCell |
getCell(HSSFRow row,
int column)
Get a specific cell from a row. |
static HSSFRow |
getRow(int rowCounter,
HSSFSheet sheet)
Get a row from the spreadsheet, and create it if it doesn't exist. |
static void |
setAlignment(HSSFCell cell,
HSSFWorkbook workbook,
short align)
Take a cell, and align it. |
static void |
setCellStyleProperty(HSSFCell cell,
HSSFWorkbook workbook,
java.lang.String propertyName,
java.lang.Object propertyValue)
This method attempt to find an already existing HSSFCellStyle that matches what you want the style to be. |
static void |
setFont(HSSFCell cell,
HSSFWorkbook workbook,
HSSFFont font)
Take a cell, and apply a font to it |
static HSSFCell |
translateUnicodeValues(HSSFCell cell)
Looks for text in the cell that should be unicode, like α and provides the unicode version of it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HSSFCellUtil()
Method Detail |
---|
public static HSSFRow getRow(int rowCounter, HSSFSheet sheet)
rowCounter
- The 0 based row numbersheet
- The sheet that the row is part of.
public static HSSFCell getCell(HSSFRow row, int column)
row
- The row that the cell is part ofcolumn
- The column index that the cell is in.
public static HSSFCell createCell(HSSFRow row, int column, java.lang.String value, HSSFCellStyle 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 set
public static HSSFCell createCell(HSSFRow row, int column, java.lang.String value)
row
- the row to create the cell incolumn
- the column index to create the cell invalue
- The value of the cell
public static void setAlignment(HSSFCell cell, HSSFWorkbook workbook, short align) throws org.apache.commons.lang.exception.NestableException
cell
- the cell to set the alignment forworkbook
- The workbook that is being worked with.align
- the column alignment to use.
org.apache.commons.lang.exception.NestableException
- Thrown if an error happens.for alignment options
public static void setFont(HSSFCell cell, HSSFWorkbook workbook, HSSFFont font) throws org.apache.commons.lang.exception.NestableException
cell
- the cell to set the alignment forworkbook
- The workbook that is being worked with.font
- The HSSFFont that you want to set...
org.apache.commons.lang.exception.NestableException
- Thrown if an error happens.public static void setCellStyleProperty(HSSFCell cell, HSSFWorkbook workbook, java.lang.String propertyName, java.lang.Object propertyValue) throws org.apache.commons.lang.exception.NestableException
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 changes
org.apache.commons.lang.exception.NestableException
- Thrown if an error happens.public static HSSFCell translateUnicodeValues(HSSFCell cell)
cell
- The cell to check for unicode values
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |