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.comp;
15:
16: import org.w3c.dom.Element;
17:
18: /**
19: * Used by tree components to locate the required elements of the table layout.
20: *
21: * @author Jose Maria Arranz Santamaria
22: * @see ItsNatComponentManager#createDefaultItsNatTreeStructure()
23: * @see ItsNatTree#getItsNatTreeStructure()
24: * @see org.itsnat.core.domutil.ElementTreeNodeStructure
25: */
26: public interface ItsNatTreeStructure {
27: /**
28: * Returns the content element of a tree node.
29: *
30: * <p>Default implementation delegates to the default {@link org.itsnat.core.domutil.ElementTreeNodeStructure}.</p>
31: *
32: * @param tree the tree component, may be used to provide contextual information. Default implementation ignores it.
33: * @param row the tree node row (seeing the tree as a list).
34: * @param nodeParent the element containing the tree node markup.
35: * Is a hint, if provided should be obtained by calling <code>tree.getItsNatTreeUI().getParentElementFromRow(row)</code>.
36: * @return the content element of the tree node.
37: */
38: public Element getContentElement(ItsNatTree tree, int row,
39: Element nodeParent);
40:
41: /**
42: * Returns the handle element of a tree node.
43: *
44: * <p>Default implementation delegates to the default {@link org.itsnat.core.domutil.ElementTreeNodeStructure}.</p>
45: *
46: * @param tree the tree component, may be used to provide contextual information. Default implementation ignores it.
47: * @param row the tree node row (seeing the tree as a list).
48: * @param nodeParent the element containing the tree node markup.
49: * Is a hint, if provided should be obtained by calling <code>tree.getItsNatTreeUI().getParentElementFromRow(row)</code>.
50: * @return the handle element of the tree node.
51: */
52: public Element getHandleElement(ItsNatTree tree, int row,
53: Element nodeParent);
54:
55: /**
56: * Returns the icon element of a tree node.
57: *
58: * <p>Default implementation delegates to the default {@link org.itsnat.core.domutil.ElementTreeNodeStructure}.</p>
59: *
60: * @param tree the tree component, may be used to provide contextual information. Default implementation ignores it.
61: * @param row the tree node row (seeing the tree as a list).
62: * @param nodeParent the element containing the tree node markup.
63: * Is a hint, if provided should be obtained by calling <code>tree.getItsNatTreeUI().getParentElementFromRow(row)</code>.
64: * @return the icon element of the tree node.
65: */
66: public Element getIconElement(ItsNatTree tree, int row,
67: Element nodeParent);
68:
69: /**
70: * Returns the label element of a tree node. This element is used to render and edit
71: * the tree node value.
72: *
73: * <p>Default implementation delegates to the default {@link org.itsnat.core.domutil.ElementTreeNodeStructure}.</p>
74: *
75: * @param tree the tree component, may be used to provide contextual information. Default implementation ignores it.
76: * @param row the tree node row (seeing the tree as a list).
77: * @param nodeParent the element containing the tree node markup.
78: * Is a hint, if provided should be obtained by calling <code>tree.getItsNatTreeUI().getParentElementFromRow(row)</code>.
79: * @return the label element of the tree node.
80: * @see ItsNatTreeCellRenderer
81: * @see ItsNatTreeCellEditor
82: */
83: public Element getLabelElement(ItsNatTree tree, int row,
84: Element nodeParent);
85:
86: /**
87: * Returns the element containing the child tree nodes of the specified tree node.
88: *
89: * <p>Default implementation delegates to the default {@link org.itsnat.core.domutil.ElementTreeNodeStructure}.</p>
90: *
91: * @param tree the tree component, may be used to provide contextual information. Default implementation ignores it.
92: * @param row the tree node row (seeing the tree as a list).
93: * @param nodeParent the element containing the tree node markup.
94: * Is a hint, if provided should be obtained by calling <code>tree.getItsNatTreeUI().getParentElementFromRow(row)</code>.
95: * @return the element containing the child list.
96: */
97: public Element getChildListElement(ItsNatTree tree, int row,
98: Element nodeParent);
99: }
|