org.itsnat.comp.table
Interface ItsNatTableStructure


public interface ItsNatTableStructure

Used by table components to locate the required elements of the table layout.

Default implementation respects the normal layout of HTML <table> structures, if no HTML table is involved (free table) then is expected a similar layout than in an HTML table.

Author:
Jose Maria Arranz Santamaria
See Also:
ItsNatComponentManager.createDefaultItsNatTableStructure(), ItsNatTable.getItsNatTableStructure(), ElementTableStructure

Method Summary
 org.w3c.dom.Element getBodyElement(ItsNatTable table, org.w3c.dom.Element tableElem)
          Returns the table body element.
 org.w3c.dom.Element getCellContentElement(ItsNatTable table, int row, int col, org.w3c.dom.Element cellElem)
          Returns the content element of a table cell.
 org.w3c.dom.Element getHeadElement(ItsNatTable table, org.w3c.dom.Element tableElem)
          Returns the table head element.
 org.w3c.dom.Element getHeaderColumnContentElement(ItsNatTableHeader tableHeader, int column, org.w3c.dom.Element itemElem)
          Returns the content element of a table header column.
 org.w3c.dom.Element getRowContentElement(ItsNatTable table, int row, org.w3c.dom.Element rowElem)
          Returns the content element of a table row.
 

Method Detail

getHeadElement

org.w3c.dom.Element getHeadElement(ItsNatTable table,
                                   org.w3c.dom.Element tableElem)
Returns the table head element.

Default implementation returns (if exists) the <thead> element if the table element is a <table>, else (free table) returns the first child element if the table contains more than one child element, else returns null (no head).

Parameters:
table - the table component, may be used to provide contextual information. Default implementation ignores it.
tableElem - the parent element of the table. Is a hint, if provided should be obtained by calling table.getElement().
Returns:
the head element. May be null.

getBodyElement

org.w3c.dom.Element getBodyElement(ItsNatTable table,
                                   org.w3c.dom.Element tableElem)
Returns the table body element.

Default implementation returns (if exists) the first <tbody> element if the table element is a <table>, else (free table) returns the second child element if the table contains more than one child element, else returns the table element (the one child element is considered a row pattern). Never is null.

Parameters:
table - the table component, may be used to provide contextual information. Default implementation ignores it.
tableElem - the parent element of the table. Is a hint, if provided should be obtained by calling table.getElement().
Returns:
the body element.

getRowContentElement

org.w3c.dom.Element getRowContentElement(ItsNatTable table,
                                         int row,
                                         org.w3c.dom.Element rowElem)
Returns the content element of a table row. This element is used as the parent of table cell elements.

Default implementation delegates to the default ElementTableStructure.

Parameters:
table - the table component, may be used to provide contextual information. Default implementation ignores it.
row - index of the row.
rowElem - the element containing the row (row element). This element is a hint, if provided, should be the same as returned by table.getItsNatTableUI().getRowElementAt(row).
Returns:
the row content element.

getCellContentElement

org.w3c.dom.Element getCellContentElement(ItsNatTable table,
                                          int row,
                                          int col,
                                          org.w3c.dom.Element cellElem)
Returns the content element of a table cell. This element is used to render the cell value.

Default implementation delegates to the default ElementTableStructure.

Parameters:
table - the table component, may be used to provide contextual information. Default implementation ignores it.
row - index of the row.
col - index of the column.
cellElem - the element containing the cell (cell element). This element is a hint, if provided, should be the same as returned by table.getItsNatTableUI().getCellElementAt(row,col).
Returns:
the cell content element.
See Also:
ItsNatTableCellRenderer

getHeaderColumnContentElement

org.w3c.dom.Element getHeaderColumnContentElement(ItsNatTableHeader tableHeader,
                                                  int column,
                                                  org.w3c.dom.Element itemElem)
Returns the content element of a table header column. This element is used to render header column.

Default implementation delegates to the default ElementListStructure.

Parameters:
tableHeader - the table header component, may be used to provide contextual information. Default implementation ignores it.
column - the column index.
itemElem - the element containing the column markup in this position. Is a hint, if provided should be obtained by calling tableHeader.getItsNatTableHeaderUI().getColumnElementAt(index).
Returns:
the content element.
See Also:
ItsNatTableHeaderCellRenderer


Copyright © 2007 Innowhere Software Services S.L. All Rights Reserved.