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

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

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

import com.hfg.xml.XMLNode;

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

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


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

    //--------------------------------------------------------------------------
    public Section()
    {
        super(HTML.SECTION);
    }

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

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

    //--------------------------------------------------------------------------
    public Section(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(CharSequence 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 InputText addTextInput()
    {
        InputText text = new InputText();
        addSubtag(text);

        return text;
    }

    //--------------------------------------------------------------------------
    public InputText addTextInput(String inName, String inValue)
    {
        InputText input = new InputText(inName, inValue);
        addSubtag(input);

        return input;
    }


    //--------------------------------------------------------------------------
    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 Section appendToOnMouseOut(String inValue)
    {
        return (Section) super.appendToOnMouseOut(inValue);
    }

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

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

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

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


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

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

    //--------------------------------------------------------------------------
    public Section 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 Section addClass(String inValue)
    {
        return (Section) super.addClass(inValue);
    }

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

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

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

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


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

    // Overrides for HTMLTagWithCoreEvents setters to allow method chaining.

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

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

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

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

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy