|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.raj.htmlForms.HtmlFormElement
This class will be the superclass of other form elements. It will hold attributes and methods that are common to all elements. This includes both <input> and <select> tags but excludes any attributes that are unique to a particular tag.
HtmlForms is capable of writing either HTML 4.01 Transitional or XHTML 1.0 Transitional. If you
want to write to the strict versions of these DTDs, omit any attributes that do not exist in that DTD.
This class (FormElement.java) is part of the com.raj.htmlForms package that
automatically generates HTML forms programmatically.
CREATED 20-FEB-2002, Copyright (c) Rajnish Bhaskar 2002
| Field Summary | |
protected boolean |
isXHTML
|
protected java.io.PrintWriter |
out
|
| Constructor Summary | |
HtmlFormElement()
|
|
| Method Summary | |
java.lang.String |
getDir()
gets the text direction |
java.lang.String |
getId()
gets the ID of this element |
java.lang.String |
getLang()
gets the language code of this element |
java.lang.String |
getName()
gets the name of this element |
java.lang.String |
getOnBlur()
gets the contents of the Javascript onFocus event |
java.lang.String |
getOnClick()
gets the contents of the Javascript onClick event |
java.lang.String |
getOnDblClick()
gets the contents of the Javascript onDblClick event |
java.lang.String |
getOnFocus()
gets the contents of the Javascript onFocus event. |
java.lang.String |
getOnKeyDown()
gets the contents of the Javascript onKeyDown event |
java.lang.String |
getOnKeyPress()
gets the contents of the Javascript onKeyPress event |
java.lang.String |
getOnKeyUp()
gets the contents of the Javascript onKeyUp event |
java.lang.String |
getOnMouseDown()
gets the contents of the Javascript onMouseDown event |
java.lang.String |
getOnMouseMove()
gets the contents of the Javascript onMouseOut event |
java.lang.String |
getOnMouseOut()
gets the contents of the Javascript onMouseOut event |
java.lang.String |
getOnMouseOver()
gets the contents of the Javascript onMouseOver event |
java.lang.String |
getOnMouseUp()
gets the contents of the Javascript onMouseDown event |
java.lang.String |
getOnSelect()
gets the contents of the Javascript onSelect event |
java.lang.String |
getStyle()
gets the inline style information for this element |
java.lang.String |
getTabIndex()
gets the tab index for this element |
java.lang.String |
getTheClass()
gets the CSS class of this element |
java.lang.String |
getTitle()
gets the title attribute for this element |
boolean |
getXhtml()
returns the status of this element (whether it will output HTML or XHTML) |
void |
reset()
resets all attributes of the element back to a blank state |
void |
setDir(java.lang.String x)
sets the direction of the text. |
void |
setId(java.lang.String x)
sets the ID of this element |
void |
setLang(java.lang.String x)
sets the language code of this element |
void |
setName(java.lang.String x)
sets the name of this element |
void |
setOnBlur(java.lang.String x)
specifies the content of the Javascript onBlur event. |
void |
setOnClick(java.lang.String x)
specifies the content of the Javascript onClick event. |
void |
setOnDblClick(java.lang.String x)
specifies the content of the Javascript onDblClick event. |
void |
setOnFocus(java.lang.String x)
specifies the content of the Javascript onFocus event. |
void |
setOnKeyDown(java.lang.String x)
specifies the contents of the Javascript onKeyDown event. |
void |
setOnKeyPress(java.lang.String x)
specifies the contents of the Javascript onKeyPress event. |
void |
setOnKeyUp(java.lang.String x)
specifies the contents of the Javascript onKeyUp event. |
void |
setOnMouseDown(java.lang.String x)
specifies the contents of the Javascript onMouseDown event. |
void |
setOnMouseMove(java.lang.String x)
specifies the contents of the Javascript onMouseOut event. |
void |
setOnMouseOut(java.lang.String x)
specifies the contents of the Javascript onMouseOut event. |
void |
setOnMouseOver(java.lang.String x)
specifies the contents of the Javascript onMouseOver event. |
void |
setOnMouseUp(java.lang.String x)
specifies the contents of the Javascript onMouseUp event. |
void |
setOnSelect(java.lang.String x)
specifies the content of the Javascript onSelect event. |
void |
setStyle(java.util.Properties x)
sets the inline style information for this element using a Properties file to hold the necessary attributes. |
void |
setStyle(java.lang.String x)
sets the inline style information for this element by just specifying it as a String. |
void |
setTabIndex(int x)
specifies the tab index for this element |
void |
setTheClass(java.lang.String x)
sets the CSS class of this element |
void |
setTitle(java.lang.String x)
sets the title attribute for this element |
void |
setXhtml(boolean x)
sets the output type of this element. |
java.lang.String |
toString()
Writes the attributes of this object to a string and returns them. |
abstract void |
write()
Writes this element to Writer in this object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.io.PrintWriter out
protected boolean isXHTML
| Constructor Detail |
public HtmlFormElement()
| Method Detail |
public void setXhtml(boolean x)
public boolean getXhtml()
public void setName(java.lang.String x)
public java.lang.String getName()
public void setId(java.lang.String x)
public java.lang.String getId()
public void setTheClass(java.lang.String x)
public java.lang.String getTheClass()
public void setDir(java.lang.String x)
public java.lang.String getDir()
public void setLang(java.lang.String x)
public java.lang.String getLang()
public void setTitle(java.lang.String x)
public java.lang.String getTitle()
public void setStyle(java.lang.String x)
border: 1px solid black; background-color: #ffff00
public void setStyle(java.util.Properties x)
eg: Properties p= new Properties();
would mean:
p.setProperty("border", "1px solid black");
p.setProperty("background-color", "#ffff00");
border: 1px solid black; background-color: #ffff00
public java.lang.String getStyle()
public void setTabIndex(int x)
public java.lang.String getTabIndex()
public void setOnFocus(java.lang.String x)
public java.lang.String getOnFocus()
public void setOnBlur(java.lang.String x)
public java.lang.String getOnBlur()
public void setOnSelect(java.lang.String x)
public java.lang.String getOnSelect()
public void setOnClick(java.lang.String x)
public java.lang.String getOnClick()
public void setOnDblClick(java.lang.String x)
public java.lang.String getOnDblClick()
public void setOnMouseDown(java.lang.String x)
public java.lang.String getOnMouseDown()
public void setOnMouseUp(java.lang.String x)
public java.lang.String getOnMouseUp()
public void setOnMouseOver(java.lang.String x)
public java.lang.String getOnMouseOver()
public void setOnMouseMove(java.lang.String x)
public java.lang.String getOnMouseMove()
public void setOnMouseOut(java.lang.String x)
public java.lang.String getOnMouseOut()
public void setOnKeyPress(java.lang.String x)
public java.lang.String getOnKeyPress()
public void setOnKeyDown(java.lang.String x)
public java.lang.String getOnKeyDown()
public void setOnKeyUp(java.lang.String x)
public java.lang.String getOnKeyUp()
public abstract void write()
this object. Eg if the HtmlText.write()
method is called then a textbox with the appropriate attributes set will be written to the page.
public java.lang.String toString()
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.
toString in class java.lang.Objectwrite()public void reset()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||