01: /*
02: * Copyright 2006 Ethan Nicholas. All rights reserved.
03: * Use is subject to license terms.
04: */
05: package jaxx.beaninfos;
06:
07: import java.beans.*;
08: import javax.swing.*;
09:
10: import jaxx.reflect.*;
11: import jaxx.runtime.swing.*;
12: import jaxx.tags.*;
13:
14: public class HBoxBeanInfo extends SimpleBeanInfo {
15: public BeanInfo[] getAdditionalBeanInfo() {
16: try {
17: return new BeanInfo[] { Introspector
18: .getBeanInfo(JPanel.class) };
19: } catch (IntrospectionException e) {
20: throw new RuntimeException(e);
21: }
22: }
23:
24: public PropertyDescriptor[] getPropertyDescriptors() {
25: try {
26: PropertyDescriptor spacing = new PropertyDescriptor(
27: "spacing", HBox.class);
28: spacing.setBound(true);
29:
30: PropertyDescriptor margin = new PropertyDescriptor(
31: "margin", HBox.class);
32: margin.setBound(true);
33:
34: PropertyDescriptor horizontalAlignment = new PropertyDescriptor(
35: "horizontalAlignment", HBox.class);
36: horizontalAlignment.setBound(true);
37: horizontalAlignment.setValue("enumerationValues",
38: new Object[] { "left",
39: new Integer(SwingConstants.LEFT),
40: "SwingConstants.LEFT", "center",
41: new Integer(SwingConstants.CENTER),
42: "SwingConstants.CENTER", "right",
43: new Integer(SwingConstants.RIGHT),
44: "SwingConstants.RIGHT" });
45:
46: PropertyDescriptor verticalAlignment = new PropertyDescriptor(
47: "verticalAlignment", HBox.class);
48: verticalAlignment.setBound(true);
49: verticalAlignment.setValue("enumerationValues",
50: new Object[] { "top",
51: new Integer(SwingConstants.TOP),
52: "SwingConstants.TOP", "middle",
53: new Integer(SwingConstants.CENTER),
54: "SwingConstants.CENTER", "bottom",
55: new Integer(SwingConstants.BOTTOM),
56: "SwingConstants.BOTTOM" });
57:
58: return new PropertyDescriptor[] { spacing, margin,
59: horizontalAlignment, verticalAlignment };
60: } catch (IntrospectionException e) {
61: throw new RuntimeException(e);
62: }
63: }
64: }
|