com.hfg.html.TBody Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com_hfg Show documentation
Show all versions of com_hfg Show documentation
com.hfg xml, html, svg, and bioinformatics utility library
package com.hfg.html;
import java.util.List;
import com.hfg.html.attribute.Align;
import com.hfg.html.attribute.VAlign;
import com.hfg.css.CssUtil;
import com.hfg.xml.XMLNode;
//------------------------------------------------------------------------------
/**
* Represents a table body (<tbody>) tag.
*
* @author J. Alex Taylor, hairyfatguy.com
*/
//------------------------------------------------------------------------------
// com.hfg XML/HTML Coding Library
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
// [email protected]
//------------------------------------------------------------------------------
public class TBody extends HTMLTag
{
//##########################################################################
// PRIVATE FIELDS
//##########################################################################
//##########################################################################
// CONSTRUCTORS
//##########################################################################
//--------------------------------------------------------------------------
public TBody()
{
super(HTML.TBODY);
}
//--------------------------------------------------------------------------
public TBody(XMLNode inXMLNode)
{
this();
initFromXMLNode(inXMLNode);
}
//##########################################################################
// PUBLIC METHODS
//##########################################################################
//--------------------------------------------------------------------------
public Tr addRow()
{
Tr tr = new Tr();
addSubtag(tr);
return tr;
}
//--------------------------------------------------------------------------
public void addRow(Tr inRow)
{
addSubtag(inRow);
}
//--------------------------------------------------------------------------
public List getRows()
{
return (List ) (Object) getSubtagsByName(HTML.TR);
}
//---------------------------------------------------------------------------
public TBody setOnClick(String inValue)
{
setAttribute(HTML.ONCLICK, inValue);
return this;
}
//--------------------------------------------------------------------------
@Override
public TBody setClass(String inValue)
{
setAttribute(HTML.CLASS, inValue);
return this;
}
//--------------------------------------------------------------------------
@Override
public TBody setId(String inValue)
{
setAttribute(HTML.ID, inValue);
return this;
}
//--------------------------------------------------------------------------
@Override
public TBody setStyle(CharSequence inValue)
{
setAttribute(HTML.STYLE, inValue);
return this;
}
//--------------------------------------------------------------------------
@Override
public TBody addStyle(String inValue)
{
CssUtil.addStyle(this, inValue);
return this;
}
//--------------------------------------------------------------------------
public TBody setAlign(Align inValue)
{
setAttribute(inValue.getHTMLAttributeName(), inValue.toString());
return this;
}
//--------------------------------------------------------------------------
public TBody setVAlign(VAlign inValue)
{
setAttribute(inValue.getHTMLAttributeName(), inValue.toString());
return this;
}
//--------------------------------------------------------------------------
/**
Alignment char, e.g. char=':'.
*/
public TBody setChar(char inValue)
{
setAttribute(HTML.CHAR, inValue);
return this;
}
//--------------------------------------------------------------------------
/**
Offset for the alignment char.
*/
public TBody setCharOffset(int inValue)
{
setAttribute(HTML.CHAROFF, inValue);
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy