1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.x.impl.swing;
14
15 import javax.swing.JComponent;
16 import javax.swing.JScrollPane;
17 import javax.swing.JTextArea;
18
19 import com.eviware.soapui.support.UISupport;
20 import com.eviware.x.form.XFormTextField;
21
22 public class JMultilineLabelTextField extends AbstractSwingXFormField<JComponent> implements XFormTextField
23 {
24 private JScrollPane scrollPane;
25
26 public JMultilineLabelTextField()
27 {
28 super( new JTextArea() );
29
30 getTextArea().setEditable( false );
31 getTextArea().setEnabled( false );
32
33 scrollPane = new JScrollPane( getTextArea() );
34 UISupport.setFixedSize( scrollPane, 300, 100 );
35 }
36
37 public JTextArea getTextArea()
38 {
39 return ( JTextArea )super.getComponent();
40 }
41
42 public JComponent getComponent()
43 {
44 return scrollPane;
45 }
46
47 public void setValue( String value )
48 {
49 getTextArea().setText( value );
50 }
51
52 public String getValue()
53 {
54 return getTextArea().getText();
55 }
56
57 public void setWidth( int columns )
58 {
59 getTextArea().setColumns( columns );
60 }
61
62 @Override
63 public boolean isMultiRow()
64 {
65 return true;
66 }
67 }