|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.raj.htmlForms.HtmlFormElement
|
+--com.raj.htmlForms.HtmlInput
|
+--com.raj.htmlForms.HtmlFile
This class will generate an HTML text box, writing out something like:
<input type=\"text\" name=\"somename\" value=\"somevalue\">
depending on the attributes set in this class. This class implements all the HTML 4.01 Transitional attributes of a textbox.
Note: The W3C spec says that the value attribute in the <input type="file"> tag should display that as the intial filename. Many browsers (including Internet Explorer, Netscape and Mozilla) ignore this for security reasons.
This class (HtmlText.java) is part of the com.raj.htmlForms package that
automatically generates HTML forms programmatically.
CREATED 26-FEB-2002, Copyright (c) Rajnish Bhaskar 2002
| Field Summary |
| Fields inherited from class com.raj.htmlForms.HtmlFormElement |
isXHTML, out |
| Constructor Summary | |
HtmlFile(java.io.Writer w)
Minimal constructor for any form element. |
|
HtmlFile(java.io.Writer w,
boolean x,
java.lang.String n)
Constructor that sets the writer and name of the control and a boolean which determines whether or not XHTML will be written |
|
HtmlFile(java.io.Writer w,
java.lang.String n)
Constructor that just sets the name of the element |
|
HtmlFile(java.io.Writer w,
java.lang.String n,
java.lang.String val)
Constructor that sets the name and value of the element |
|
| Method Summary | |
void |
accept(java.lang.String x)
sets the comma-separated list of MIME types that this form can process |
java.lang.String |
getAcceptList()
gets the list of MIME types that this form can process |
void |
reset()
resets all attributes of the element back to a blank state |
java.lang.String |
toString()
Writes the attributes of this object to a string and returns them. |
void |
write()
writes a file selector dialog 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 |
public HtmlFile(java.io.Writer w)
foo becomes setFoo(). The attribute names can be
found at the W3C HTML reference or many other places on the web.
w - the Writer to which all the data will be written out
public HtmlFile(java.io.Writer w,
java.lang.String n)
w - the Writer to which all the data will be written outn - the name of this element
public HtmlFile(java.io.Writer w,
boolean x,
java.lang.String n)
w - the Writer to which all the data will be written outx - if true, XHTML will be written, else falsen - the name of this element
public HtmlFile(java.io.Writer w,
java.lang.String n,
java.lang.String val)
w - the Writer to which all the data will be written outn - the name of this elementval - the initial filename of this control| Method Detail |
public void accept(java.lang.String x)
public java.lang.String getAcceptList()
public java.lang.String toString()
HtmlFormElement
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 HtmlInputHtmlFormElement.write()public void reset()
HtmlFormElement
reset in class HtmlInputpublic void write()
write in class HtmlFormElement
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||