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

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

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


//------------------------------------------------------------------------------
/**
 * Represents a span (<span>) 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 Span extends HTMLTagWithCoreEvents
{

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


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

   //--------------------------------------------------------------------------
   public Span()
   {
      super(HTML.SPAN);
   }

   //--------------------------------------------------------------------------
   public Span(String inContent)
   {
      this();
      addContent(inContent);
   }

   //--------------------------------------------------------------------------
   public Span(HTMLTag inContent)
   {
      this();
      addSubtag(inContent);
   }

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


   //--------------------------------------------------------------------------
   public Center addCenter()
   {
      Center center = new Center();
      addSubtag(center);

      return center;
   }

   //--------------------------------------------------------------------------
   public Center addCenter(String inContent)
   {
      Center center = new Center(inContent);
      addSubtag(center);

      return center;
   }

   //--------------------------------------------------------------------------
   public Center addCenter(HTMLTag inContent)
   {
      Center center = new Center(inContent);
      addSubtag(center);

      return center;
   }

   //--------------------------------------------------------------------------
   public Form addForm()
   {
      Form form = new Form();
      addSubtag(form);

      return form;
   }

   //--------------------------------------------------------------------------
   public Form addForm(String inFormName)
   {
      Form form = new Form(inFormName);
      addSubtag(form);

      return form;
   }


   //--------------------------------------------------------------------------
   public Img addImage(String inSrc)
   {
      Img image = new Img(inSrc);
      addSubtag(image);

      return image;
   }

   //--------------------------------------------------------------------------
   public Link addLink()
   {
      Link link = new Link();
      addSubtag(link);

      return link;
   }

   //--------------------------------------------------------------------------
   public Link addLink(CharSequence inURL)
   {
      Link link = new Link(inURL);
      addSubtag(link);

      return link;
   }

   //--------------------------------------------------------------------------
   public Link addLink(CharSequence inURL, String inContent)
   {
      Link link = new Link(inURL, inContent);
      addSubtag(link);

      return link;
   }

   //--------------------------------------------------------------------------
   public Link addLink(CharSequence inURL, HTMLTag inContent)
   {
      Link link = new Link(inURL, inContent);
      addSubtag(link);

      return link;
   }

   //--------------------------------------------------------------------------
   public Nobr addNobr()
   {
      Nobr nobr = new Nobr();
      addSubtag(nobr);

      return nobr;
   }

   //--------------------------------------------------------------------------
   public Nobr addNobr(String inContent)
   {
      Nobr nobr = new Nobr(inContent);
      addSubtag(nobr);

      return nobr;
   }

   //--------------------------------------------------------------------------
   public Nobr addNobr(HTMLTag inContent)
   {
      Nobr nobr = new Nobr(inContent);
      addSubtag(nobr);

      return nobr;
   }


   //--------------------------------------------------------------------------
   public Pre addPre()
   {
       Pre pre = new Pre();
       addSubtag(pre);

       return pre;
   }

   //--------------------------------------------------------------------------
   public Pre addPre(String inContent)
   {
       Pre pre = new Pre(inContent);
       addSubtag(pre);

       return pre;
   }

   //--------------------------------------------------------------------------
   public Pre addPre(HTMLTag inContent)
   {
       Pre pre = new Pre(inContent);
       addSubtag(pre);

       return pre;
   }

   //--------------------------------------------------------------------------
   public Select addSelect(String inName)
   {
      Select select = new Select(inName);
      addSubtag(select);

      return select;
   }

   //--------------------------------------------------------------------------
   public Span addSpan()
   {
      Span span = new Span();
      addSubtag(span);

      return span;
   }

   //--------------------------------------------------------------------------
   public Span addSpan(String inContent)
   {
      Span span = new Span(inContent);
      addSubtag(span);

      return span;
   }

   //--------------------------------------------------------------------------
   public Table addTable()
   {
      Table table = new Table();
      addSubtag(table);

      return table;
   }

   //--------------------------------------------------------------------------
   public Ul addUnorderedList()
   {
      Ul ul = new Ul();
      addSubtag(ul);

      return ul;
   }

   //--------------------------------------------------------------------------
   public InputCheckbox addCheckbox(String inName, String inValue)
   {
      InputCheckbox checkbox = new InputCheckbox(inName, inValue);
      addSubtag(checkbox);

      return checkbox;
   }

   //--------------------------------------------------------------------------
   public InputCheckbox addCheckbox(String inName, String inValue, boolean checked)
   {
      InputCheckbox checkbox = new InputCheckbox(inName, inValue, checked);
      addSubtag(checkbox);

      return checkbox;
   }

   //--------------------------------------------------------------------------
   public InputRadio addRadio(String inName, String inValue)
   {
      InputRadio radio = new InputRadio(inName, inValue);
      addSubtag(radio);

      return radio;
   }

   //--------------------------------------------------------------------------
   public InputRadio addRadio(String inName, String inValue, boolean checked)
   {
      InputRadio radio = new InputRadio(inName, inValue, checked);
      addSubtag(radio);

      return radio;
   }

   //--------------------------------------------------------------------------
   public Script addScript()
   {
      Script script = new Script();
      addSubtag(script);

      return script;
   }

   //--------------------------------------------------------------------------
   @Override
   public Span appendToOnMouseOut(String inValue)
   {
      return (Span) super.appendToOnMouseOut(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span appendToOnMouseOver(String inValue)
   {
      return (Span) super.appendToOnMouseOver(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span appendToOnClick(String inValue)
   {
      return (Span) super.appendToOnClick(inValue);
   }

   //--------------------------------------------------------------------------
   public Span setTitle(String inValue)
   {
      setAttribute(HTML.TITLE, inValue);
      return this;
   }

   //--------------------------------------------------------------------------
   public String getTitle()
   {
      return getAttributeValue(HTML.TITLE);
   }


   //--------------------------------------------------------------------------
   public Span br()
   {
      HTMLUtil.br(this);
      return this;
   }

   //--------------------------------------------------------------------------
   public Span br(int inNumber)
   {
      HTMLUtil.br(this, inNumber);
      return this;
   }

   //--------------------------------------------------------------------------
   public Span nbsp(int inNumber)
   {
      HTMLUtil.nbsp(this, inNumber);
      return this;
   }

   //--------------------------------------------------------------------------
   public void hr()
   {
      HTMLUtil.hr(this);
   }

   //--------------------------------------------------------------------------
   public void hr(String inWidth)
   {
      HTMLUtil.hr(this, inWidth);
   }

   // Overrides for HTMLTag setters to allow method chaining.

   //--------------------------------------------------------------------------
   @Override
   public Span addClass(String inValue)
   {
      return (Span) super.addClass(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span setClass(String inValue)
   {
      return (Span) super.setClass(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span setId(String inValue)
   {
      return (Span) super.setId(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span setStyle(CharSequence inValue)
   {
      return (Span) super.setStyle(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span addStyle(String inValue)
   {
      return (Span) super.addStyle(inValue);
   }


   //--------------------------------------------------------------------------
   @Override
   public Span setDraggable(boolean inValue)
   {
      return (Span) super.setDraggable(inValue);
   }

   // Overrides for HTMLTagWithCoreEvents setters to allow method chaining.

   //--------------------------------------------------------------------------
   @Override
   public Span setOnClick(String inValue)
   {
      return (Span) super.setOnClick(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span setOnDblClick(String inValue)
   {
      return (Span) super.setOnDblClick(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span setOnMouseDown(String inValue)
   {
      return (Span) super.setOnMouseDown(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span setOnMouseMove(String inValue)
   {
      return (Span) super.setOnMouseMove(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span setOnMouseOut(String inValue)
   {
      return (Span) super.setOnMouseOut(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span setOnMouseOver(String inValue)
   {
      return (Span) super.setOnMouseOver(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span setOnMouseUp(String inValue)
   {
      return (Span) super.setOnMouseUp(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span setOnKeyDown(String inValue)
   {
      return (Span) super.setOnKeyDown(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span setOnKeyPress(String inValue)
   {
      return (Span) super.setOnKeyPress(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Span setOnKeyUp(String inValue)
   {
      return (Span) super.setOnKeyUp(inValue);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy