com.plumtree.xpshared.htmlconstructs
Class PTTableBuilder

java.lang.Object
  extended by com.plumtree.xpshared.htmlconstructs.PTTableBuilder

public class PTTableBuilder
extends java.lang.Object

Author:
beng Use this class to build tables for which each cell spans exactly 1 column.

This class is intended to simplify the creation of such tables.

Constructor Summary
PTTableBuilder(int cols)
          Creates a new PTTableBuilder object.
PTTableBuilder(int rows, int cols)
          Creates a new PTTableBuilder object.
PTTableBuilder(int rows, int cols, PTStyleClass tableClass, PTStyleClass rowClass, PTStyleClass cellClass)
          Creates a new PTTableBuilder object.
PTTableBuilder(int rows, int cols, java.lang.String sWidth, java.lang.String sCellPadding, java.lang.String sCellSpacing)
          Creates a new PTTableBuilder object.
PTTableBuilder(int rows, int cols, java.lang.String sWidth, java.lang.String sCellPadding, java.lang.String sCellSpacing, PTStyleClass tableClass, PTStyleClass rowClass, PTStyleClass cellClass)
          Creates a new PTTableBuilder object.
PTTableBuilder(int cols, PTStyleClass tableClass, PTStyleClass rowClass, PTStyleClass cellClass)
          Creates a new PTTableBuilder object.
 
Method Summary
 HTMLTableRow AddRow()
          Call this method to add a row to the table built by this builder.
 IXPEnumerator GetCells(int row)
          Call this method to obtain an enumeration of the cells within a given row within the table built by this builder.
 int GetNumCols()
          Call this method to determine the number of columns in the table built by this builder.
 int GetNumRows()
          Call this method to obtain the number of rows in the table built by this builder.
 IXPEnumerator GetRows()
          Call this method to obtain an enumeration of the rows in the table built by this builder.
 HTMLTable GetTable()
          Call this method to obtain a reference to the table created by this table builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PTTableBuilder

public PTTableBuilder(int cols)
Creates a new PTTableBuilder object.

The table produced by this builder constructed in this way will contain no rows, will be "100%" wide, with cellspacing and cellpadding each "0", no style classes will be set.

Parameters:
cols - Pass the number of columns which this table spans.

PTTableBuilder

public PTTableBuilder(int rows,
                      int cols)
Creates a new PTTableBuilder object.

The table produced by this builder constructed in this way will contain the specified number of rows, will be "100%" wide, with cellspacing and cellpadding each "0", no style classes will be set.

Parameters:
rows - Pass the number of rows this table spans.
cols - Pass the number of columns this table spans.

PTTableBuilder

public PTTableBuilder(int rows,
                      int cols,
                      java.lang.String sWidth,
                      java.lang.String sCellPadding,
                      java.lang.String sCellSpacing)
Creates a new PTTableBuilder object.

No style classes will be set for the table produced by this builder constructed in this way,

Parameters:
rows - Pass the number of rows this table spans.
cols - Pass the number of columns this table spans.
sWidth - Pass the width of this table.
sCellPadding - Pass the cell padding.
sCellSpacing - Pass the cell spacing.

PTTableBuilder

public PTTableBuilder(int cols,
                      PTStyleClass tableClass,
                      PTStyleClass rowClass,
                      PTStyleClass cellClass)
Creates a new PTTableBuilder object.

The table produced by this builder constructed in this way will contain no rows, will be "100%" wide, with cellspacing and cellpadding each "0", style classes will be set as specified.

Parameters:
cols - Pass the number of columns this table spans.
tableClass - Pass the style class of this table.
rowClass - Pass the style class for the rows of this table.
cellClass - Pass the style class for the cell sof this table.

PTTableBuilder

public PTTableBuilder(int rows,
                      int cols,
                      PTStyleClass tableClass,
                      PTStyleClass rowClass,
                      PTStyleClass cellClass)
Creates a new PTTableBuilder object.

The table produced by this builder constructed in this way will contain the specified number of rows, will be "100%" wide, with cellspacing and cellpadding each "0", style classes will be set as specified.

Parameters:
rows - Pass the number of rows this table spans.
cols - Pass the number of columns this table spans.
tableClass - Pass the style class of this table.
rowClass - Pass the style class for the rows of this table.
cellClass - Pass the style class for the cell sof this table.

PTTableBuilder

public PTTableBuilder(int rows,
                      int cols,
                      java.lang.String sWidth,
                      java.lang.String sCellPadding,
                      java.lang.String sCellSpacing,
                      PTStyleClass tableClass,
                      PTStyleClass rowClass,
                      PTStyleClass cellClass)
Creates a new PTTableBuilder object.

Parameters:
rows - Pass the number of rows this table spans.
cols - Pass the number of columns this table spans.
sWidth - Pass the width of this table.
sCellPadding - Pass the cell padding of this table.
sCellSpacing - Pass the cell spacing of this table.
tableClass - Pass the style class of this table.
rowClass - Pass the style class of this table's rows.
cellClass - Pass the style class of this table's cells.
Method Detail

GetTable

public HTMLTable GetTable()
Call this method to obtain a reference to the table created by this table builder.

Returns:
HTMLTable table

GetNumRows

public int GetNumRows()
Call this method to obtain the number of rows in the table built by this builder.

Returns:
int rows

GetNumCols

public int GetNumCols()
Call this method to determine the number of columns in the table built by this builder.

Returns:
int columns

AddRow

public HTMLTableRow AddRow()
Call this method to add a row to the table built by this builder.

The appropriate number of cells will be added to this row.

Returns:
HTMLTablRow row added

GetRows

public IXPEnumerator GetRows()
Call this method to obtain an enumeration of the rows in the table built by this builder.

Returns:
IXPEnumerator rows

GetCells

public IXPEnumerator GetCells(int row)
Call this method to obtain an enumeration of the cells within a given row within the table built by this builder.

Parameters:
row - Pass the index of the row you wish to obtain. If this row doesnt exist in the table, you will receive null;
Returns:
IXPEnumerator cells



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.