com.hfg.html.Colgroup 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 com.hfg.html.attribute.Align;
import com.hfg.html.attribute.VAlign;
import com.hfg.xml.XMLNode;
//------------------------------------------------------------------------------
/**
Table column group (<colgroup>) 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]
//------------------------------------------------------------------------------
//
// http://www.w3.org/TR/html401/struct/tables.html#edef-COLGROUP
//
//
//
//
//
public class Colgroup extends HTMLTag
{
//##########################################################################
// CONSTRUCTORS
//##########################################################################
//--------------------------------------------------------------------------
public Colgroup()
{
super(HTML.COLGROUP);
}
//--------------------------------------------------------------------------
public Colgroup(XMLNode inXMLNode)
{
this();
initFromXMLNode(inXMLNode);
}
//##########################################################################
// PUBLIC METHODS
//##########################################################################
//--------------------------------------------------------------------------
public Col addCol()
{
Col col = new Col();
addSubtag(col);
return col;
}
//--------------------------------------------------------------------------
public Colgroup setSpan(int inValue)
{
setAttribute(HTML.SPAN, inValue);
return this;
}
//--------------------------------------------------------------------------
public Colgroup setWidth(String inValue)
{
setAttribute(HTML.WIDTH, inValue);
return this;
}
//--------------------------------------------------------------------------
public Colgroup setAlign(Align inValue)
{
setAttribute(inValue.getHTMLAttributeName(), inValue.toString());
return this;
}
//--------------------------------------------------------------------------
public Colgroup setVAlign(VAlign inValue)
{
setAttribute(inValue.getHTMLAttributeName(), inValue.toString());
return this;
}
//--------------------------------------------------------------------------
/**
Alignment char, e.g. char=':'.
@param inValue the value to use for the 'char' attribute
@return this Col object to enable method chaining
*/
public Colgroup setChar(char inValue)
{
setAttribute(HTML.CHAR, inValue);
return this;
}
//--------------------------------------------------------------------------
/**
Offset for the alignment char.
@param inValue the value to use for the 'charoff' attribute
@return this Col object to enable method chaining
*/
public Colgroup setCharOffset(int inValue)
{
setAttribute(HTML.CHAROFF, inValue);
return this;
}
// Overrides for HTMLTag setters to allow method chaining.
//--------------------------------------------------------------------------
@Override
public Colgroup addClass(String inValue)
{
return (Colgroup) super.addClass(inValue);
}
//--------------------------------------------------------------------------
@Override
public Colgroup setClass(String inValue)
{
return (Colgroup) super.setClass(inValue);
}
//--------------------------------------------------------------------------
@Override
public Colgroup setId(String inValue)
{
return (Colgroup) super.setId(inValue);
}
//--------------------------------------------------------------------------
@Override
public Colgroup setStyle(CharSequence inValue)
{
return (Colgroup) super.setStyle(inValue);
}
//--------------------------------------------------------------------------
@Override
public Colgroup addStyle(String inValue)
{
return (Colgroup) super.addStyle(inValue);
}
}