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 table cell value is edited in place.
21: *
22: * @author Jose Maria Arranz Santamaria
23: * @see ItsNatComponentManager#createDefaultItsNatTableCellEditor(ItsNatComponent)
24: * @see ItsNatTable#getItsNatTableCellEditor()
25: */
26: public interface ItsNatTableCellEditor extends CellEditor {
27: /**
28: * Returns the component used to edit in place the table cell value.
29: *
30: * <p>Default implementation uses a {@link org.itsnat.comp.html.ItsNatHTMLInputText} (text not formatted version) to edit
31: * the table cell value.</p>
32: *
33: * <p>Default implementation ignores <code>isSelected</code> parameter.</p>
34: *
35: * @param table the table component, may be used to provide contextual information. Default implementation ignores it.
36: * @param row the cell row.
37: * @param column the cell column.
38: * @param value the value to edit (initial value).
39: * @param isSelected true if the cell is selected.
40: * @param cellContentElem the table cell content element to render the value into. Is a hint, if provided should be obtained by calling <code>table.getItsNatTableUI().getCellContentElement(row,column)</code>.
41: * @return the component used to edit in place the table cell value. Current implementation of tables does nothing with this component and may be null (is not mandatory to use a single component as an editor).
42: * @see ItsNatTable#setItsNatTableCellEditor(ItsNatTableCellEditor)
43: */
44: public ItsNatComponent getTableCellEditorComponent(
45: ItsNatTable table, int row, int column, Object value,
46: boolean isSelected, Element cellContentElem);
47: }
|