1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package com.cosylab.gui.infopanel;
21
22 import java.awt.BorderLayout;
23 import java.beans.IntrospectionException;
24 import java.lang.reflect.InvocationTargetException;
25
26 import javax.swing.JPanel;
27 import javax.swing.JScrollPane;
28
29 import com.cosylab.gui.components.introspection.PropertiesTable;
30
31
32
33
34
35
36
37
38
39 public class PropertiesPanel extends JPanel {
40
41 private static final long serialVersionUID = 1523647646017553287L;
42 private PropertiesTable table;
43 private JScrollPane tableScroll;
44 private Object bean;
45
46
47
48
49
50 public PropertiesPanel() {
51 super();
52 initialize();
53 }
54
55 private void initialize() {
56 this.setLayout(new BorderLayout());
57 table = new PropertiesTable();
58 table.setEnabled(false);
59 tableScroll = new JScrollPane(table);
60 this.add(tableScroll, BorderLayout.CENTER);
61 }
62
63
64
65
66
67
68 public void setBean(Object bean) {
69 this.bean = bean;
70 try {
71 table.setBean(bean);
72 } catch (IntrospectionException e) {
73 e.printStackTrace();
74 } catch (IllegalAccessException e) {
75 e.printStackTrace();
76 } catch (InvocationTargetException e) {
77 e.printStackTrace();
78 }
79 }
80
81
82
83
84
85
86 public Object getBean() {
87 return bean;
88 }
89 }