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 javax.swing.CellEditor;
17: import org.w3c.dom.Element;
18:
19: /**
20: * Used to specify how a tree node value is edited in place.
21: *
22: * @author Jose Maria Arranz Santamaria
23: * @see ItsNatComponentManager#createDefaultItsNatTreeCellEditor(ItsNatComponent)
24: * @see ItsNatTree#getItsNatTreeCellEditor()
25: */
26: public interface ItsNatTreeCellEditor extends CellEditor {
27: /**
28: * Returns the component used to edit in place the tree node value.
29: *
30: * <p>Default implementation uses a {@link org.itsnat.comp.html.ItsNatHTMLInputText} (text not formatted version) to edit
31: * the tree node value.</p>
32: *
33: * <p>Default implementation ignores <code>isSelected</code> parameter.</p>
34: *
35: * @param tree the tree component, may be used to provide contextual information. Default implementation ignores it.
36: * @param row the tree node row (seeing the tree as a list).
37: * @param value the value to edit (initial value).
38: * @param isSelected true if the tree node is selected.
39: * @param isExpanded true if the tree node is expanded.
40: * @param isLeaf true if the tree node is a leaf.
41: * @param labelElem the tree node label element to render the value into. Is a hint, if provided should be obtained by calling <code>tree.getItsNatTreeUI().getLabelElementFromRow(row)</code>.
42: * @return the component used to edit in place the tree node value. Current implementation of trees does nothing with this component and may be null (is not mandatory to use a single component as an editor).
43: * @see ItsNatTree#setItsNatTreeCellEditor(ItsNatTreeCellEditor)
44: */
45: public ItsNatComponent getTreeCellEditorComponent(ItsNatTree tree,
46: int row, Object value, boolean isSelected,
47: boolean isExpanded, boolean isLeaf, Element labelElem);
48: }
|