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 label value is edited in place.
21: *
22: * @author Jose Maria Arranz Santamaria
23: * @see ItsNatComponentManager#createDefaultItsNatLabelEditor(ItsNatComponent)
24: * @see ItsNatLabel#getItsNatLabelEditor()
25: */
26: public interface ItsNatLabelEditor extends CellEditor {
27: /**
28: * Returns the component used to edit in place the label value.
29: *
30: * <p>Default implementation uses a {@link org.itsnat.comp.html.ItsNatHTMLInputText} (text not formatted version) to edit
31: * the label value.</p>
32: *
33: * @param label the label component, may be used to provide contextual information. Default implementation ignores it.
34: * @param value the value to edit (initial value).
35: * @param labelElem the label element to render the value into. Is a hint, if provided should be obtained by calling {@link ItsNatLabel#getElement()}.
36: * @return the component used to edit in place the label value. Current implementation of labels does nothing with this component and may be null (is not mandatory to use a single component as an editor).
37: * @see ItsNatLabel#setItsNatLabelEditor(ItsNatLabelEditor)
38: */
39: public ItsNatComponent getLabelEditorComponent(ItsNatLabel label,
40: Object value, Element labelElem);
41: }
|