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.itsnat.core.domutil.ElementRenderer;
17:
18: /**
19: * Is the base interface of button components with a label.
20: *
21: * <p>The label is set calling {@link #setLabelValue(Object)}. If never called
22: * this component does not change the original markup. A renderer is used to
23: * render the label as markup.</p>
24: *
25: * @author Jose Maria Arranz Santamaria
26: */
27: public interface ItsNatButtonLabel extends ItsNatButton {
28: /**
29: * Returns the current label.
30: *
31: * <p>Returned value is the value set by the last call to {@link #setLabelValue(Object)}.</p>
32: *
33: * @return the current label value. Null by default.
34: * @see #setLabelValue(Object)
35: */
36: public Object getLabelValue();
37:
38: /**
39: * Sets the current label value, this value is saved as is and rendered
40: * as markup using the current renderer returned by {@link #getElementRenderer()}.
41: *
42: * @param value the new label value.
43: * @see #getLabelValue()
44: */
45: public void setLabelValue(Object value);
46:
47: /**
48: * Returns the current renderer used to render the label as markup.
49: *
50: * <p>By default uses the default renderer returned by
51: * {@link org.itsnat.core.ItsNatDocument#createDefaultElementRenderer()}. Only
52: * {@link org.itsnat.comp.html.ItsNatHTMLInputReset},
53: * {@link org.itsnat.comp.html.ItsNatHTMLInputSubmit},
54: * and {@link org.itsnat.comp.html.ItsNatHTMLInputButton}
55: * components use by default an internal
56: * renderer to render the label as the value of the "value" attribute
57: * of the <input> element.</p>
58: *
59: * @return the current renderer.
60: * @see #setLabelValue(Object)
61: * @see #setElementRenderer(ElementRenderer)
62: */
63: public ElementRenderer getElementRenderer();
64:
65: /**
66: * Sets the current renderer.
67: *
68: * @param renderer the new renderer.
69: * @see #getElementRenderer()
70: */
71: public void setElementRenderer(ElementRenderer renderer);
72: }
|