All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hfg.html.THead Maven / Gradle / Ivy

There is a newer version: 20240423
Show newest version
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 header (<thead>) 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 THead extends HTMLTag
{

   //##########################################################################
   // PRIVATE FIELDS
   //##########################################################################


   //##########################################################################
   // CONSTRUCTORS
   //##########################################################################

   //--------------------------------------------------------------------------
   public THead()
   {
      super(HTML.THEAD);
   }

   //--------------------------------------------------------------------------
   public THead(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 THead setOnClick(String inValue)
   {
      setAttribute(HTML.ONCLICK, inValue);
      return this;
   }

   //--------------------------------------------------------------------------
   @Override
   public THead setClass(String inValue)
   {
      setAttribute(HTML.CLASS, inValue);
      return this;
   }


   //--------------------------------------------------------------------------
   @Override
   public THead setId(String inValue)
   {
      setAttribute(HTML.ID, inValue);
      return this;
   }

   //--------------------------------------------------------------------------
   @Override
   public THead setStyle(CharSequence inValue)
   {
      setAttribute(HTML.STYLE, inValue);
      return this;
   }

   //--------------------------------------------------------------------------
   @Override
   public THead addStyle(String inValue)
   {
      CssUtil.addStyle(this, inValue);
      return this;
   }

   //--------------------------------------------------------------------------
   public THead setAlign(Align inValue)
   {
      setAttribute(inValue.getHTMLAttributeName(), inValue.toString());
      return this;
   }

   //--------------------------------------------------------------------------
   public THead setVAlign(VAlign inValue)
   {
      setAttribute(inValue.getHTMLAttributeName(), inValue.toString());
      return this;
   }

   //--------------------------------------------------------------------------
   /**
    Alignment char, e.g. char=':'.
    */
   public THead setChar(char inValue)
   {
      setAttribute(HTML.CHAR, inValue);
      return this;
   }

   //--------------------------------------------------------------------------
   /**
    Offset for the alignment char.
    */
   public THead setCharOffset(int inValue)
   {
      setAttribute(HTML.CHAROFF, inValue);
      return this;
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy