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.JComponent;
29 import javax.swing.JLabel;
30 import javax.swing.JTextArea;
31 import javax.swing.JTextField;
32
33 import org.ximtec.igesture.core.DataObject;
34
35
36 public class BindingFactory {
37
38 public static DataBinding< ? > createInstance(JComponent component,
39 DataObject obj, String property) {
40 if (component instanceof JTextField) {
41 return new TextFieldBinding((JTextField)component, obj, property);
42 }else if (component instanceof JTextArea) {
43 return new TextAreaBinding((JTextArea)component, obj, property);
44 }else if (component instanceof JLabel) {
45 return new LabelBinding((JLabel)component, obj, property);
46 }
47 return null;
48 }
49 }