01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.core.domutil;
15:
16: import org.w3c.dom.Element;
17:
18: /**
19: * Used by {@link ElementTable} objects to obtain row and cell content elements.
20: *
21: * @see ElementTable#setElementTableStructure(ElementTableStructure)
22: * @see org.itsnat.core.ItsNatDocument#createDefaultElementTableStructure()
23: * @author Jose Maria Arranz Santamaria
24: */
25: public interface ElementTableStructure {
26: /**
27: * Returns the content element of a row.
28: *
29: * <p>A row content element is the direct parent element of the row cells.
30: * This element is used to access the row cells.</p>
31: *
32: * @param table the target table, may be used to provide contextual information. Default implementation ignores it.
33: * @param row index of the row.
34: * @param rowElem the element containing the row (row element).
35: * This element is a hint, if provided, should be the same as returned by <code>table.getRowElementAt(index)</code>.
36: * @return the row content element. Default implementation returns <code>rowElem</code>.
37: * @see ElementTableRenderer#renderTable(ElementTable,int,int,Object,Element,boolean)
38: */
39: public Element getRowContentElement(ElementTable table, int row,
40: Element rowElem);
41:
42: /**
43: * Returns the content element of a cell.
44: *
45: * <p>The cell content element is the parent element containing the markup of the associated
46: * value usually a text node. This element is passed to the renderer method
47: * {@link ElementTableRenderer#renderTable(ElementTable,int,int,Object,Element,boolean)}.</p>
48: *
49: * @param table the target table, may be used to provide contextual information. Default implementation ignores it.
50: * @param row index of the row.
51: * @param col index of the column.
52: * @param cellElem the element containing the cell (cell element).
53: * This element is a hint, if provided, should be the same as returned by <code>table.getCellElementAt(row,col)</code>.
54: * @return the cell content element. Default implementation returns <code>cellElem</code>.
55: */
56: public Element getCellContentElement(ElementTable table, int row,
57: int col, Element cellElem);
58: }
|