com.hfg.html.IFrame 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 java.net.URL;
import com.hfg.html.attribute.Align;
import com.hfg.html.attribute.VAlign;
//------------------------------------------------------------------------------
/**
Represents an iframe (<iframe>) tag. iframe is not XHTML 1.0 Strict compliant.
@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 IFrame extends HTMLTag
{
//##########################################################################
// CONSTRUCTORS
//##########################################################################
//--------------------------------------------------------------------------
public IFrame()
{
super(HTML.IFRAME);
}
//--------------------------------------------------------------------------
public IFrame(String inSrc)
{
this();
setSrc(inSrc);
}
//--------------------------------------------------------------------------
public IFrame(URL inSrc)
{
this();
setSrc(inSrc.toString());
}
//##########################################################################
// PUBLIC METHODS
//##########################################################################
//--------------------------------------------------------------------------
public IFrame setSrc(String inValue)
{
setAttribute(HTML.SRC, inValue);
return this;
}
//--------------------------------------------------------------------------
public String getSrc()
{
return getAttributeValue(HTML.SRC);
}
//--------------------------------------------------------------------------
public IFrame setAlign(Align inValue)
{
setAttribute(inValue.getHTMLAttributeName(), inValue.toString());
return this;
}
//--------------------------------------------------------------------------
/**
Since an img align attribute allows the normally valign values of 'top'
and 'bottom', this alternate setAlign method takes a VAlign object.
@param inValue the value to use for the 'align' attribute
@return this IFrame object to enable method chaining
*/
public IFrame setAlign(VAlign inValue)
{
setAttribute(HTML.ALIGN, inValue.toString());
return this;
}
//---------------------------------------------------------------------------
public IFrame setName(String inValue)
{
setAttribute(HTML.NAME, inValue);
return this;
}
//---------------------------------------------------------------------------
public String getName()
{
return getAttributeValue(HTML.NAME);
}
//--------------------------------------------------------------------------
public IFrame setWidth(String inValue)
{
setAttribute(HTML.WIDTH, inValue);
return this;
}
//--------------------------------------------------------------------------
public IFrame setWidth(int inValue)
{
setAttribute(HTML.WIDTH, new Integer(inValue).toString());
return this;
}
//--------------------------------------------------------------------------
public String getWidth()
{
return getAttributeValue(HTML.WIDTH);
}
//--------------------------------------------------------------------------
public IFrame setHeight(String inValue)
{
setAttribute(HTML.HEIGHT, inValue);
return this;
}
//--------------------------------------------------------------------------
public IFrame setHeight(int inValue)
{
setAttribute(HTML.HEIGHT, new Integer(inValue).toString());
return this;
}
//--------------------------------------------------------------------------
public String getHeight()
{
return getAttributeValue(HTML.HEIGHT);
}
//--------------------------------------------------------------------------
public IFrame setFrameBorder(boolean inValue)
{
setAttribute(HTML.FRAMEBORDER, inValue ? 1 : 0);
return this;
}
//--------------------------------------------------------------------------
public String getFrameBorder()
{
return getAttributeValue(HTML.FRAMEBORDER);
}
//--------------------------------------------------------------------------
public IFrame setTitle(String inValue)
{
setAttribute(HTML.TITLE, inValue);
return this;
}
//--------------------------------------------------------------------------
@Override
public IFrame setId(String inValue)
{
setAttribute(HTML.ID, inValue);
return this;
}
//--------------------------------------------------------------------------
@Override
public IFrame setClass(String inValue)
{
setAttribute(HTML.CLASS, inValue);
return this;
}
//--------------------------------------------------------------------------
public IFrame setStyle(String inValue)
{
setAttribute(HTML.STYLE, inValue);
return this;
}
}