borland Packages  Class Hierarchy  internetbeans Package 

IxTable component

java.lang.Object
   +----com.borland.internetbeans.IxComponent
           +----com.borland.internetbeans.IxTable

About the IxTable component

Variables  Constructors  Properties  Methods  

Implements DataSetAware, Renderable, Serializable, Cloneable

Note: This is a feature of JBuilder Professional and Enterprise.

IxTable generates HTML tables from data sets or table models.


IxTable variables

Variables implemented in this class

Variables implemented in com.borland.internetbeans.IxComponent

IxTable constructors

IxTable properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in com.borland.internetbeans.IxComponent

Properties implemented in java.lang.Object

IxTable methods

Methods implemented in this class

Methods implemented in com.borland.internetbeans.IxComponent

Methods implemented in java.lang.Object


IxTable variables

BODY_TAG

  public static final String BODY_TAG = "tbody"
Tag name for table body section.

DEFAULT_ROW_COUNT

  public static final int DEFAULT_ROW_COUNT = 20
Default number of data rows to display every time the table is rendered.

FOOTER_TAG

  public static final String FOOTER_TAG = "tfoot"
Tag name for table footer section.

HEADER_TAG

  public static final String HEADER_TAG = "thead"
Tag name for table header section.

TAG_NAME

  public static final String TAG_NAME = "table"
Tag name for this type of element.

IxTable constructors

IxTable()

  public IxTable()
Constructs an IxTable with the default data model.

IxTable(int, int)

  public IxTable(int numColumns, int numRows)
Constructs an IxTable with numRows and numColumns of empty cells using the DefaultTableModel. The columns will have names of the form "A", "B", "C", and so on.

Parameters:

numRows
The number of rows the table holds
numColumns
The number of columns the table holds
See also: javax.swing.table.DefaultTableModel

IxTable(java.lang.Object[][], java.lang.Object[])

  public IxTable(Object[][] rowData, Object[] columnNames)
Constructs an IxTable to display the values in the two dimensional array, rowData, with column names, columnNames. rowData is an Array of rows, so the value of the cell at row 1, column 5 can be obtained with the following code:

 rowData[1][5]; 

All rows must be of the same length as columnNames.

Parameters:

rowData
The data for the new table
columnNames
Names of each column

IxTable(java.util.Vector, java.util.Vector)

  public IxTable(Vector rowData, Vector columnNames)
Constructs an IxTable to display the values in the Vector of Vectors, rowData, with column names, columnNames. The Vectors contained in rowData should contain the values for that row. In other words, the value of the cell at row 1, column 5 can be obtained with the following code:

((Vector)rowData.elementAt(1)).elementAt(5);

All rows must be of the same length as columnNames.

Parameters:

rowData
The data for the new table
columnNames
Names of each column

IxTable(javax.swing.table.TableModel)

  public IxTable(TableModel dm)
Constructs an IxTable which is initialized with dm as the data model.

Parameters:

dm
The data model for the table. If null, use a DefaultTableModel.

IxTable properties

adaptFormat

 public boolean getAdaptFormat()
 public void setAdaptFormat(boolean adapt)
Whether to attempt to match the table structure and attrributes in the template.

autoHeadingMatch

 public boolean getAutoHeadingMatch()
 public void setAutoHeadingMatch(boolean match)
Whether to match heading text in the template with columns in the data model and display the matching columns only.

bodyRowStyles

 public String[] getBodyRowStyles()
 public void setBodyRowStyles(String cssClasses)
 public void setBodyRowStyles(String[] cssClasses)
The Cascading Style Sheet classes for all defined rows. You may set this property to override the formatting found in the template (if any).

border

 public int getBorder()
 public void setBorder(int newBorder)
Convenience property that maps to the BORDER attribute.

cellPadding

 public Length getCellPadding()
 public void setCellPadding(Length newCellPadding)
Convenience property that maps to the CELLPADDING attribute.

cellSpacing

 public Length getCellSpacing()
 public void setCellSpacing(Length newCellSpacing)
Convenience property that maps to the CELLSPACING attribute.

dataSet

 public DataSet getDataSet()
 public void setDataSet(DataSet ds)
Wires the IxTable directly to a DataSet by creating a DBTableModel and setting it as the model.

headerCellStyle

 public String getHeaderCellStyle()
 public void setHeaderCellStyle(String cssClass)
The Cascading Style Sheet class for the table header cells.

headerRowStyle

 public String getHeaderRowStyle()
 public void setHeaderRowStyle(String cssClass)
The Cascading Style Sheet class for the table header row.

model

 public TableModel getModel()
 public void setModel(TableModel newModel)
The data model for the table.

Parameters:

newModel
The new data source for this table

Throws IllegalArgumentException if newModel is null.

See also: #getModel()

requestParameterValue

 public void setRequestParameterValue(String value)
Reacts to a matching parameter in the request by setting the start row to the numeric value in the string. Parameters names are matched via getIdentifier.

Parameters:

value
Starting row number, as a string; cannot be null. If the string does not contain a valid number, it is ignored.
See also: startRow

rowCount

 public int getRowCount()
 public void setRowCount(int newRowCount)
The number of data rows to display when rendering the table. For example, if there are 87 rows in the data model and the rowCount is 20, it would take five pages of tables to display all the rows.

startRow

 public int getStartRow()
 public void setStartRow(int newStartRow)
The first row in the data model to display. Row zero is the first row.

When using the auto-replication, be sure to call IxPageProducer.getSessionComponent to retrieve the actual instance being used by the session to set the starting row.

tupleTableName

 public String getTupleTableName()
 public void setTupleTableName(String newTupleTableName)
Name used to identify nested set in TupleModel. Set automatically when using a DataSet from a DataModule as the data model, and ignored when using a single DataSet (because there's only one table).

width

 public Length getWidth()
 public void setWidth(Length newWidth)
Convenience property that maps to the WIDTH attribute.

IxTable methods

addColumn(aColumn)

  public void addColumn(IxTableColumn aColumn)
Appends aColumn to the end of the array of columns

Parameters:

aColumn
The IxTableColumn to be added

assembleElementBody(outWrap)

  protected void assembleElementBody(OutputWrapper outWrap)
Renders table header and body. (TFOOT is not supported.)

Starting at row startRow in the data model, renders rowCount rows.

Parameters:

outWrap
The stream-like output into which the content goes

Overrides: com.borland.internetbeans.IxComponent.assembleElementBody(outWrap)

assembleTagAttributes(outWrap)

  protected void assembleTagAttributes(OutputWrapper outWrap)
Concretes IxComponent but does nothing; any attributes are handled by assembleMergedAttributes.

Parameters:

outWrap
The stream-like output into which the content goes

Overrides: com.borland.internetbeans.IxComponent.assembleTagAttributes(outWrap)

cloneForTupleModel(tupleModel)

  protected IxComponent cloneForTupleModel(TupleModel tupleModel)
Clones table and ties it to the specified TupleModel, if the current table data model is from the original of that TupleModel or a DataSet.

Parameters:

tupleModel
Data model for other page context
Returns clone of component, with tupleModel property set to new model.

Overrides: com.borland.internetbeans.IxComponent.cloneForTupleModel(tupleModel)

convertColumnIndexToModel(int)

  public int convertColumnIndexToModel(int viewColumnIndex)
Return the index of the column in the data model whose data is being displayed in the column viewColumnIndex. Returns viewColumnIndex unchanged when viewColumnIndex is less than zero or greater than the number of columns in the view.

Parameters:

viewColumnIndex
Column number in the table view

Returns column number from the data model.

createDefaultColumnsFromModel()

  public void createDefaultColumnsFromModel()
Creates IxTableColumn objects that match each column in the table model. Any existing columns will be cleared (unless the table model is null, in which case nothing happens).

createDefaultDataModel()

  protected TableModel createDefaultDataModel()
Returns the default table model object which is a DefaultTableModel. Subclass can override this method to return a different table model object.
Returns the default table model object.

createRowRenderers(java.lang.String[])

  protected IxTableRow[] createRowRenderers(String[] cssClasses)
Creates simple row renders with a given Cascading Style Sheet class

Parameters:

cssClasses
Array of CSS class names

Returns array of row renderers that use those style classes.

createRowRenderers(java.util.Map[])

  protected IxTableRow[] createRowRenderers(Map[] attributes)
Creates more complicated row renderes with a given set of attributes

Parameters:

attributes
Array of maps containing name/value attribute pairs

Returns array of row renderers that use those attributes.

getClosureTags()

  protected String[] getClosureTags()
TABLE elements require a matching end tag.

Overrides: com.borland.internetbeans.IxComponent.getClosureTags()

getColumn(int)

  public IxTableColumn getColumn(int columnIndex)
Returns the column object for the given column in the table.

Parameters:

columnIndex
Column number in the table view

Returns column object for that column.

getDefaultRenderer(java.lang.Class)

  public IxTableCellRenderer getDefaultRenderer(Class columnClass)
Gets cell renderer from the default list. The default default renderer is the one assigned to the null class. Sets default cell renderers by class. If a cell renderer is not assigned specifically to the corresponding IxTableColumn a renderer will be chosen from the default list, based on the class of the content in the column. The default default renderer is the one assigned to the null class.

getElementType()

  protected String getElementType()
Returns the tag name "table".

Overrides: com.borland.internetbeans.IxComponent.getElementType()

getValueAt(int, int)

  public Object getValueAt(int row, int column)
Returns the cell value at row and column.

Note: The column is specified in the table view's display order, and not in the column order of the TableModel. This is an important distinction because the table may be hiding some columns, or displaying them in a different order.

Parameters:

row
The row whose value is to be looked up
column
The column whose value is to be looked up

Returns the Object at the specified cell.

isElementEmpty()

  protected boolean isElementEmpty()
Tables are never empty.

Overrides: com.borland.internetbeans.IxComponent.isElementEmpty()

mergeBody(units, int, int)

  public void mergeBody(ParseUnit[] units, int beginIndex, int endIndex)
Called by PageProducer; do not call directly. Reads the table in the template source markup (if any) to determine the columns to display and replicate the formatting.

Parameters:

units
Array of ParseUnit objects that the PageProducer is currently working its way through
beginIndex
Index into units array that points to element after start tag. If the element body is empty, it points to the end tag.
endIndex
Index into units array that points to element after last unit that comprises body. If the element body is empty, it is the same as beginIndex and points to the end tag.

Overrides: com.borland.internetbeans.IxComponent.mergeBody(units, int, int)

normalizeText(java.lang.String)

  protected static String normalizeText(String arg)
Remove non-alpha characters and convert to uppercase.

setBodyRowAttributes(java.util.Map[])

  protected void setBodyRowAttributes(Map[] attributes)
Creates the row renders to render body rows with the given attributes. Simple tables have one table row per data row, but there can be more.

Parameters:

attributes
Array of maps containing attribute name/value pairs

setDefaultRenderer(java.lang.Class, renderer)

  public void setDefaultRenderer(Class columnClass, IxTableCellRenderer renderer)
Sets default cell renderers by class. If a cell renderer is not assigned specifically to the corresponding IxTableColumn a renderer will be chosen from the default list, based on the class of the content in the column. The default default renderer is the one assigned to the null class.

Parameters:

columnClass
Class to associate with renderer
renderer
Renderer to use for class

setHeaderRowAttributes(java.util.Map[])

  protected void setHeaderRowAttributes(Map[] attributes)
Creates the row renders to render header rows with the given attributes. Simple tables have only one header row, so there is only one set of attributes; but more complicated tables -- with more than one table row per data row -- can have more than one header row.

Parameters:

attributes
Array of maps containing attribute name/value pairs.