01: /*
02: #IFNDEF ALT_LICENSE
03: ThinWire(R) RIA Ajax Framework
04: Copyright (C) 2003-2007 Custom Credit Systems
05:
06: This library is free software; you can redistribute it and/or modify it under
07: the terms of the GNU Lesser General Public License as published by the Free
08: Software Foundation; either version 2.1 of the License, or (at your option) any
09: later version.
10:
11: This library is distributed in the hope that it will be useful, but WITHOUT ANY
12: WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13: PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14:
15: You should have received a copy of the GNU Lesser General Public License along
16: with this library; if not, write to the Free Software Foundation, Inc., 59
17: Temple Place, Suite 330, Boston, MA 02111-1307 USA
18:
19: Users who would rather have a commercial license, warranty or support should
20: contact the following company who invented, built and supports the technology:
21:
22: Custom Credit Systems, Richardson, TX 75081, USA.
23: email: info@thinwire.com ph: +1 (888) 644-6405
24: http://www.thinwire.com
25: #ENDIF
26: [ v1.2_RC2 ]
27: */
28: package thinwire.ui;
29:
30: /**
31: * This is a multiline text field screen element.
32: * <p>
33: * <b>Example:</b> <br>
34: * <img src="doc-files/TextArea-1.png"> <br>
35: *
36: * <pre>
37: * Dialog dlg = new Dialog();
38: * dlg.setBounds(25, 25, 325, 225);
39: * dlg.setTitle("TextArea Test");
40: *
41: * TextArea tArea = new TextArea();
42: * tArea.setBounds(25, 25, 275, 100);
43: *
44: * Label lbl = new Label();
45: * lbl.setBounds(25, 150, 275, 30);
46: * lbl.setLabelFor(tArea);
47: *
48: * tArea.addPropertyChangeListener(TextArea.PROPERTY_TEXT, new PropertyChangeListener() {
49: * public void propertyChange(PropertyChangeEvent ev) {
50: * TextArea source = (TextArea) ev.getSource();
51: * source.getLabel().setText("Text Length (updated when TextArea loses focus): "
52: * + source.getText().length());
53: * }
54: * });
55: *
56: * tArea.setText("Sample text for the TextArea");
57: *
58: * dlg.getChildren().add(tArea);
59: * dlg.getChildren().add(lbl);
60: * dlg.setVisible(true);
61: * </pre>
62: *
63: * </p>
64: *
65: * @author Joshua J. Gertzen
66: */
67: public class TextArea extends AbstractEditorComponent {
68: /**
69: * Constructs a new TextArea with no text.
70: */
71: public TextArea() {
72: }
73:
74: /**
75: * Constructs a new TextArea with the specified text.
76: * @param text the text to display in the TextArea.
77: */
78: public TextArea(String text) {
79: setText(text);
80: }
81: }
|