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