1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 package org.ximtec.igesture.tool.binding;
27
28 import javax.swing.JLabel;
29
30 import org.sigtec.util.Constant;
31 import org.ximtec.igesture.core.DataObject;
32
33
34 public class LabelBinding extends DataBinding<JLabel> {
35
36 private JLabel label;
37
38 private String prefix;
39
40
41 public LabelBinding(JLabel textField, DataObject obj, String property, String prefix) {
42 super(obj, property);
43 this.label = textField;
44 this.prefix = prefix;
45 updateView();
46 }
47
48 public LabelBinding(JLabel textField, DataObject obj, String property) {
49 this(textField, obj, property, Constant.EMPTY_STRING);
50 }
51
52
53 @Override
54 public JLabel getComponent() {
55 return label;
56 }
57
58
59 @Override
60 protected void updateView() {
61 label.setText(prefix + getValue());
62 }
63
64
65 @Override
66 protected void updateModel() {
67
68 }
69 }