cell.setCellValue((Date) value);
} else {
cell.setCellValue(value.toString());
}
Style style = styles[i];
if (style != null && !Style.NO_STYLE.equals(style)) {
LazyRef<Font> font = new LazyRef<Font>() {
@Override
protected Font fetch() {
return getUpdateCallback().createFont();
}
};
if (style.isBold()) {
font.get().setBoldweight(Font.BOLDWEIGHT_BOLD);
}
if (style.isItalic()) {
font.get().setItalic(true);
}
if (style.isUnderline()) {
font.get().setUnderline(Font.U_SINGLE);
}
if (style.getFontSize() != null) {
Integer fontSize = style.getFontSize();
SizeUnit sizeUnit = style.getFontSizeUnit();
if (sizeUnit == SizeUnit.PERCENT) {
fontSize = convertFontPercentageToPt(fontSize);
}
font.get().setFontHeightInPoints(fontSize.shortValue());
}
Color foregroundColor = style.getForegroundColor();
if (foregroundColor != null) {
short index = getUpdateCallback().getColorIndex(
foregroundColor);
font.get().setColor(index);
}
if (font.isFetched()) {
cellStyle.get().setFont(font.get());
}
if (style.getAlignment() != null) {
cellStyle.get().setAlignment(
getAlignment(style.getAlignment()));
}
final Color backgroundColor = style.getBackgroundColor();
if (backgroundColor != null) {
cellStyle.get().setFillPattern(
CellStyle.SOLID_FOREGROUND);
cellStyle.get().setFillForegroundColor(
getUpdateCallback().getColorIndex(