1 | public class DimensionWrapperBeanInfo extends SimpleBeanInfo↵ | | 1 | public class PointWrapperBeanInfo extends SimpleBeanInfo↵
|
2 | {↵ | | 2 | {↵
|
| | | 3 | ↵
|
3 | /**↵ | | 4 | /**↵
|
4 | * See http://tinyurl.com/63no6t for discussion of the proper thread-safe way to implement↵ | | 5 | * See http://tinyurl.com/63no6t for discussion of the proper thread-safe way to implement↵
|
5 | * getPropertyDescriptors().↵ | | 6 | * getPropertyDescriptors().↵
|
6 | * ↵ | | 7 | * ↵
|
7 | * @see java.beans.SimpleBeanInfo#getPropertyDescriptors()↵ | | 8 | * @see java.beans.SimpleBeanInfo#getPropertyDescriptors()↵
|
8 | */↵ | | 9 | */↵
|
9 | @Override↵ | | 10 | @Override↵
|
10 | public PropertyDescriptor[] getPropertyDescriptors()↵ | | 11 | public PropertyDescriptor[] getPropertyDescriptors()↵
|
11 | {↵ | | 12 | {↵
|
12 | try↵ | | 13 | try↵
|
13 | {↵ | | 14 | {↵
|
14 | PropertyDescriptor[] result = new PropertyDescriptor[2];↵ | | 15 | PropertyDescriptor[] result = new PropertyDescriptor[2];↵
|
15 | result[0] =↵ | | 16 | result[0] =↵
|
16 | new PropertyDescriptor(Dimension↵ | | 17 | new PropertyDescriptor(↵
|
17 | Wrapper.IPropertyNames.WIDTH, Dimension↵ | | 18 | PointWrapper.IPropertyNames.X,↵
|
18 | Wrapper.class, "getWidth↵ | | 19 | PointWrapper.class,↵
|
19 | ",↵ | | 20 | "getX",↵
|
20 | "setWidth");↵ | | 21 | "setX");↵
|
21 | result[1] =↵ | | 22 | result[1] =↵
|
22 | new PropertyDescriptor(Dimension↵ | | 23 | new PropertyDescriptor(↵
|
23 | Wrapper.IPropertyNames.HEIGHT, Dimension↵ | | 24 | PointWrapper.IPropertyNames.Y,↵
|
24 | Wrapper.class,↵ | | 25 | PointWrapper.class,↵
|
25 | "getHeight", "setHeight↵ | | 26 | "getY",↵
|
26 | ");↵ | | 27 | "setY");↵
|
27 | return result;↵ | | 28 | return result;↵
|
28 | }↵ | | 29 | }↵
|
29 | catch (IntrospectionException e)↵ | | 30 | catch (IntrospectionException e)↵
|
30 | {↵ | | 31 | {↵
|
31 | throw new Error(e) | | 32 | throw new Error(e)
|