net.xoetrope.builder.helper
Class XTableModelHelper

java.lang.Object
  extended by net.xoetrope.builder.helper.XTableModelHelper

public class XTableModelHelper
extends java.lang.Object

A utility class to help construct a HTML like table structure

Copyright: Copyright (c) Xoetrope Ltd., 1998-2003


Constructor Summary
XTableModelHelper()
           
 
Method Summary
static XModel addData(XModel model, java.lang.String name, java.lang.String value)
          Add data to the specified model.
static XModel addHeader(XModel model)
          Creates a new 'th' node and returns it
static XModel addRow(XModel model)
          Add a new 'tr' node to the passed XModel
static XModel createDataItem(java.lang.String name, java.lang.String value, XModel model)
           
static XModel createDataSet(java.lang.String name)
          Creates a new dataset within the model with the specified name.
static XModel createDataSet(java.lang.String name, XModel model)
           
static XModel createTable(XModel model, java.lang.String name)
          Adds a new table XModel node to the model node The XModel which will have the newly created table XModel appended to it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XTableModelHelper

public XTableModelHelper()
Method Detail

createDataSet

public static XModel createDataSet(java.lang.String name)
Creates a new dataset within the model with the specified name. The new XModel is appended to the root and returned

Parameters:
name - The name to be given to the new XModel
Returns:
The newly created XModel

createDataSet

public static XModel createDataSet(java.lang.String name,
                                   XModel model)

createDataItem

public static XModel createDataItem(java.lang.String name,
                                    java.lang.String value,
                                    XModel model)

createTable

public static XModel createTable(XModel model,
                                 java.lang.String name)
Adds a new table XModel node to the model node The XModel which will have the newly created table XModel appended to it

Parameters:
model - The XModel which will have the newly created model appended to it
name - The name of the new XModel
Returns:
The newly created table XModel

addHeader

public static XModel addHeader(XModel model)
Creates a new 'th' node and returns it

Parameters:
model - The model which will have the newly created XModel appended to it
Returns:
The newly created th node

addRow

public static XModel addRow(XModel model)
Add a new 'tr' node to the passed XModel

Parameters:
model - The model which will have the newly created XModel appended to it
Returns:
The newly created th node

addData

public static XModel addData(XModel model,
                             java.lang.String name,
                             java.lang.String value)
Add data to the specified model.

Parameters:
model - The node which we are adding the data to
name - The name of the new data item
value - The value of the new data item
Returns:
The newly created data item