01: package com.xoetrope.export.html;
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 HTMLRowBlockItem extends HTMLBlockItem implements RowBlock {
15:
16: public HTMLRowBlockItem() {
17: setTag("TR");
18: }
19:
20: public Block addCell(String cellContents, String style) {
21: return addCell(cellContents, style, 1, 1);
22: }
23:
24: public Block addCell(String cellContents, String style,
25: int colSpan, int rowSpan) {
26: String span = "";
27: if (colSpan > 1)
28: span += "COLSPAN=\"" + String.valueOf(colSpan) + "\"";
29: if (rowSpan > 1)
30: span += "ROWSPAN=\"" + String.valueOf(rowSpan) + "\"";
31:
32: HTMLCellBlockItem cellItem = new HTMLCellBlockItem();
33: cellItem.setTag("TD");
34: cellItem.setValue(cellContents);
35: cellItem.setStyle(style);
36: cellItem.setTagAttribs(span);
37:
38: blocks.add(cellItem);
39: return cellItem;
40: }
41:
42: }
|