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.impl.comp.free;
15:
16: import org.itsnat.comp.free.ItsNatFreeTable;
17: import org.itsnat.comp.free.ItsNatFreeTableHeader;
18: import org.itsnat.comp.ItsNatTableStructure;
19: import org.itsnat.comp.ui.ItsNatComponentUI;
20: import org.itsnat.comp.ui.ItsNatTableUI;
21: import org.itsnat.core.ItsNatException;
22: import org.itsnat.core.NameValue;
23: import org.itsnat.impl.comp.*;
24: import org.itsnat.impl.comp.ui.free.ItsNatFreeTableUIImpl;
25: import org.w3c.dom.Element;
26: import org.w3c.dom.Node;
27:
28: /**
29: * Ejemplos de prototipos posibles (tags inventados):
30: * 1) Caso de header y body:
31: * <tableParent>
32: * <header><item>..</item><item>..</item></header>
33: * <body>
34: * <row><item>..</item><item>..</item></row>
35: * </body>
36: * </tableParent>
37: * 2) Caso de sólo body:
38: * <tableParent>
39: * <row><item>..</item><item>..</item></row>
40: * </tableParent>
41: * En el caso 2) es fundamental que sólo exista una fila patrón
42: * para detectar que no hay header
43: *
44: * @author jmarranz
45: */
46: public class ItsNatFreeTableImpl extends ItsNatTableImpl implements
47: ItsNatFreeTable {
48: /** Creates a new instance of ItsNatFreeTableImpl */
49: public ItsNatFreeTableImpl(Element parentElem,
50: ItsNatTableStructure structure, NameValue[] artifacts,
51: ItsNatComponentManagerImpl componentMgr) {
52: super (parentElem, structure, artifacts, componentMgr);
53:
54: init();
55: }
56:
57: public ItsNatFreeTableHeader getItsNatFreeTableHeader() {
58: return (ItsNatFreeTableHeader) header;
59: }
60:
61: public ItsNatTableUI createDefaultItsNatFreeTableUI() {
62: return new ItsNatFreeTableUIImpl(this );
63: }
64:
65: public ItsNatComponentUI createDefaultItsNatComponentUI() {
66: return createDefaultItsNatFreeTableUI();
67: }
68:
69: public ItsNatTableHeaderImpl createItsNatTableHeader(
70: Element headerElem) {
71: return new ItsNatFreeTableHeaderImpl(this , headerElem);
72: }
73:
74: public Node createDefaultNode() {
75: throw new ItsNatException(
76: "There is no default Element and later attachment is not allowed");
77: }
78: }
|