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.core.domutil;
15:
16: import org.itsnat.core.ItsNatException;
17: import org.itsnat.core.domutil.ElementTreeNodeRenderer;
18: import org.itsnat.core.domutil.ElementTreeNodeStructure;
19: import org.itsnat.impl.core.ItsNatDocumentImpl;
20: import org.w3c.dom.Element;
21: import org.w3c.dom.Node;
22:
23: /**
24: *
25: * @author jmarranz
26: */
27: public class ElementTreeVersatileWithRootImpl extends
28: ElementTreeVersatileImpl {
29: protected ElementTreeImpl tree;
30:
31: /** Creates a new instance of ElementTreeVersatileWithRootImpl */
32: public ElementTreeVersatileWithRootImpl(
33: ItsNatDocumentImpl itsNatDoc, boolean treeTable,
34: Element parentElement, boolean removePattern,
35: ElementTreeNodeStructure structure,
36: ElementTreeNodeRenderer renderer) {
37: this .tree = itsNatDoc.createElementTreeInternal(treeTable,
38: parentElement, removePattern, structure, renderer);
39: }
40:
41: public boolean isRootless() {
42: return false;
43: }
44:
45: public ElementTreeNodeImpl getRootNode() {
46: return (ElementTreeNodeImpl) tree.getRootNode();
47: }
48:
49: public ElementTreeNodeImpl addRootNode() {
50: return (ElementTreeNodeImpl) tree.addRootNode();
51: }
52:
53: public void removeRootNode() {
54: tree.removeRootNode();
55: }
56:
57: public ElementTreeNodeImpl getElementTreeNodeFromRow(int row) {
58: return (ElementTreeNodeImpl) tree
59: .getElementTreeNodeFromRow(row);
60: }
61:
62: public ElementTreeNodeImpl getElementTreeNodeFromNode(Node node) {
63: return (ElementTreeNodeImpl) tree
64: .getElementTreeNodeFromNode(node);
65: }
66:
67: public ElementTreeNodeListImpl getChildListRootless() {
68: throw new ItsNatException("Tree with root");
69: }
70:
71: public boolean isUsePatternMarkupToRender() {
72: return tree.isUsePatternMarkupToRender();
73: }
74:
75: public void setUsePatternMarkupToRender(boolean value) {
76: tree.setUsePatternMarkupToRender(value);
77: }
78: }
|