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 ElementTreeVersatileRootlessImpl extends
28: ElementTreeVersatileImpl {
29: protected ElementTreeNodeListImpl treeNodeList;
30:
31: /** Creates a new instance of ElementTreeVersatileRootlessImpl */
32: public ElementTreeVersatileRootlessImpl(
33: ItsNatDocumentImpl itsNatDoc, boolean treeTable,
34: Element parentElement, boolean removePattern,
35: ElementTreeNodeStructure structure,
36: ElementTreeNodeRenderer renderer) {
37: this .treeNodeList = itsNatDoc
38: .createElementTreeNodeListInternal(treeTable,
39: parentElement, removePattern, structure,
40: renderer);
41: }
42:
43: public boolean isRootless() {
44: return true;
45: }
46:
47: public ElementTreeNodeImpl getRootNode() {
48: return null;
49: }
50:
51: public ElementTreeNodeImpl addRootNode() {
52: throw new ItsNatException("Rootless tree");
53: }
54:
55: public void removeRootNode() {
56: treeNodeList.removeAllTreeNodes();
57: }
58:
59: public ElementTreeNodeImpl getElementTreeNodeFromRow(int row) {
60: return treeNodeList.getElementTreeNodeFromRow(row);
61: }
62:
63: public ElementTreeNodeImpl getElementTreeNodeFromNode(Node node) {
64: return (ElementTreeNodeImpl) treeNodeList
65: .getElementTreeNodeFromNode(node);
66: }
67:
68: public ElementTreeNodeListImpl getChildListRootless() {
69: return treeNodeList;
70: }
71:
72: public boolean isUsePatternMarkupToRender() {
73: return treeNodeList.isUsePatternMarkupToRender();
74: }
75:
76: public void setUsePatternMarkupToRender(boolean value) {
77: treeNodeList.setUsePatternMarkupToRender(value);
78: }
79: }
|