public interface ElementTableBase extends ElementListBase
Objects implementing this interface are attached to a real DOM element table with a single parent element, this "initial" table may be not empty, in fact it is automatically synchronized with the "real" DOM element table to show the current state when the utility object is created.
This interface only manages DOM Element objects as row and cell elements, other node types like text nodes are ignored (filtered).
Indexes are zero-based.
When a DOM element (a new row or a new cell/column) is added or removed using this interface, this element is added/removed to/from the DOM table too.
This interface inherits from ElementListBase
, the list interface
see the table as a list of rows.
Modifier and Type | Method and Description |
---|---|
org.w3c.dom.Element |
getCellElementAt(int row,
int column)
Returns the cell element at the specified row and column.
|
org.w3c.dom.Element[] |
getCellElementsOfColumn(int column)
Returns the cell elements of the specified column as an array.
|
org.w3c.dom.Element[] |
getCellElementsOfRow(int row)
Returns the cell elements of the specified row as an array.
|
org.w3c.dom.Element[] |
getElementRows()
Returns the row element list as an array.
|
org.w3c.dom.Element |
getFirstRowElement()
Returns the first row element (row at position 0).
|
org.w3c.dom.Element |
getLastRowElement()
Returns the last row element (row at position length - 1).
|
int |
getRowCount()
Returns the number of rows.
|
org.w3c.dom.Element |
getRowElementAt(int row)
Returns the row element at the specified index.
|
org.w3c.dom.Element |
getRowElementFromNode(org.w3c.dom.Node node)
Returns the row element of the table containing the specified node.
|
ListElementInfo |
getRowListElementInfoAt(int index)
Returns an object info of the row element at the specified position.
|
ListElementInfo |
getRowListElementInfoFromNode(org.w3c.dom.Node node)
Returns an object info of the row element containing the specified node (or the node
is itself a row element).
|
TableCellElementInfo |
getTableCellElementInfoAt(int row,
int column)
Returns an object info of the cell element specified by the row and column indexes.
|
TableCellElementInfo |
getTableCellElementInfoFromNode(org.w3c.dom.Node node)
Returns an object info of the cell element containing the specified node (or the node
is itself a cell element of the table).
|
int |
indexOfRowElement(org.w3c.dom.Element elem)
Returns the position of the specified row element.
|
int |
lastIndexOfRowElement(org.w3c.dom.Element elem)
Returns the position of the specified row element searching backwards.
|
void |
moveColumn(int columnIndex,
int newIndex)
Moves the column at
columnIndex to
newIndex . |
void |
moveRow(int start,
int end,
int to)
Moves one or more row elements from the inclusive range
start to
end to the to position in the table. |
void |
removeAllColumns()
Removes all columns.
|
void |
removeAllRows()
Removes all row elements.
|
void |
removeColumnAt(int column)
Removes the specified column.
|
org.w3c.dom.Element |
removeRowAt(int row)
Removes the specified row element.
|
void |
removeRowRange(int fromIndex,
int toIndex)
Removes the row elements between the specified indexes.
|
getElementAt, getElementFromNode, getElements, getFirstElement, getLastElement, getListElementInfoAt, getListElementInfoFromNode, indexOfElement, isEmpty, lastIndexOfElement, moveElement, removeAllElements, removeElementAt, removeElementRange
getItsNatDocument, getParentElement
containsUserValueName, getUserValue, getUserValueNames, removeUserValue, setUserValue
org.w3c.dom.Element removeRowAt(int row)
row
- index of the row element to remove.void removeRowRange(int fromIndex, int toIndex)
fromIndex
- low index (inclusive).toIndex
- high index (inclusive).void removeAllRows()
void moveRow(int start, int end, int to)
start
to
end
to the to
position in the table.
After the move, the row element that was at index start
will be at index to
.
The algorithm is explained in ElementListBase.moveElement(int,int,int)
.
start
- the starting element index to be movedend
- the ending element index to be movedto
- the destination of the elements to be movedint getRowCount()
org.w3c.dom.Element[] getElementRows()
org.w3c.dom.Element getRowElementAt(int row)
row
- index of the row to search.org.w3c.dom.Element getFirstRowElement()
org.w3c.dom.Element getLastRowElement()
int indexOfRowElement(org.w3c.dom.Element elem)
elem
- the element to search.int lastIndexOfRowElement(org.w3c.dom.Element elem)
The result must be the same as indexOfRowElement(Element)
because
there is no "duplicated" elements. Use this method if the specified
element is near to the end of the list.
elem
- the element to search.org.w3c.dom.Element getRowElementFromNode(org.w3c.dom.Node node)
node
- the node to search for.indexOfRowElement(Element)
,
getRowListElementInfoFromNode(Node)
ListElementInfo getRowListElementInfoAt(int index)
index
- index of the row.getRowListElementInfoFromNode(Node)
ListElementInfo getRowListElementInfoFromNode(org.w3c.dom.Node node)
node
- the node to search for.getRowElementFromNode(Node)
TableCellElementInfo getTableCellElementInfoFromNode(org.w3c.dom.Node node)
node
- the node to search for.getTableCellElementInfoAt(int,int)
TableCellElementInfo getTableCellElementInfoAt(int row, int column)
row
- row index of the cell element.column
- column index of the cell element.getTableCellElementInfoFromNode(Node)
org.w3c.dom.Element[] getCellElementsOfRow(int row)
row
- the row index.org.w3c.dom.Element getCellElementAt(int row, int column)
row
- the row index of the cell element to search.column
- the column index of the cell element to search.void removeColumnAt(int column)
column
- index of the column to remove.void removeAllColumns()
void moveColumn(int columnIndex, int newIndex)
columnIndex
to
newIndex
. The old column at columnIndex
will now be found at newIndex
. The column
that used to be at newIndex
is shifted
left or right to make room. This will not move any columns if
columnIndex
equals newIndex
.columnIndex
- the index of the column to be movednewIndex
- new index to move the columnorg.w3c.dom.Element[] getCellElementsOfColumn(int column)
column
- the column index.Copyright © 2007 Innowhere Software Services S.L. All Rights Reserved.