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

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

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


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

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

   //--------------------------------------------------------------------------
   public Pre()
   {
      super(HTML.PRE);
   }

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

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

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

   //--------------------------------------------------------------------------
   public Form addForm()
   {
      Form form = new Form();
      // Using addSubtag() instead of addSubtag() because content (text) in
      // the body may flow around embedded subtags.
      addSubtag(form);

      return form;
   }

   //--------------------------------------------------------------------------
   public Form addForm(String inFormName)
   {
      Form form = new Form(inFormName);
      // Using addSubtag() instead of addSubtag() because content (text) in
      // the body may flow around embedded subtags.
      addSubtag(form);

      return form;
   }

   //--------------------------------------------------------------------------
   public Table addTable()
   {
      Table table = new Table();
      // Using addSubtag() instead of addSubtag() because content (text) in
      // the body may flow around embedded subtags.
      addSubtag(table);

      return table;
   }


   //--------------------------------------------------------------------------
   public Span addSpan()
   {
      Span span = new Span();
      // Using addSubtag() instead of addSubtag() because content (text)
      // may flow around embedded subtags.
      addSubtag(span);

      return span;
   }

   //--------------------------------------------------------------------------
   public Span addSpan(String inContent)
   {
      Span span = new Span(inContent);
      // Using addSubtag() instead of addSubtag() because content (text)
      // may flow around embedded subtags.
      addSubtag(span);

      return span;
   }

   //--------------------------------------------------------------------------
   public Span addSpan(HTMLTag inContent)
   {
      Span span = new Span(inContent);
      // Using addSubtag() instead of addSubtag() because content (text)
      // may flow around embedded subtags.
      addSubtag(span);

      return span;
   }


   //--------------------------------------------------------------------------
   public Img addImage(String inSrc)
   {
      Img image = new Img(inSrc);
      // Using addSubtag() instead of addSubtag() because content (text)
      // may flow around embedded subtags.
      addSubtag(image);

      return image;
   }

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

      return link;
   }

   //--------------------------------------------------------------------------
   public Link addLink(Link inLink)
   {
      addSubtag(inLink);

      return inLink;
   }

   //--------------------------------------------------------------------------
   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 Pre br()
   {
      HTMLUtil.br(this);
      return this;
   }

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

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

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


   //--------------------------------------------------------------------------
   public Pre setClass(String inValue)
   {
      setAttribute(HTML.CLASS, inValue);

      return this;
   }

	
   // Overrides for HTMLTag setters to allow method chaining.

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

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

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

   // Overrides for HTMLTagWithCoreEvents setters to allow method chaining.

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

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

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

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

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy