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.ui;
15:
16: import org.itsnat.comp.ItsNatLabel;
17:
18: /**
19: * Is the base interface of the User Interface of a label component.
20: *
21: * <p>The the current label renderer is used.</p>
22: *
23: * <p>Current implementation relays heavily on
24: * {@link org.itsnat.core.domutil.ElementLabel}.</p>
25: *
26: * @author Jose Maria Arranz Santamaria
27: * @see ItsNatLabel#getItsNatLabelUI()
28: * @see ItsNatLabel#getItsNatLabelRenderer()
29: */
30: public interface ItsNatLabelUI extends ItsNatElementComponentUI {
31: /**
32: * Returns the associated component object.
33: *
34: * @return the component object.
35: */
36: public ItsNatLabel getItsNatLabel();
37:
38: /**
39: * Adds the original markup content to the label (now supposed empty) and renders
40: * the specified value.
41: *
42: * @param value the value to render.
43: * @see #removeLabelMarkup()
44: * @see org.itsnat.core.domutil.ElementLabel#setLabelValue(Object)
45: */
46: public void addLabelMarkup(Object value);
47:
48: /**
49: * Removes the current label content.
50: *
51: * @see #addLabelMarkup(Object)
52: */
53: public void removeLabelMarkup();
54:
55: /**
56: * Updates the label markup rendering the new value.
57: *
58: * @param value the new value to render.
59: */
60: public void setLabelValue(Object value);
61:
62: /**
63: * Informs whether this label contains markup.
64: *
65: * @return true if this label contains markup.
66: */
67: public boolean hasLabelMarkup();
68:
69: /**
70: * Informs whether the original (saved as pattern) markup is used to render.
71: *
72: * <p>The default value is defined by {@link org.itsnat.core.ItsNatDocument#isUsePatternMarkupToRender()}</p>
73: *
74: * @return true if the original markup is used.
75: * @see #setUsePatternMarkupToRender(boolean)
76: */
77: public boolean isUsePatternMarkupToRender();
78:
79: /**
80: * Sets whether the original (saved as pattern) markup is used to render.
81: *
82: * @param value true to enable the use of original markup to render.
83: * @see #isUsePatternMarkupToRender()
84: */
85: public void setUsePatternMarkupToRender(boolean value);
86: }
|