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

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

There is a newer version: 20240423
Show newest version
package com.hfg.html;


//------------------------------------------------------------------------------
/**
 * Represents an html (<html>) tag and also contains tag name constants.
 *
 * @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 HTML extends HTMLTag
{
   //###########################################################################
   // PUBLIC FIELDS
   //###########################################################################

   // Tag names
   public static String A            = "a";
   public static String ADDRESS      = "address";
   public static String APPLET       = "applet";
   public static String AREA         = "area";
   public static String BODY         = "body";
   public static String BR           = "br";
   public static String CENTER       = "center";
   public static String CHAR         = "char";
   public static String CHAROFF      = "charoff";
   public static String COL          = "col";
   public static String COLGROUP     = "colgroup";
   public static String DATA         = "data";
   public static String DISABLED     = "disabled";
   public static String DIV          = "div";
   public static String EM           = "em";
   public static String FORM         = "form";
   public static String FRAME        = "frame";
   public static String FRAMESET     = "frameset";
   public static String H1           = "h1";
   public static String H2           = "h2";
   public static String H3           = "h3";
   public static String HEAD         = "head";
   public static String HR           = "hr";
   public static String HTML         = "html";
   public static String IFRAME       = "iframe";
   public static String IMG          = "img";
   public static String INPUT        = "input";
   public static String LABEL        = "label";
   public static String LI           = "li";
   public static String LINK         = "link";
   public static String MAP          = "map";
   public static String META         = "meta";
   public static String NOBR         = "nobr";
   public static String OBJECT       = "object";
   public static String OL           = "ol";
   public static String OPTGROUP     = "optgroup";
   public static String OPTION       = "option";
   public static String P            = "p";
   public static String PRE          = "pre";
   public static String SCRIPT       = "script";
   public static String SELECT       = "select";
   public static String SPAN         = "span";
   public static String STYLE        = "style";
   public static String TABLE        = "table";
   public static String TBODY        = "tbody";
   public static String TD           = "td";
   public static String TEXTAREA     = "textarea";
   public static String TFOOT        = "tfoot";
   public static String TH           = "th";
   public static String THEAD        = "thead";
   public static String TITLE        = "title";
   public static String TR           = "tr";
   public static String UL           = "ul";

   // Attribute names
   public static String ACTION       = "action";
   public static String ALIGN        = "align";
   public static String ALT          = "alt";
   public static String ARCHIVE      = "archive";
   public static String BACKGROUND   = "background";
   public static String BGCOLOR      = "bgcolor";
   public static String BORDER       = "border";
   public static String CELLPADDING  = "cellpadding";
   public static String CELLSPACING  = "cellspacing";
   public static String CHARSET      = "charset";
   public static String CLASS        = "class";
   public static String CLASSID      = "classid";
   public static String CODE         = "code";
   public static String CODEBASE     = "codebase";
   public static String CODETYPE     = "codetype";
   public static String COLS         = "cols";
   public static String COLSPAN      = "colspan";
   public static String CONTENT      = "content";
   public static String COORDS       = "coords";
   public static String DECLARE      = "declare";
   public static String DEFER        = "defer";
   public static String DRAGGABLE    = "draggable"; // HTML5
   public static String ENCTYPE      = "enctype";
   public static String FOR          = "for";
   public static String FRAMEBORDER  = "frameborder";
   public static String FRAMESPACING = "framespacing";
   public static String HEIGHT       = "height";
   public static String HREF         = "href";
   public static String HSPACE       = "hspace";
   public static String HTTP_EQUIV   = "http-equiv";
   public static String ID           = "id";
   public static String LANGUAGE     = "language";
   public static String MAX_LENGTH   = "maxlength";
   public static String MAYSCRIPT    = "mayscript";
   public static String METHOD       = "method";
   public static String MULTIPLE     = "multiple";
   public static String NAME         = "name";
   public static String ONBLUR       = "onblur";
   public static String ONCHANGE     = "onchange";
   public static String ONCLICK      = "onclick";
   public static String ONDBLCLICK   = "ondblclick";
   public static String ONDRAG       = "ondrag";  // HTML5
   public static String ONDRAGEND    = "ondragend";  // HTML5
   public static String ONDRAGENTER  = "ondragenter";  // HTML5
   public static String ONDRAGLEAVE  = "ondragleave";  // HTML5
   public static String ONDRAGOVER   = "ondragover";  // HTML5
   public static String ONDRAGSTART  = "ondragstart";  // HTML5
   public static String ONDROP       = "ondrop";  // HTML5
   public static String ONFOCUS      = "onfocus";
   public static String ONKEYDOWN    = "onkeydown";
   public static String ONKEYPRESS   = "onkeypress";
   public static String ONKEYUP      = "onkeyup";
   public static String ONLOAD       = "onload";
   public static String ONMOUSEDOWN  = "onmousedown";
   public static String ONMOUSEMOVE  = "onmousemove";
   public static String ONMOUSEOVER  = "onmouseover";
   public static String ONMOUSEOUT   = "onmouseout";
   public static String ONMOUSEUP    = "onmouseup";
   public static String ONMOUSEWHEEL = "onmousewheel";  // HTML5
   public static String ONRESET      = "onreset";   // No longer supported in HTML5
   public static String ONSCROLL     = "onscroll";  // HTML5
   public static String ONSELECT     = "onselect";
   public static String ONSUBMIT     = "onsubmit";
   public static String PARAM        = "param";
   public static String REL          = "rel";
   public static String RESIZABLE    = "resizable";
   public static String ROWS         = "rows";
   public static String ROWSPAN      = "rowspan";
   public static String SCOPED       = "scoped";
   public static String SCROLLING    = "scrolling";
   public static String SHAPE        = "shape";
   public static String SIZE         = "size";
   public static String SRC          = "src";
   public static String STANDBY      = "standby";
   public static String TABINDEX     = "tabindex";
   public static String TARGET       = "target";
   public static String TYPE         = "type";
   public static String USEMAP       = "usemap";
   public static String VALIGN       = "valign";
   public static String VALUE        = "value";
   public static String VSPACE       = "vspace";
   public static String WIDTH        = "width";
   public static String WRAP         = "wrap";


   // Standard attribute values
   public static String BUTTON       = "button";
   public static String CACHE_CONTROL = "cache-control";
   public static String CHECKED      = "checked";
   public static String EXPIRES      = "expires";
   public static String FILE         = "file";
   public static String OFF          = "off";
   public static String PASSWORD     = "password";
   public static String PRAGMA       = "pragma";
   public static String REFRESH      = "refresh";
   public static String SELECTED     = "selected";
   public static String MULTIPART_FORM_DATA = "multipart/form-data";


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

   private Head     mHead;
   private Body     mBody;
   private Frameset mFrameset;


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

   //--------------------------------------------------------------------------
   public HTML()
   {
      super(HTML);
      initialize();
   }

   //--------------------------------------------------------------------------
   public HTML(String inTitle)
   {
      this();
      getHead().setTitle(inTitle);
   }

   //###########################################################################
   // PUBLIC METHODS
   //###########################################################################

   //--------------------------------------------------------------------------
   public Head getHead()
   {
      return mHead;
   }

   //--------------------------------------------------------------------------
   public Body getBody()
   {
      if (null == mBody) {
         mBody = new Body();
         addSubtag(mBody);
      }

      return mBody;
   }

   //--------------------------------------------------------------------------
   public Frameset getFrameset()
   {
      if (null == mFrameset) {
         mFrameset = new Frameset();
         addSubtag(mFrameset);
      }

      return mFrameset;
   }

   //###########################################################################
   // PRIVATE METHODS
   //###########################################################################

   //--------------------------------------------------------------------------
   // Initialization is done to ensure that the head will appear first.
   private void initialize()
   {
      mHead = new Head();
      addSubtag(mHead);
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy