01: /*
02: * Enhydra Java Application Server Project
03: *
04: * The contents of this file are subject to the Enhydra Public License
05: * Version 1.1 (the "License"); you may not use this file except in
06: * compliance with the License. You may obtain a copy of the License on
07: * the Enhydra web site ( http://www.enhydra.org/ ).
08: *
09: * Software distributed under the License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11: * the License for the specific terms governing rights and limitations
12: * under the License.
13: *
14: * The Initial Developer of the Enhydra Application Server is Lutris
15: * Technologies, Inc. The Enhydra Application Server and portions created
16: * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17: * All Rights Reserved.
18: *
19: * Contributor(s):
20: *
21: * $Id: HtmlTableDataCell.java,v 1.2 2006-06-15 13:47:00 sinisa Exp $
22: */
23:
24: package com.lutris.html;
25:
26: /**
27: * This utility class is used to compose an data cell within a
28: * row within a HTML table. Normally the entire row will be
29: * composed of either data or header cells.
30: *
31: * @see HtmlTable
32: * @see HtmlTableRow
33: * @see HtmlTableHeaderCell
34: * @author Kyle Clark
35: * @author Paul Morgan
36: * @version 1.0 (File $Revision: 1.2 $)
37: */
38: public class HtmlTableDataCell extends HtmlTableCell {
39:
40: public HtmlTableDataCell(String tdValue) {
41: super (tdValue);
42: }
43:
44: public HtmlTableDataCell(String tdValue, String defaultValue) {
45: super (tdValue, defaultValue);
46: }
47:
48: public String toString() {
49: String html = "<TD";
50: if (align != null)
51: html += " ALIGN=" + align;
52: if (valign != null)
53: html += " VALIGN=" + valign;
54: if (rowSpan > 0)
55: html += " ROWSPAN=" + rowSpan;
56: if (colSpan > 0)
57: html += " COLSPAN=" + colSpan;
58: if (bgColor != null)
59: html += " BGCOLOR=" + bgColor;
60: if (percentWidth > 0)
61: html += " WIDTH=" + percentWidth + "%";
62: html += ">";
63: html += tdValue;
64: html += "</TD>\n";
65: return html;
66: }
67: }
|