public interface ElementTable extends ElementTableBase
The generic table structure is:
<tableParent> <row> ... <optRowContent> <cell> <opt1>...<optN>Pattern</optN>...</opt1> </cell> ... </optRowContent> ... </row> ... </tableParent>
The starting point usually is a DOM table with a single row containing one or several cells this row is save as the pattern (really a deep clone) and used when new rows are added, the first cell of the pattern is used to create new cells (for instance a new column). The initial DOM table (including the row pattern) may be initially cleared or kept as is when this object is created and attached to the underlying DOM table.
This type of table helps to render a table of values into the DOM element table,
for instance, this interface support "out the box" the typical DOM element table where
every cell element contains some value usually as the data of a text node.
Methods to add new cells include optionally a value
parameter.
The structure and renderer objects are used to customize how and where this value is saved in the table
beyond the default cases.
Columns can be added or removed, if a column is removed/added the same column
is removed/added to the row pattern too (in fact the table may be empty, no rows, but getColumnCount()
may be non-zero), the cell pattern is used to add new cells to the row pattern
if necessary. All rows have the same number of columns.
By default a just created table has one row if the row pattern is not removed or zero rows if removed and as many columns as declared in the row pattern.
A pattern based DOM Element table ever works in "master" mode ElementListFree.isMaster()
ElementGroupManager.createElementTable(Element,boolean)
Modifier and Type | Method and Description |
---|---|
org.w3c.dom.Element[] |
addColumn()
Adds a new column at the end of columns using the cell pattern.
|
org.w3c.dom.Element[] |
addColumn(java.util.List<java.lang.Object> columnData)
Adds a new column at the end of columns using the cell pattern, and renders the specified values using
the current structure and renderer.
|
org.w3c.dom.Element[] |
addColumn(java.lang.Object[] columnData)
Adds a new column at the end of columns using the cell pattern, and renders the specified values using
the current structure and renderer.
|
org.w3c.dom.Element |
addRow()
Adds a new row element at the end of the table using the row pattern (the new row is a clone).
|
org.w3c.dom.Element |
addRow(java.util.List<java.lang.Object> rowData)
Adds a new row element at the end of the table using the row pattern, and renders the specified values using
the current structure and renderer.
|
org.w3c.dom.Element |
addRow(java.lang.Object[] rowData)
Adds a new row element at the end of the table using the row pattern, and renders the specified values using
the current structure and renderer.
|
org.w3c.dom.Element |
getCellContentElementAt(int row,
int column)
Returns the "content" element of the cell, this element is used to render below
the associated value of the cell.
|
org.w3c.dom.DocumentFragment |
getCellContentPatternFragment()
Returns the pattern used to render values if
isUsePatternMarkupToRender()
is true. |
org.w3c.dom.Element |
getCellPatternElement()
Returns the element used as a cell pattern.
|
int |
getColumnCount()
Returns the number of columns.
|
ElementTableRenderer |
getElementTableRenderer()
Returns the current renderer used by this table.
|
ElementTableStructure |
getElementTableStructure()
Returns the current structure used by this table.
|
org.w3c.dom.Element |
getRowContentElementAt(int row)
Returns the "content" element of the row, this element is the parent of the row cells
This element is obtained using the current structure.
|
org.w3c.dom.Element |
getRowPatternElement()
Returns the element used as a row pattern.
|
org.w3c.dom.Element[] |
insertColumnAt(int column)
Inserts a new column at the specified position using the cell pattern.
|
org.w3c.dom.Element[] |
insertColumnAt(int column,
java.util.List<java.lang.Object> columnData)
Inserts a new column at the specified position using the cell pattern,
and renders the specified values using
the current structure and renderer.
|
org.w3c.dom.Element[] |
insertColumnAt(int column,
java.lang.Object[] columnData)
Inserts a new column at the specified position using the cell pattern,
and renders the specified values using
the current structure and renderer.
|
org.w3c.dom.Element |
insertRowAt(int row)
Inserts a new row element at the specified position using the row pattern.
|
org.w3c.dom.Element |
insertRowAt(int row,
java.util.List<java.lang.Object> rowData)
Inserts a new row element at the specified position using the row pattern and renders the specified row values using
the current structure and renderer.
|
org.w3c.dom.Element |
insertRowAt(int row,
java.lang.Object[] rowData)
Inserts a new row element at the specified position using the row pattern, and renders the specified row values using
the current structure and renderer.
|
boolean |
isUsePatternMarkupToRender()
Informs whether the original (saved as pattern) markup is used to render.
|
void |
setCellValueAt(int row,
int column,
java.lang.Object value)
Renders the specified value into the cell element with the given row and column position
using the current structure and renderer.
|
void |
setColumnCount(int columnCount)
Increases or shrinks the number of columns to fit the new size.
|
void |
setColumnValuesAt(int column,
java.util.List<java.lang.Object> columnData)
Renders the specified values into the column with the given position
using the current structure and renderer.
|
void |
setColumnValuesAt(int column,
java.lang.Object[] columnData)
Renders the specified values into the column with the given position
using the current structure and renderer.
|
void |
setElementTableRenderer(ElementTableRenderer renderer)
Sets the renderer used by this table.
|
void |
setElementTableStructure(ElementTableStructure structure)
Sets the structure used by this table.
|
void |
setRowCount(int rowCount)
Increases or shrinks the number of rows to fit the new size.
|
void |
setRowValuesAt(int row,
java.util.List<java.lang.Object> rowData)
Renders the specified values into the row with the given position
using the current structure and renderer.
|
void |
setRowValuesAt(int row,
java.lang.Object[] rowData)
Renders the specified values into the row with the given position
using the current structure and renderer.
|
void |
setTableValues(java.util.List<java.util.List<java.lang.Object>> values)
Renders all table cells with new values
using the current structure and renderer.
|
void |
setTableValues(java.lang.Object[][] values)
Renders all table cells with new values
using the current structure and renderer.
|
void |
setUsePatternMarkupToRender(boolean value)
Sets whether the original (saved as pattern) markup is used to render.
|
getCellElementAt, getCellElementsOfColumn, getCellElementsOfRow, getElementRows, getFirstRowElement, getLastRowElement, getRowCount, getRowElementAt, getRowElementFromNode, getRowListElementInfoAt, getRowListElementInfoFromNode, getTableCellElementInfoAt, getTableCellElementInfoFromNode, indexOfRowElement, lastIndexOfRowElement, moveColumn, moveRow, removeAllColumns, removeAllRows, removeColumnAt, removeRowAt, removeRowRange
getElementAt, getElementFromNode, getElements, getFirstElement, getLastElement, getListElementInfoAt, getListElementInfoFromNode, indexOfElement, isEmpty, lastIndexOfElement, moveElement, removeAllElements, removeElementAt, removeElementRange
getItsNatDocument, getParentElement
containsUserValueName, getUserValue, getUserValueNames, removeUserValue, setUserValue
ElementTableStructure getElementTableStructure()
setElementTableStructure(ElementTableStructure)
void setElementTableStructure(ElementTableStructure structure)
structure
- the new structure.getElementTableStructure()
ElementTableRenderer getElementTableRenderer()
setElementTableRenderer(ElementTableRenderer)
void setElementTableRenderer(ElementTableRenderer renderer)
renderer
- the new renderer.getElementTableRenderer()
org.w3c.dom.Element getRowPatternElement()
org.w3c.dom.Element getCellPatternElement()
void setRowCount(int rowCount)
If the new size is bigger new rows are added at the end, if the size is lower tail rows are removed.
rowCount
- the new number of rows.ElementTableBase.getRowCount()
,
addRow()
,
ElementTableBase.removeRowAt(int)
org.w3c.dom.Element addRow()
addRow(Object[])
org.w3c.dom.Element addRow(java.lang.Object[] rowData)
rowData
- the row values to render.addRow()
,
getElementTableStructure()
,
getElementTableRenderer()
,
ElementTableStructure
,
ElementTableRenderer.renderTable(ElementTable,int,int,Object,Element,boolean)
org.w3c.dom.Element addRow(java.util.List<java.lang.Object> rowData)
rowData
- the row values to render.addRow(Object[])
org.w3c.dom.Element insertRowAt(int row)
row
- index of the new row.insertRowAt(int,Object[])
org.w3c.dom.Element insertRowAt(int row, java.lang.Object[] rowData)
row
- index of the new row.rowData
- the row values to render.insertRowAt(int)
,
getElementTableStructure()
,
getElementTableRenderer()
,
ElementTableStructure
,
ElementTableRenderer.renderTable(ElementTable,int,int,Object,Element,boolean)
org.w3c.dom.Element insertRowAt(int row, java.util.List<java.lang.Object> rowData)
row
- index of the new row.rowData
- the row values to render.insertRowAt(int,Object[])
void setRowValuesAt(int row, java.lang.Object[] rowData)
row
- index of the row.rowData
- the row values to render.insertRowAt(int,Object[])
,
getElementTableStructure()
,
getElementTableRenderer()
,
ElementTableStructure
,
ElementTableRenderer.renderTable(ElementTable,int,int,Object,Element,boolean)
void setRowValuesAt(int row, java.util.List<java.lang.Object> rowData)
row
- index of the row.rowData
- the row values to render.setRowValuesAt(int,Object[])
org.w3c.dom.Element getRowContentElementAt(int row)
row
- index of the row.getElementTableStructure()
,
ElementTableStructure.getRowContentElement(ElementTable,int,Element)
org.w3c.dom.Element getCellContentElementAt(int row, int column)
row
- index of the row.getElementTableStructure()
,
ElementTableStructure.getCellContentElement(ElementTable,int,int,Element)
org.w3c.dom.Element[] addColumn()
addColumn(Object[])
org.w3c.dom.Element[] addColumn(java.lang.Object[] columnData)
columnData
- the column values to render.addColumn()
,
getElementTableStructure()
,
getElementTableRenderer()
,
ElementTableStructure
,
ElementTableRenderer.renderTable(ElementTable,int,int,Object,Element,boolean)
org.w3c.dom.Element[] addColumn(java.util.List<java.lang.Object> columnData)
columnData
- the column values to render.addColumn(Object[])
org.w3c.dom.Element[] insertColumnAt(int column)
column
- index of the new column.insertColumnAt(int,Object[])
org.w3c.dom.Element[] insertColumnAt(int column, java.lang.Object[] columnData)
column
- index of the new column.columnData
- the column values to render.insertColumnAt(int)
,
getElementTableStructure()
,
getElementTableRenderer()
,
ElementTableStructure
,
ElementTableRenderer.renderTable(ElementTable,int,int,Object,Element,boolean)
org.w3c.dom.Element[] insertColumnAt(int column, java.util.List<java.lang.Object> columnData)
column
- index of the new column.columnData
- the column values to render.insertColumnAt(int,Object[])
void setColumnValuesAt(int column, java.lang.Object[] columnData)
column
- index of the column.columnData
- the column values to render.insertColumnAt(int,Object[])
,
getElementTableStructure()
,
getElementTableRenderer()
,
ElementTableStructure
,
ElementTableRenderer.renderTable(ElementTable,int,int,Object,Element,boolean)
void setColumnValuesAt(int column, java.util.List<java.lang.Object> columnData)
column
- index of the column.columnData
- the column values to render.setColumnValuesAt(int,Object[])
int getColumnCount()
setColumnCount(int)
void setColumnCount(int columnCount)
If the new size is bigger new columns are added at the end, if the size is lower tail columns are removed.
columnCount
- the new number of columns.getColumnCount()
,
addColumn()
,
ElementTableBase.removeColumnAt(int)
void setCellValueAt(int row, int column, java.lang.Object value)
row
- row of the cell.column
- column of the cell.value
- the value to render.getElementTableStructure()
,
getElementTableRenderer()
,
ElementTableStructure
,
ElementTableRenderer.renderTable(ElementTable,int,int,Object,Element,boolean)
void setTableValues(java.lang.Object[][] values)
values
- the values to render.getElementTableStructure()
,
getElementTableRenderer()
,
ElementTableStructure
,
ElementTableRenderer.renderTable(ElementTable,int,int,Object,Element,boolean)
void setTableValues(java.util.List<java.util.List<java.lang.Object>> values)
values
- the values to render.setTableValues(Object[][])
boolean isUsePatternMarkupToRender()
The default value is defined by ItsNatDocument.isUsePatternMarkupToRender()
setUsePatternMarkupToRender(boolean)
void setUsePatternMarkupToRender(boolean value)
value
- true to enable the use of original markup to render.isUsePatternMarkupToRender()
org.w3c.dom.DocumentFragment getCellContentPatternFragment()
isUsePatternMarkupToRender()
is true.Copyright © 2007 Innowhere Software Services S.L. All Rights Reserved.