Package org.openxava.util.jxls
Class JxlsCell
- java.lang.Object
-
- org.openxava.util.jxls.JxlsCell
-
public class JxlsCell extends java.lang.Object
JxlsCell: a class to wrap and simplify the use of Apache POI Cell in the context of OpenXava Usage:JxlsWorkbook wb = new JxlsWorkbook("Test"); JxlsSheet sheet = wb.addSheet("Test"); JxlsCell cell = sheet.setValue(4, 4, 2); cell.setSpan(2, 1).setHyperLink("http://www.openxava.org"); sheet.setValue(4, 5, "Test").setSpan(3, 1);
- Author:
- Laurent Wibaux
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JxlsCell(JxlsSheet sheet, int column, int row, double f, JxlsStyle style)
protected
JxlsCell(JxlsSheet sheet, int column, int row, java.lang.String text, JxlsStyle style, boolean isFormula)
protected
JxlsCell(JxlsSheet sheet, int column, int row, java.util.Date date, JxlsStyle style)
protected
JxlsCell(JxlsSheet sheet, int column, int row, JxlsStyle style)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createPOICell(JxlsWorkbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, java.util.Map<java.lang.Integer,JxlsStyle> columnStyles)
java.lang.String
getHyperlink()
Gets the hyperlink associated with this celldouble
getNumericValue()
Get the numeric value of the celljava.lang.String
getStringValue()
Get the value of the cell as textJxlsStyle
getStyle()
java.lang.Object
getValue()
Get the object value contained in the cellstatic java.lang.String
getXlsReference(int column, int row)
JxlsCell
setHyperlink(java.lang.String hyperlink)
Sets the hyperlink associated with this cellJxlsCell
setSpan(int columnSpan, int rowSpan)
Sets the span of the cellJxlsCell
setStyle(JxlsStyle style)
Sets the style of the cell
-
-
-
Method Detail
-
getXlsReference
public static java.lang.String getXlsReference(int column, int row)
-
getValue
public java.lang.Object getValue()
Get the object value contained in the cell- Returns:
- the value
-
getNumericValue
public double getNumericValue()
Get the numeric value of the cell- Returns:
- the value whenever possible and 0 if the value is some text
-
getStringValue
public java.lang.String getStringValue()
Get the value of the cell as text- Returns:
- the value as a text
-
setSpan
public JxlsCell setSpan(int columnSpan, int rowSpan)
Sets the span of the cell- Parameters:
columnSpan
- the number of columns to occupyrowSpan
- the number of rows to occupy- Returns:
- the cell to chain other settings
-
setHyperlink
public JxlsCell setHyperlink(java.lang.String hyperlink)
Sets the hyperlink associated with this cell- Parameters:
hyperlink
- a url associated with the cell content- Returns:
- the cell to chain other settings
-
getHyperlink
public java.lang.String getHyperlink()
Gets the hyperlink associated with this cell- Returns:
- the url
-
setStyle
public JxlsCell setStyle(JxlsStyle style)
Sets the style of the cell- Parameters:
style
- the style to render the cell content- Returns:
- the cell to chain other settings
-
getStyle
public JxlsStyle getStyle()
-
createPOICell
protected void createPOICell(JxlsWorkbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, java.util.Map<java.lang.Integer,JxlsStyle> columnStyles)
-
-