com.hfg.html.Div 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;
//------------------------------------------------------------------------------
/**
* Represents a div (<div>) 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 Div extends HTMLTagWithCoreEvents
{
//##########################################################################
// CONSTRUCTORS
//##########################################################################
//--------------------------------------------------------------------------
public Div()
{
super(HTML.DIV);
}
//--------------------------------------------------------------------------
public Div(String inContent)
{
this();
addContent(inContent);
}
//--------------------------------------------------------------------------
public Div(HTMLTag inContent)
{
this();
addSubtag(inContent);
}
//--------------------------------------------------------------------------
public Div(String inContent, Align inAlign)
{
this(inContent);
setAlign(inAlign);
}
//--------------------------------------------------------------------------
public Div(HTMLTag inContent, Align inAlign)
{
this(inContent);
setAlign(inAlign);
}
//##########################################################################
// 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(String inContent)
{
Div div = new Div(inContent);
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()
{
InputButton button = new InputButton();
addSubtag(button);
return button;
}
//--------------------------------------------------------------------------
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 Label addLabel()
{
Label label = new Label();
addSubtag(label);
return label;
}
//--------------------------------------------------------------------------
public Label addLabel(String inValue)
{
Label label = new Label(inValue);
addSubtag(label);
return label;
}
//--------------------------------------------------------------------------
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()
{
InputSubmit submit = new InputSubmit();
addSubtag(submit);
return submit;
}
//--------------------------------------------------------------------------
public InputSubmit addSubmit(String inName, String inValue)
{
InputSubmit submit = new InputSubmit(inName, inValue);
addSubtag(submit);
return submit;
}
//--------------------------------------------------------------------------
public Script addScript()
{
Script script = new Script();
addSubtag(script);
return script;
}
//--------------------------------------------------------------------------
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 Div setAlign(Align inValue)
{
setAttribute(inValue.getHTMLAttributeName(), inValue.toString());
return this;
}
//--------------------------------------------------------------------------
public Div setTitle(String inValue)
{
setAttribute(HTML.TITLE, inValue);
return this;
}
//--------------------------------------------------------------------------
public String getTitle()
{
return getAttributeValue(HTML.TITLE);
}
//--------------------------------------------------------------------------
public Div br()
{
HTMLUtil.br(this);
return this;
}
//--------------------------------------------------------------------------
public Div br(int inNumber)
{
HTMLUtil.br(this, inNumber);
return this;
}
//--------------------------------------------------------------------------
public void nbsp(int inNumber)
{
HTMLUtil.nbsp(this, inNumber);
}
//--------------------------------------------------------------------------
public Hr hr()
{
return HTMLUtil.hr(this);
}
//--------------------------------------------------------------------------
public Hr hr(String inWidth)
{
return HTMLUtil.hr(this, inWidth);
}
// Overrides for HTMLTag setters to allow method chaining.
//--------------------------------------------------------------------------
@Override
public Div addClass(String inValue)
{
return (Div) super.addClass(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div setClass(String inValue)
{
return (Div) super.setClass(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div setId(String inValue)
{
return (Div) super.setId(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div setStyle(CharSequence inValue)
{
return (Div) super.setStyle(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div addStyle(String inValue)
{
return (Div) super.addStyle(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div setDraggable(boolean inValue)
{
return (Div) super.setDraggable(inValue);
}
// Overrides for HTMLTagWithCoreEvents setters to allow method chaining.
//--------------------------------------------------------------------------
@Override
public Div setOnClick(String inValue)
{
return (Div) super.setOnClick(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div setOnDblClick(String inValue)
{
return (Div) super.setOnDblClick(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div setOnMouseDown(String inValue)
{
return (Div) super.setOnMouseDown(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div setOnMouseMove(String inValue)
{
return (Div) super.setOnMouseMove(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div setOnMouseOut(String inValue)
{
return (Div) super.setOnMouseOut(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div setOnMouseOver(String inValue)
{
return (Div) super.setOnMouseOver(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div setOnMouseUp(String inValue)
{
return (Div) super.setOnMouseUp(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div setOnKeyDown(String inValue)
{
return (Div) super.setOnKeyDown(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div setOnKeyPress(String inValue)
{
return (Div) super.setOnKeyPress(inValue);
}
//--------------------------------------------------------------------------
@Override
public Div setOnKeyUp(String inValue)
{
return (Div) super.setOnKeyUp(inValue);
}
}