HtmlTableDataCell.java :  » J2EE » Enhydra-Application-Framework » com » lutris » html » Java Open Source

Java Open Source » J2EE » Enhydra Application Framework 
Enhydra Application Framework » com » lutris » html » HtmlTableDataCell.java

/*
 * Enhydra Java Application Server Project
 * 
 * The contents of this file are subject to the Enhydra Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License on
 * the Enhydra web site ( http://www.enhydra.org/ ).
 * 
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 
 * the License for the specific terms governing rights and limitations
 * under the License.
 * 
 * The Initial Developer of the Enhydra Application Server is Lutris
 * Technologies, Inc. The Enhydra Application Server and portions created
 * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
 * All Rights Reserved.
 * 
 * Contributor(s):
 * 
 * $Id: HtmlTableDataCell.java,v 1.2 2006-06-15 13:47:00 sinisa Exp $
 */





package com.lutris.html;


/**
 * This utility class is used to compose an data cell within a
 * row within a HTML table. Normally the entire row will be
 * composed of either data or header cells.
 *
 * @see HtmlTable
 * @see HtmlTableRow
 * @see HtmlTableHeaderCell
 * @author Kyle Clark
 * @author Paul Morgan
 * @version 1.0 (File $Revision: 1.2 $)
 */
public class HtmlTableDataCell extends HtmlTableCell {

    public HtmlTableDataCell(String tdValue)
    {
  super(tdValue);
    }

    public HtmlTableDataCell(String tdValue, String defaultValue)
    {
  super(tdValue, defaultValue);
    }

    public String toString()
    {
        String html = "<TD";
        if (align != null)
            html += " ALIGN=" + align;
        if (valign != null)
            html += " VALIGN=" + valign;
        if (rowSpan > 0)
            html += " ROWSPAN=" + rowSpan;
        if (colSpan > 0)
            html += " COLSPAN=" + colSpan;
        if (bgColor != null)
            html += " BGCOLOR=" + bgColor;
        if (percentWidth > 0) 
            html += " WIDTH=" + percentWidth + "%";
        html += ">";
  html += tdValue;
        html += "</TD>\n";
        return html;
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.