com.hfg.html.P 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.xml.XMLNode;
//------------------------------------------------------------------------------
/**
* Represents a paragraph (<p>) 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 P extends HTMLTagWithCoreEvents
{
//##########################################################################
// CONSTRUCTORS
//##########################################################################
//--------------------------------------------------------------------------
public P()
{
super(HTML.P);
}
//--------------------------------------------------------------------------
public P(String inContent)
{
this();
addContent(inContent);
}
//--------------------------------------------------------------------------
public P(HTMLTag inContent)
{
this();
addSubtag(inContent);
}
//--------------------------------------------------------------------------
public P(XMLNode inXMLNode)
{
this();
initFromXMLNode(inXMLNode);
}
//##########################################################################
// 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 Div addDiv()
{
Div div = new Div();
addSubtag(div);
return div;
}
//--------------------------------------------------------------------------
public Div addDiv(HTMLTag inContent)
{
Div div = new Div(inContent);
addSubtag(div);
return div;
}
//--------------------------------------------------------------------------
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 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 Span addSpan(HTMLTag 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 InputButton addButton(String inName, String inValue)
{
InputButton button = new InputButton(inName, inValue);
addSubtag(button);
return button;
}
//--------------------------------------------------------------------------
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 InputFile addFileInput()
{
InputFile subtag = new InputFile();
addSubtag(subtag);
return subtag;
}
//--------------------------------------------------------------------------
public InputFile addFileInput(String inName)
{
InputFile subtag = new InputFile(inName);
addSubtag(subtag);
return subtag;
}
//--------------------------------------------------------------------------
public InputFile addFileInput(String inName, String inValue)
{
InputFile subtag = new InputFile(inName, inValue);
addSubtag(subtag);
return subtag;
}
//--------------------------------------------------------------------------
public InputPassword addPasswordInput()
{
InputPassword password = new InputPassword();
addSubtag(password);
return password;
}
//--------------------------------------------------------------------------
public InputPassword addPasswordInput(String inName, String inValue)
{
InputPassword password = new InputPassword(inName, inValue);
addSubtag(password);
return password;
}
//--------------------------------------------------------------------------
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 InputReset addReset()
{
InputReset reset = new InputReset();
addSubtag(reset);
return reset;
}
//--------------------------------------------------------------------------
public Select addSelect(String inName)
{
Select select = new Select(inName);
addSubtag(select);
return select;
}
//--------------------------------------------------------------------------
public InputSubmit addSubmit(String inName, String inValue)
{
InputSubmit submit = new InputSubmit(inName, inValue);
addSubtag(submit);
return submit;
}
//--------------------------------------------------------------------------
public Textarea addTextarea(String inName, String inValue)
{
Textarea textarea = new Textarea(inName, inValue);
addSubtag(textarea);
return textarea;
}
//--------------------------------------------------------------------------
public Textarea addTextarea(String inName, String inValue, int inRows, int inCols)
{
Textarea textarea = new Textarea(inName, inValue, inRows, inCols);
addSubtag(textarea);
return textarea;
}
//--------------------------------------------------------------------------
public InputText addTextInput()
{
InputText text = new InputText();
addSubtag(text);
return text;
}
//--------------------------------------------------------------------------
public InputText addTextInput(String inName, String inValue)
{
InputText text = new InputText(inName, inValue);
addSubtag(text);
return text;
}
//--------------------------------------------------------------------------
public P setAlign(Align inValue)
{
setAttribute(inValue.getHTMLAttributeName(), inValue.toString());
return this;
}
//--------------------------------------------------------------------------
public P setClass(String inValue)
{
setAttribute(HTML.CLASS, inValue);
return this;
}
//--------------------------------------------------------------------------
public void br()
{
HTMLUtil.br(this);
}
//--------------------------------------------------------------------------
public void br(int inNumber)
{
HTMLUtil.br(this, inNumber);
}
//--------------------------------------------------------------------------
public void nbsp(int inNumber)
{
HTMLUtil.nbsp(this, inNumber);
}
//--------------------------------------------------------------------------
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 P setId(String inValue)
{
return (P) super.setId(inValue);
}
//--------------------------------------------------------------------------
@Override
public P setStyle(CharSequence inValue)
{
return (P) super.setStyle(inValue);
}
//--------------------------------------------------------------------------
@Override
public P addStyle(String inValue)
{
return (P) super.addStyle(inValue);
}
// Overrides for HTMLTagWithCoreEvents setters to allow method chaining.
//--------------------------------------------------------------------------
@Override
public P setOnClick(String inValue)
{
return (P) super.setOnClick(inValue);
}
//--------------------------------------------------------------------------
@Override
public P setOnDblClick(String inValue)
{
return (P) super.setOnDblClick(inValue);
}
//--------------------------------------------------------------------------
@Override
public P setOnMouseDown(String inValue)
{
return (P) super.setOnMouseDown(inValue);
}
//--------------------------------------------------------------------------
@Override
public P setOnMouseMove(String inValue)
{
return (P) super.setOnMouseMove(inValue);
}
//--------------------------------------------------------------------------
@Override
public P setOnMouseOut(String inValue)
{
return (P) super.setOnMouseOut(inValue);
}
//--------------------------------------------------------------------------
@Override
public P setOnMouseOver(String inValue)
{
return (P) super.setOnMouseOver(inValue);
}
//--------------------------------------------------------------------------
@Override
public P setOnMouseUp(String inValue)
{
return (P) super.setOnMouseUp(inValue);
}
//--------------------------------------------------------------------------
@Override
public P setOnKeyDown(String inValue)
{
return (P) super.setOnKeyDown(inValue);
}
//--------------------------------------------------------------------------
@Override
public P setOnKeyPress(String inValue)
{
return (P) super.setOnKeyPress(inValue);
}
//--------------------------------------------------------------------------
@Override
public P setOnKeyUp(String inValue)
{
return (P) super.setOnKeyUp(inValue);
}
}