01: package com.xoetrope.export.xl;
02:
03: import com.xoetrope.export.Block;
04: import com.xoetrope.export.RowBlock;
05:
06: /**
07: *
08: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
09: * the GNU Public License (GPL), please see license.txt for more details. If
10: * you make commercial use of this software you must purchase a commercial
11: * license from Xoetrope.</p>
12: * <p> $Revision: 1.5 $</p>
13: */
14: public class XLRowBlockItem extends XLBlockItem implements RowBlock {
15: public XLRowBlockItem(XLExporter exporter) {
16: super (exporter);
17: }
18:
19: public Block addCell(String cellContents, String style) {
20: return addCell(cellContents, style, 1, 1);
21: }
22:
23: public Block addCell(String cellContents, String style,
24: int colSpan, int rowSpan) {
25: xlExporter.addColumn();
26: xlExporter.skipSpanCells();
27: XLCellBlockItem cellItem = new XLCellBlockItem(xlExporter);
28: cellItem.setY(xlExporter.getRow());
29: cellItem.setX(xlExporter.getColumn());
30: cellItem.setRowSpan(rowSpan);
31: cellItem.setColSpan(colSpan);
32: cellItem.setValue(cellContents);
33: cellItem.setStyle(style);
34: blocks.add(cellItem);
35: xlExporter.addSkipCells(rowSpan - 1, colSpan - 1);
36:
37: return cellItem;
38: }
39: }
|