01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package org.wings;
14:
15: /**
16: * Display area for a short text string.
17: *
18: * This text is not interpreted.
19: * Use for inserting raw text or even html snipplets.
20: *
21: * @author <a href="mailto:ole@freiheit.com">Ole Langbehn</a>
22: */
23: public class SRawTextComponent extends SComponent {
24:
25: /**
26: * The text to be displayed
27: */
28: protected String text;
29:
30: /**
31: * Creates a new <code>SRawTextComponent</code> instance with the specified text
32: *
33: * @param text The text to be displayed by the component.
34: */
35: public SRawTextComponent(String text) {
36: this .text = text;
37: }
38:
39: /**
40: * Creates a new <code>SRawTextComponent</code> instance with no text.
41: */
42: public SRawTextComponent() {
43: this ((String) null);
44: }
45:
46: /**
47: * Returns the text of the component
48: */
49: public String getText() {
50: return text;
51: }
52:
53: /**
54: * Sets the text of the component. If the value of text is null or an empty
55: * string, nothing is displayed.
56: *
57: * @param t The new text
58: */
59: public void setText(String t) {
60: reloadIfChange(text, t);
61: text = t;
62: }
63: }
|