| java.lang.Object org.apache.poi.hssf.usermodel.contrib.HSSFCellUtil
HSSFCellUtil | public class HSSFCellUtil (Code) | | 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.
author: Eric Pugh epugh@upstate.com |
Method Summary | |
public static HSSFCell | createCell(HSSFRow row, int column, String value, HSSFCellStyle style) | public static HSSFCell | createCell(HSSFRow row, int column, String value) Create a cell, and give it a value. | public static HSSFCell | getCell(HSSFRow row, int column) Get a specific cell from a row. | public static HSSFRow | getRow(int rowCounter, HSSFSheet sheet) Get a row from the spreadsheet, and create it if it doesn't exist.
Parameters: rowCounter - The 0 based row number Parameters: sheet - The sheet that the row is part of. | public static void | setAlignment(HSSFCell cell, HSSFWorkbook workbook, short align) Take a cell, and align it. | public static void | setCellStyleProperty(HSSFCell cell, HSSFWorkbook workbook, String propertyName, Object propertyValue) This method attempt to find an already existing HSSFCellStyle that matches
what you want the style to be. | public static void | setFont(HSSFCell cell, HSSFWorkbook workbook, HSSFFont font) | public static HSSFCell | translateUnicodeValues(HSSFCell cell) Looks for text in the cell that should be unicode, like α and provides the
unicode version of it. |
createCell | public static HSSFCell createCell(HSSFRow row, int column, String value, HSSFCellStyle style)(Code) | | Creates a cell, gives it a value, and applies a style if provided
Parameters: row - the row to create the cell in Parameters: column - the column index to create the cell in Parameters: value - The value of the cell Parameters: style - If the style is not null, then set A new HSSFCell |
createCell | public static HSSFCell createCell(HSSFRow row, int column, String value)(Code) | | Create a cell, and give it a value.
Parameters: row - the row to create the cell in Parameters: column - the column index to create the cell in Parameters: value - The value of the cell A new HSSFCell. |
getCell | public static HSSFCell getCell(HSSFRow row, int column)(Code) | | Get a specific cell from a row. If the cell doesn't exist, then create it.
Parameters: row - The row that the cell is part of Parameters: column - The column index that the cell is in. The cell indicated by the column. |
getRow | public static HSSFRow getRow(int rowCounter, HSSFSheet sheet)(Code) | | Get a row from the spreadsheet, and create it if it doesn't exist.
Parameters: rowCounter - The 0 based row number Parameters: sheet - The sheet that the row is part of. The row indicated by the rowCounter |
setAlignment | public static void setAlignment(HSSFCell cell, HSSFWorkbook workbook, short align) throws NestableException(Code) | | Take a cell, and align it.
Parameters: cell - the cell to set the alignment for Parameters: workbook - The workbook that is being worked with. Parameters: align - the column alignment to use. exception: NestableException - Thrown if an error happens. See Also: HSSFCellStyle See Also: for alignment options |
setCellStyleProperty | public static void setCellStyleProperty(HSSFCell cell, HSSFWorkbook workbook, String propertyName, Object propertyValue) throws NestableException(Code) | | This method attempt to find an already existing HSSFCellStyle that matches
what you want the style to be. If it does not find the style, then it
creates a new one. If it does create a new one, then it applyies the
propertyName and propertyValue to the style. This is nessasary because
Excel has an upper limit on the number of Styles that it supports.
Parameters: workbook - The workbook that is being worked with. Parameters: propertyName - The name of the property that is to bechanged. Parameters: propertyValue - The value of the property that is to bechanged. Parameters: cell - The cell that needs it's style changes exception: NestableException - Thrown if an error happens. |
setFont | public static void setFont(HSSFCell cell, HSSFWorkbook workbook, HSSFFont font) throws NestableException(Code) | | Take a cell, and apply a font to it
Parameters: cell - the cell to set the alignment for Parameters: workbook - The workbook that is being worked with. Parameters: font - The HSSFFont that you want to set... exception: NestableException - Thrown if an error happens. |
translateUnicodeValues | public static HSSFCell translateUnicodeValues(HSSFCell cell)(Code) | | Looks for text in the cell that should be unicode, like α and provides the
unicode version of it.
Parameters: cell - The cell to check for unicode values transalted to unicode |
|
|