KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lutris > html > HtmlTableDataCell


1
2 /*
3  * Enhydra Java Application Server Project
4  *
5  * The contents of this file are subject to the Enhydra Public License
6  * Version 1.1 (the "License"); you may not use this file except in
7  * compliance with the License. You may obtain a copy of the License on
8  * the Enhydra web site ( http://www.enhydra.org/ ).
9  *
10  * Software distributed under the License is distributed on an "AS IS"
11  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12  * the License for the specific terms governing rights and limitations
13  * under the License.
14  *
15  * The Initial Developer of the Enhydra Application Server is Lutris
16  * Technologies, Inc. The Enhydra Application Server and portions created
17  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
18  * All Rights Reserved.
19  *
20  * Contributor(s):
21  *
22  * $Id: HtmlTableDataCell.java,v 1.2 2005/03/24 10:51:20 slobodan Exp $
23  */

24
25
26
27
28
29 package com.lutris.html;
30
31
32 /**
33  * This utility class is used to compose an data cell within a
34  * row within a HTML table. Normally the entire row will be
35  * composed of either data or header cells.
36  *
37  * @see HtmlTable
38  * @see HtmlTableRow
39  * @see HtmlTableHeaderCell
40  * @author Kyle Clark
41  * @author Paul Morgan
42  * @version 1.0 (File $Revision: 1.2 $)
43  */

44 public class HtmlTableDataCell extends HtmlTableCell {
45
46     public HtmlTableDataCell(String JavaDoc tdValue)
47     {
48     super(tdValue);
49     }
50
51     public HtmlTableDataCell(String JavaDoc tdValue, String JavaDoc defaultValue)
52     {
53     super(tdValue, defaultValue);
54     }
55
56     public String JavaDoc toString()
57     {
58         String JavaDoc html = "<TD";
59         if (align != null)
60             html += " ALIGN=" + align;
61         if (valign != null)
62             html += " VALIGN=" + valign;
63         if (rowSpan > 0)
64             html += " ROWSPAN=" + rowSpan;
65         if (colSpan > 0)
66             html += " COLSPAN=" + colSpan;
67         if (bgColor != null)
68             html += " BGCOLOR=" + bgColor;
69         if (percentWidth > 0)
70             html += " WIDTH=" + percentWidth + "%";
71         html += ">";
72     html += tdValue;
73         html += "</TD>\n";
74         return html;
75     }
76 }
77
Popular Tags