org.mortbay.html

Class TableForm

public class TableForm extends Form

A form laid out in a Table.

This class creates a form and lays out all the elements within a table. Each element added has a label part and a element part. The label is displayed in the form beside the element. All buttons are shown at the bottom.

Constructor Summary
TableForm(String target)
Create a new TableForm.
Method Summary
InputaddButton(String tag, String label)
Add a Submit Button.
voidaddButtonArea(String label)
voidaddButtonArea()
voidaddButtonRow()
voidaddCheckbox(String tag, String label, boolean checked)
voidaddColumn()
Create a new column in the form.
voidaddColumn(int spacing)
Create a new column in the form.
voidaddField(String label, Element field)
Add an arbitrary element to the table.
InputaddFileField(String tag, String label)
Add a File Entry Field.
voidaddHiddenField(String tag, String value)
Add a hidden field.
voidaddInfoField(String tag, String label, String value)
Add an informational field which also passes the data as hidden.
voidaddPassword(String tag, String label, int length)
Add a password field.
voidaddReset(String label)
Add a reset button.
SelectaddSelect(String tag, String label, boolean multiple, int size)
Add a Select field.
SelectaddSelect(String tag, String label, boolean multiple, int size, Enumeration values)
Add a Select field initialised with fields.
voidaddText(String label, String value)
Add an informational section.
TextAreaaddTextArea(String tag, String label, int width, int height, String value)
Add a Text Area.
InputaddTextField(String tag, String label, int length, String value)
Add a Text Entry Field.
voidbuttonsAtBottom()
TableFormextendRow()
Extend the usage of the current row in the form.
voidnewColumns()
Add a new sections of columns.
voidnewTable()
Start using a new Table.
TableouterTable()
Get the internal table
voidsetColumnSpan(int span)
Set the column span of the current column.
Tabletable()
Get the internal table
voiduseAttributes(String attr)
Use the given attributes on the next addXXX
voidwrite(Writer out)

Constructor Detail

TableForm

public TableForm(String target)
Create a new TableForm.

Parameters: target The target url to send the form contents to

Method Detail

addButton

public Input addButton(String tag, String label)
Add a Submit Button.

Parameters: tag The form name of the element label The label for the Button

addButtonArea

public void addButtonArea(String label)

addButtonArea

public void addButtonArea()

addButtonRow

public void addButtonRow()

addCheckbox

public void addCheckbox(String tag, String label, boolean checked)

Parameters: tag The form name of the element label The label for the element in the table.

addColumn

public void addColumn()
Create a new column in the form.

addColumn

public void addColumn(int spacing)
Create a new column in the form.

addField

public void addField(String label, Element field)
Add an arbitrary element to the table.

Parameters: label The label for the element in the table.

addFileField

public Input addFileField(String tag, String label)
Add a File Entry Field.

Parameters: tag The form name of the element label The label for the element in the table.

addHiddenField

public void addHiddenField(String tag, String value)
Add a hidden field.

Parameters: tag The form name of the element

addInfoField

public void addInfoField(String tag, String label, String value)
Add an informational field which also passes the data as hidden.

Parameters: tag The form name of the element label The label for the element in the table.

addPassword

public void addPassword(String tag, String label, int length)
Add a password field.

Parameters: tag The form name of the element label The label for the element in the table.

addReset

public void addReset(String label)
Add a reset button.

Parameters: label The label for the element in the table.

addSelect

public Select addSelect(String tag, String label, boolean multiple, int size)
Add a Select field.

Parameters: tag The form name of the element label The label for the element in the table.

addSelect

public Select addSelect(String tag, String label, boolean multiple, int size, Enumeration values)
Add a Select field initialised with fields.

Parameters: tag The form name of the element label The label for the element in the table.

addText

public void addText(String label, String value)
Add an informational section.

addTextArea

public TextArea addTextArea(String tag, String label, int width, int height, String value)
Add a Text Area.

Parameters: tag The form name of the element label The label for the element in the table.

addTextField

public Input addTextField(String tag, String label, int length, String value)
Add a Text Entry Field.

Parameters: tag The form name of the element label The label for the element in the table.

buttonsAtBottom

public void buttonsAtBottom()

extendRow

public TableForm extendRow()
Extend the usage of the current row in the form. The next element added will be added to the same row as the form and not have a label of it's own.

Returns: TableForm, the this pointer so that users can write:

                    tableForm.extendRow().addField(...)

newColumns

public void newColumns()
Add a new sections of columns.

newTable

public void newTable()
Start using a new Table. Anything added to the Composite parent of this object before this is called will be added between the two tables.

outerTable

public Table outerTable()
Get the internal table

setColumnSpan

public void setColumnSpan(int span)
Set the column span of the current column. This call is needed for forms that have varying numbers of columns in different sections. NB. and column spacing counts as a column.

Parameters: span

table

public Table table()
Get the internal table

useAttributes

public void useAttributes(String attr)
Use the given attributes on the next addXXX

write

public void write(Writer out)
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.