final int row,
final int col,
final FastGridLayout.GridCell gridCell,
final ReportElement content)
{
StyleBuilder styleBuilder = getStyleBuilder();
DefaultStyleBuilderFactory styleBuilderFactory = getStyleBuilderFactory();
FastHtmlStyleCache.CellStyle cellStyleCache = styleCache.getCellAttributes(row, col);
if (cellStyleCache == null)
{
final CellBackground realBackground = gridCell.getLayoutInfo().getBackground();
final int colSpan = gridCell.getLayoutInfo().getColumnSpan();
final int rowSpan = gridCell.getLayoutInfo().getRowSpan();
if (content == null)
{
final StyleBuilder cellStyle = styleBuilderFactory.createCellStyle(styleBuilder, realBackground, null, null);
final AttributeList cellAttributes = getTagHelper().createCellAttributes
(colSpan, rowSpan, null, null, realBackground, cellStyle);
cellStyleCache = new FastHtmlStyleCache.CellStyle(cellAttributes, cellStyle.toArray());
}
else
{
BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(content.getComputedStyle());
final StyleBuilder cellStyle = styleBuilderFactory.createCellStyle(styleBuilder,
content.getComputedStyle(), boxDefinition, realBackground, null, null);
final AttributeList cellAttributes = getTagHelper().createCellAttributes
(colSpan, rowSpan, content.getAttributes(), content.getComputedStyle(), realBackground, cellStyle);
cellStyleCache = new FastHtmlStyleCache.CellStyle(cellAttributes, cellStyle.toArray());
}
styleCache.putCellAttributes(row, col, cellStyleCache);
}
return cellStyleCache;
}