to.etc.domui.component.form
Class GenericTableFormBuilder

java.lang.Object
  extended by to.etc.domui.component.form.FormBuilderBase
      extended by to.etc.domui.component.form.GenericFormBuilder
          extended by to.etc.domui.component.form.GenericTableFormBuilder
Direct Known Subclasses:
HorizontalFormBuilder, OldHorizontalFormBuilder, TabularFormBuilder

public abstract class GenericTableFormBuilder
extends GenericFormBuilder

This explicitly makes forms that are represented by some kind of table. It contains basic table manipulation code and stuff.

Author:
Frits Jalvingh Created on Aug 13, 2009

Field Summary
 
Fields inherited from class to.etc.domui.component.form.FormBuilderBase
LOG
 
Constructor Summary
GenericTableFormBuilder()
           
GenericTableFormBuilder(java.lang.Class<T> clz, IReadOnlyModel<T> mdl)
          
GenericTableFormBuilder(T instance)
          
 
Method Summary
 TD addCell()
          Add a new cell to the last-used row.
 TD addCell(java.lang.String css)
           
 TR addRow()
          Add a new row to the current body; create a body (and a table) if necessary.
 TD addRowAndCell()
           
 TD addRowAndCell(java.lang.String tdcss)
           
 NodeContainer finish()
          This finishes off the current table by calculating colspans for all skewed rows.
 TR getLastUsedRow()
          Get the last-used row.
 Table getTable()
          Return the current table, or null if nothing is current.
 TBody getTBody()
          Return the current tbody, or null if nothing is current.
protected  void internalClearLocation()
          Called when a new table, body or whatever is made current; it should reset all known positioning information.
 TBody newBody()
          Creates a new TBody and adds it to the table.
protected  void onBodyAdded(TBody b)
           
protected  void onRowAdded(TR row)
           
protected  void onTableAdded(Table t)
          Called when a new table is added.
 void reset()
          Clears the current generated layout and starts a new table.
 TR row()
          Gets the last-used row.
 TR selectRow(int ix)
          This makes the row with the specified index in the current body the "current" row.
protected  void setLastUsedCell(TD cell)
           
protected  void setLastUsedRow(TR row)
           
 void setTable(Table b)
          Sets a new table.
 void setTBody(TBody b)
          Sets the TBody to use.
protected  Table table()
          Gets the current table, or creates a new one if none is set.
protected  TBody tbody()
          Gets the current tbody, or creates a new one if none is set.
 
Methods inherited from class to.etc.domui.component.form.GenericFormBuilder
addContent, addContent, addContent, addControl, addControl, addDisplayProp, addDisplayProp, addDisplayProp, addDisplayProps, addLabelAndControl, addLabelAndControl, addListOfProperties, addProp, addProp, addProp, addProp, addProp, addProp, addProp, addPropertyAndControl, addPropertyControl, addProps
 
Methods inherited from class to.etc.domui.component.form.FormBuilderBase
createControlFor, createControlFor, getBindings, getBuilder, getClassMeta, getContext, getControlLabelFactory, getCurrentInputClass, getModel, resolveProperty, rights, setBindings, setClassModel, setContext, setControlLabelFactory, setInstance, setMetaModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericTableFormBuilder

public GenericTableFormBuilder()

GenericTableFormBuilder

public GenericTableFormBuilder(java.lang.Class<T> clz,
                               IReadOnlyModel<T> mdl)


GenericTableFormBuilder

public GenericTableFormBuilder(T instance)

Method Detail

internalClearLocation

protected void internalClearLocation()
Called when a new table, body or whatever is made current; it should reset all known positioning information.


reset

public void reset()
Clears the current generated layout and starts a new table.


setTable

public void setTable(Table b)
Sets a new table. This resets the current body and stuff. Since the table was not created here the onBodyAdded local event is not fired.

Parameters:
b -

setTBody

public void setTBody(TBody b)
Sets the TBody to use. This resets all layout state. Since the table and the body was not created here the onBodyAdded local event is not fired.

Parameters:
b -

onTableAdded

protected void onTableAdded(Table t)
Called when a new table is added.

Parameters:
t -

onBodyAdded

protected void onBodyAdded(TBody b)

onRowAdded

protected void onRowAdded(TR row)

getTable

public Table getTable()
Return the current table, or null if nothing is current.

Returns:

getTBody

public TBody getTBody()
Return the current tbody, or null if nothing is current.

Returns:

table

protected Table table()
Gets the current table, or creates a new one if none is set. If a new one is created this fires the onTableAdded(Table) event.

Returns:

tbody

protected TBody tbody()
Gets the current tbody, or creates a new one if none is set. If a new one is created this fires the onBodyAdded(TBody) event.

Returns:

newBody

public TBody newBody()
Creates a new TBody and adds it to the table. This can be used to create multiple re-generatable layouts within a single layout table. The body inherits the table's core layout.

Returns:

finish

public NodeContainer finish()
This finishes off the current table by calculating colspans for all skewed rows. This discards the current table!

Returns:

addRow

@Nonnull
public TR addRow()
Add a new row to the current body; create a body (and a table) if necessary. The row becomes the "last row".

Returns:

row

@Nonnull
public TR row()
Gets the last-used row. If it is unset it gets created and added to the current tbody. This also creates tbody and table if needed.

Returns:

getLastUsedRow

@Nullable
public TR getLastUsedRow()
Get the last-used row. This can return null!!

Returns:

selectRow

public TR selectRow(int ix)
This makes the row with the specified index in the current body the "current" row. If it does not already exist it gets created!

Parameters:
ix -
Returns:

addCell

@Nonnull
public TD addCell()
Add a new cell to the last-used row.

Returns:

addCell

@Nonnull
public TD addCell(java.lang.String css)

addRowAndCell

@Nonnull
public TD addRowAndCell()

addRowAndCell

@Nonnull
public TD addRowAndCell(java.lang.String tdcss)

setLastUsedRow

protected void setLastUsedRow(TR row)

setLastUsedCell

protected void setLastUsedCell(TD cell)