1 /*
2 * @(#)$Id: TextAreaBinding.java 742 2009-08-15 17:15:49Z kurmannu $
3 *
4 * Author : Ueli Kurmann, igesture@uelikurmann.ch
5 *
6 *
7 * Purpose :
8 *
9 * -----------------------------------------------------------------------
10 *
11 * Revision Information:
12 *
13 * Date Who Reason
14 *
15 * 23.03.2008 ukurmann Initial Release
16 *
17 * -----------------------------------------------------------------------
18 *
19 * Copyright 1999-2009 ETH Zurich. All Rights Reserved.
20 *
21 * This software is the proprietary information of ETH Zurich.
22 * Use is subject to license terms.
23 *
24 */
25
26 package org.ximtec.igesture.tool.binding;
27
28 import javax.swing.JTextArea;
29
30 import org.ximtec.igesture.core.DataObject;
31
32
33 public class TextAreaBinding extends DataBinding<JTextArea> {
34
35 private JTextArea textArea;
36
37
38 public TextAreaBinding(JTextArea textField, DataObject obj, String property) {
39 super(obj, property);
40 this.textArea = textField;
41 this.textArea.addFocusListener(this);
42 updateView();
43 }
44
45
46 @Override
47 public JTextArea getComponent() {
48 return textArea;
49 }
50
51
52 @Override
53 protected void updateView() {
54 textArea.setText(getValue());
55 }
56
57
58 @Override
59 protected void updateModel() {
60 setValue(textArea.getText());
61 }
62 }