com.hfg.html.InputSubmit 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;
//------------------------------------------------------------------------------
/**
* Represents a submit form element (<input type='submit'>) 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 InputSubmit extends HTMLTagWithCoreEvents
{
//##########################################################################
// PRIVATE FIELDS
//##########################################################################
//##########################################################################
// CONSTRUCTORS
//##########################################################################
//--------------------------------------------------------------------------
public InputSubmit()
{
this("Submit", "Submit");
}
//--------------------------------------------------------------------------
public InputSubmit(String inValue)
{
this("Submit", inValue);
setValue(inValue);
}
//--------------------------------------------------------------------------
public InputSubmit(String inName, String inValue)
{
super(HTML.INPUT);
setAttribute(HTML.TYPE, "submit");
setName(inName);
setValue(inValue);
}
//##########################################################################
// PUBLIC METHODS
//##########################################################################
//--------------------------------------------------------------------------
public InputSubmit setName(String inValue)
{
setAttribute(HTML.NAME, inValue);
return this;
}
//--------------------------------------------------------------------------
public String getName()
{
return getAttributeValue(HTML.NAME);
}
//--------------------------------------------------------------------------
public InputSubmit setValue(String inValue)
{
setAttribute(HTML.VALUE, inValue);
return this;
}
//--------------------------------------------------------------------------
public String getValue()
{
return getAttributeValue(HTML.VALUE);
}
//--------------------------------------------------------------------------
public InputSubmit setDisabled(boolean disabled)
{
if (disabled) {
setAttribute(HTML.DISABLED, HTML.DISABLED);
}
else {
removeAttribute(HTML.DISABLED);
}
return this;
}
//--------------------------------------------------------------------------
public boolean isDisabled()
{
return hasAttribute(HTML.DISABLED);
}
// Overrides for HTMLTag setters to allow method chaining.
//--------------------------------------------------------------------------
@Override
public InputSubmit setId(String inValue)
{
return (InputSubmit) super.setId(inValue);
}
//--------------------------------------------------------------------------
@Override
public InputSubmit setStyle(CharSequence inValue)
{
return (InputSubmit) super.setStyle(inValue);
}
//--------------------------------------------------------------------------
@Override
public InputSubmit addStyle(String inValue)
{
return (InputSubmit) super.addStyle(inValue);
}
// Overrides for HTMLTagWithCoreEvents setters to allow method chaining.
//--------------------------------------------------------------------------
@Override
public InputSubmit setOnClick(String inValue)
{
return (InputSubmit) super.setOnClick(inValue);
}
//--------------------------------------------------------------------------
@Override
public InputSubmit setOnDblClick(String inValue)
{
return (InputSubmit) super.setOnDblClick(inValue);
}
//--------------------------------------------------------------------------
@Override
public InputSubmit setOnMouseDown(String inValue)
{
return (InputSubmit) super.setOnMouseDown(inValue);
}
//--------------------------------------------------------------------------
@Override
public InputSubmit setOnMouseMove(String inValue)
{
return (InputSubmit) super.setOnMouseMove(inValue);
}
//--------------------------------------------------------------------------
@Override
public InputSubmit setOnMouseOut(String inValue)
{
return (InputSubmit) super.setOnMouseOut(inValue);
}
//--------------------------------------------------------------------------
@Override
public InputSubmit setOnMouseOver(String inValue)
{
return (InputSubmit) super.setOnMouseOver(inValue);
}
//--------------------------------------------------------------------------
@Override
public InputSubmit setOnMouseUp(String inValue)
{
return (InputSubmit) super.setOnMouseUp(inValue);
}
//--------------------------------------------------------------------------
@Override
public InputSubmit setOnKeyDown(String inValue)
{
return (InputSubmit) super.setOnKeyDown(inValue);
}
//--------------------------------------------------------------------------
@Override
public InputSubmit setOnKeyPress(String inValue)
{
return (InputSubmit) super.setOnKeyPress(inValue);
}
//--------------------------------------------------------------------------
@Override
public InputSubmit setOnKeyUp(String inValue)
{
return (InputSubmit) super.setOnKeyUp(inValue);
}
}