|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.httpd.HTMLFormWriter
public class HTMLFormWriter
HTMLFormWriter is a tool for writing simple HTML-based forms to a StringBuffer or AgentRequest output stream. Using this class it is relatively simple to create generic forms without worrying about the HTML code.
| Constructor Summary | |
|---|---|
HTMLFormWriter(AgentRequest agentRequest)
Use this constructor to write HTML forms directly to an AgentRequest. |
|
HTMLFormWriter(java.lang.StringBuffer b)
Use this constructor to write HTML forms to a StringBuffer. |
|
| Method Summary | |
|---|---|
protected java.lang.String |
encode(java.lang.String in)
|
void |
print(int i)
Converts the integer to a String and writes it to the output. |
void |
print(java.lang.String s)
Prints the String to the output. |
void |
println(int i)
Converts the integer to a String and writes it to the output followed by a carriage return. |
void |
println(java.lang.String s)
Prints the String to the output followed by a carriage return. |
void |
writeCaption(java.lang.String caption)
Adds a centered caption to the form output. |
void |
writeCheckbox(java.lang.String label,
java.lang.String name,
boolean checked)
Writes a checkbox to the form output. |
void |
writeCheckbox(java.lang.String label,
java.lang.String name,
boolean checked,
java.lang.String title)
Writes a checkbox to the form output and includes a title attribute. |
void |
writeField(java.lang.String label,
java.lang.String name,
int size)
Writes a standard input field to the form output. |
void |
writeField(java.lang.String label,
java.lang.String name,
Props p,
int size)
Writes a standard input field to the form output displaying the value as retrieved from the Props using the specified name as the Props key. |
void |
writeField(java.lang.String label,
java.lang.String name,
java.lang.String value,
int size)
Writes a standard input field to the form output displaying the specified value. |
void |
writeFooter()
Writes the form footer to the output. |
void |
writeHeader(java.lang.String submitURL)
Writes the form header to the output. |
void |
writeHeader(java.lang.String submitURL,
Props userProps)
Writes the form header to the output. |
void |
writeHelp(java.lang.String message)
Adds a help description over the fields. |
void |
writeHiddenField(java.lang.String name,
Props p)
Writes a hidden input parameter to the form output as retrieved from the Props using the specified name as the Props key. |
void |
writeHiddenField(java.lang.String name,
java.lang.String value)
Writes a hidden input parameter to the form output. |
void |
writeLoginFields(Props p)
Hidden "login_name" and "login_hash" parameters are added to the form output using the "name" and "password" values of the specified Props. |
void |
writeLoginFields(java.lang.String name,
java.lang.String password)
Hidden "login_name" and "login_hash" parameters are added to the form output using the specified name and password. |
void |
writeMultilineField(java.lang.String label,
java.lang.String name,
int columns,
int rows)
Writes a multiline field (TEXTAREA) to the form output. |
void |
writeMultilineField(java.lang.String label,
java.lang.String name,
Props p,
int columns,
int rows)
Writes a multiline field (TEXTAREA) to the form output displaying the specified value as retrieved from the Props using the specified name as a key. |
void |
writeMultilineField(java.lang.String label,
java.lang.String name,
java.lang.String value,
int columns,
int rows)
Writes a multiline field (TEXTAREA) to the form output displaying the specified value. |
void |
writePassword(java.lang.String label,
java.lang.String name,
int size)
Writes a password input field to the form output. |
void |
writePassword(java.lang.String label,
java.lang.String name,
java.lang.String value,
int size)
Writes a password input field to the form output containing the specified value. |
void |
writeProps(Props p)
Writes a table containing the Props keys and associated values to the output. |
void |
writeResetButton(java.lang.String title,
java.lang.String description)
Writes a reset button and description to the form output that resets changes to the form when pressed. |
void |
writeSelectFooter()
Writes the footer HTML for a SELECT to the form output. |
void |
writeSelectHeader(java.lang.String label,
java.lang.String name,
boolean multiple)
Writes the header HTML for a SELECT to the form output to display a popup menu or selection list. |
void |
writeSelectItem(java.lang.String name,
java.lang.String value,
boolean selected)
Writes a SELECT OPTION to the form output. |
void |
writeSelectItem(java.lang.String name,
java.lang.String value,
java.lang.String currentSelection)
Writes a SELECT OPTION to the form output. |
void |
writeSpace()
Writes appropriate HTML to the output to add vertical space between form items. |
void |
writeStaticField(java.lang.String label,
java.lang.String value)
Writes a static text field to the form output. |
void |
writeSubmitButton(java.lang.String title,
java.lang.String name,
java.lang.String description)
Writes a submit button and description to the form output. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HTMLFormWriter(AgentRequest agentRequest)
public HTMLFormWriter(java.lang.StringBuffer b)
| Method Detail |
|---|
public void print(int i)
throws java.io.IOException
java.io.IOException
public void print(java.lang.String s)
throws java.io.IOException
java.io.IOException
public void println(int i)
throws java.io.IOException
java.io.IOException
public void println(java.lang.String s)
throws java.io.IOException
java.io.IOException
public void writeCaption(java.lang.String caption)
throws java.io.IOException
java.io.IOException
public void writeCheckbox(java.lang.String label,
java.lang.String name,
boolean checked)
throws java.io.IOException
java.io.IOException
public void writeCheckbox(java.lang.String label,
java.lang.String name,
boolean checked,
java.lang.String title)
throws java.io.IOException
java.io.IOException
public void writeFooter()
throws java.io.IOException
java.io.IOException
public void writeHeader(java.lang.String submitURL)
throws java.io.IOException
java.io.IOException
public void writeHeader(java.lang.String submitURL,
Props userProps)
throws java.io.IOException
java.io.IOException
public void writeHelp(java.lang.String message)
throws java.io.IOException
java.io.IOException
public void writeSpace()
throws java.io.IOException
java.io.IOException
public void writeField(java.lang.String label,
java.lang.String name,
int size)
throws java.io.IOException
java.io.IOException
public void writeField(java.lang.String label,
java.lang.String name,
java.lang.String value,
int size)
throws java.io.IOException
java.io.IOException
public void writeField(java.lang.String label,
java.lang.String name,
Props p,
int size)
throws java.io.IOException
java.io.IOException
public void writeHiddenField(java.lang.String name,
java.lang.String value)
throws java.io.IOException
java.io.IOException
public void writeHiddenField(java.lang.String name,
Props p)
throws java.io.IOException
java.io.IOException
public void writeLoginFields(java.lang.String name,
java.lang.String password)
throws java.io.IOException
java.io.IOException
public void writeLoginFields(Props p)
throws java.io.IOException
java.io.IOException
public void writeMultilineField(java.lang.String label,
java.lang.String name,
int columns,
int rows)
throws java.io.IOException
java.io.IOException
public void writeMultilineField(java.lang.String label,
java.lang.String name,
java.lang.String value,
int columns,
int rows)
throws java.io.IOException
java.io.IOException
public void writeMultilineField(java.lang.String label,
java.lang.String name,
Props p,
int columns,
int rows)
throws java.io.IOException
java.io.IOException
public void writePassword(java.lang.String label,
java.lang.String name,
int size)
throws java.io.IOException
java.io.IOException
public void writePassword(java.lang.String label,
java.lang.String name,
java.lang.String value,
int size)
throws java.io.IOException
java.io.IOException
public void writeProps(Props p)
throws java.io.IOException
java.io.IOException
public void writeResetButton(java.lang.String title,
java.lang.String description)
throws java.io.IOException
java.io.IOException
public void writeSelectFooter()
throws java.io.IOException
java.io.IOException
public void writeSelectHeader(java.lang.String label,
java.lang.String name,
boolean multiple)
throws java.io.IOException
java.io.IOException
public void writeSelectItem(java.lang.String name,
java.lang.String value,
boolean selected)
throws java.io.IOException
java.io.IOException
public void writeSelectItem(java.lang.String name,
java.lang.String value,
java.lang.String currentSelection)
throws java.io.IOException
java.io.IOException
public void writeStaticField(java.lang.String label,
java.lang.String value)
throws java.io.IOException
java.io.IOException
public void writeSubmitButton(java.lang.String title,
java.lang.String name,
java.lang.String description)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String encode(java.lang.String in)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||