com.raj.htmlForms
Class HtmlImageButton

java.lang.Object
  |
  +--com.raj.htmlForms.HtmlFormElement
        |
        +--com.raj.htmlForms.HtmlInput
              |
              +--com.raj.htmlForms.HtmlButtons
                    |
                    +--com.raj.htmlForms.HtmlImageButton

public class HtmlImageButton
extends HtmlButtons

This class represents the <input type="image"> HTML button.

This class (HtmlImageButton.java) is part of the com.raj.htmlForms package that automatically generates HTML forms programmatically.

CREATED 26-FEB-2002, Copyright (c) Rajnish Bhaskar 2002

Author:
Rajnish Bhaskar

Field Summary
 
Fields inherited from class com.raj.htmlForms.HtmlFormElement
isXHTML, out
 
Constructor Summary
HtmlImageButton(java.io.Writer w)
          Minimal constructor for any form element.
HtmlImageButton(java.io.Writer w, boolean x, java.lang.String n)
          Constructor that sets the writer and name and a boolean which determines whether or not XHTML will be written
HtmlImageButton(java.io.Writer w, java.lang.String n)
          Constructor that sets the name of the image button
HtmlImageButton(java.io.Writer w, java.lang.String n, java.lang.String s)
          Constructor that sets the name and text of the reset button
 
Method Summary
 java.lang.String getAlign()
          gets the src of this input element
 java.lang.String getAlt()
          gets the alternate text of this input element
 java.lang.String getIsmap()
          if this object is a server side imagemap, this is returned, else the empty string
 java.lang.String getSrc()
          gets the src of this input element
 java.lang.String getUsemap()
          gets the name of an imagemap that applies to this input element
 void reset()
          resets all attributes of the element back to a blank state
 void setAlign(java.lang.String x)
          sets the alignment of this input element
 void setAlt(java.lang.String x)
          sets the alternate text of this input element
 void setIsmap(boolean x)
          tells the server that this image is an imagemap
 void setSrc(java.lang.String x)
          sets the src of this input element
 void setUsemap(java.lang.String x)
          sets the name of an imagemap that applies to this input element
 java.lang.String toString()
          Writes the attributes of this object to a string and returns them.
 void write()
          writes an HTML image button to the given writer
 
Methods inherited from class com.raj.htmlForms.HtmlInput
getAccessKey, getDisabled, getReadOnly, getSize, getValue, isDisabled, setAccessKey, setReadOnly, setSize, setValue
 
Methods inherited from class com.raj.htmlForms.HtmlFormElement
getDir, getId, getLang, getName, getOnBlur, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getOnSelect, getStyle, getTabIndex, getTheClass, getTitle, getXhtml, setDir, setId, setLang, setName, setOnBlur, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnSelect, setStyle, setStyle, setTabIndex, setTheClass, setTitle, setXhtml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HtmlImageButton

public HtmlImageButton(java.io.Writer w)
Minimal constructor for any form element. All other attributes can be added by the appropriate setter method. These follows the standard Java convention for attributes, so the attribute foo becomes setFoo(). The attribute names can be found at the W3C HTML reference or many other places on the web.

Parameters:
w - the Writer to which all the data will be written out
See Also:
W3C Reference for forms

HtmlImageButton

public HtmlImageButton(java.io.Writer w,
                       boolean x,
                       java.lang.String n)
Constructor that sets the writer and name and a boolean which determines whether or not XHTML will be written

Parameters:
w - the Writer to which all the data will be written out
x - if true, XHTML will be written, else false
n - the name of this element

HtmlImageButton

public HtmlImageButton(java.io.Writer w,
                       java.lang.String n)
Constructor that sets the name of the image button

Parameters:
w - the Writer to which all the data will be written out
n - the name of this control
See Also:
W3C Reference for forms

HtmlImageButton

public HtmlImageButton(java.io.Writer w,
                       java.lang.String n,
                       java.lang.String s)
Constructor that sets the name and text of the reset button

Parameters:
w - the Writer to which all the data will be written out
n - the name of this element
See Also:
W3C Reference for forms
Method Detail

setSrc

public void setSrc(java.lang.String x)
sets the src of this input element

See Also:
W3C Reference of this attribute

getSrc

public java.lang.String getSrc()
gets the src of this input element

See Also:
W3C Reference of this attribute

setAlt

public void setAlt(java.lang.String x)
sets the alternate text of this input element

See Also:
W3C Reference of this attribute

getAlt

public java.lang.String getAlt()
gets the alternate text of this input element

See Also:
W3C Reference of this attribute

setAlign

public void setAlign(java.lang.String x)
sets the alignment of this input element

See Also:
W3C Reference of this attribute

getAlign

public java.lang.String getAlign()
gets the src of this input element

See Also:
W3C Reference of this attribute

setUsemap

public void setUsemap(java.lang.String x)
sets the name of an imagemap that applies to this input element

See Also:
W3C Reference of this attribute

getUsemap

public java.lang.String getUsemap()
gets the name of an imagemap that applies to this input element

See Also:
W3C Reference of this attribute

setIsmap

public void setIsmap(boolean x)
tells the server that this image is an imagemap

See Also:
W3C Reference of this attribute

getIsmap

public java.lang.String getIsmap()
if this object is a server side imagemap, this is returned, else the empty string

See Also:
W3C Reference of this attribute

reset

public void reset()
Description copied from class: HtmlFormElement
resets all attributes of the element back to a blank state

Overrides:
reset in class HtmlInput

toString

public java.lang.String toString()
Description copied from class: HtmlFormElement
Writes the attributes of this object to a string and returns them.

The toString() method should logically return a string representing the attributes of the HTML element, eg if you set the name, title and style of the element then you should return a string containing:

name="myName" title="some title" style="foo: xxx; bar: yyy;"

The responsibility for turning this into a form deliverable to a user agent belongs to the write() method.

Overrides:
toString in class HtmlInput
See Also:
HtmlFormElement.write()

write

public void write()
writes an HTML image button to the given writer

Specified by:
write in class HtmlFormElement