KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > form > beaninfo > swing > TitledBorderBeanInfo


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.form.beaninfo.swing;
21
22 import java.beans.*;
23 import javax.swing.border.TitledBorder JavaDoc;
24
25 public class TitledBorderBeanInfo extends BISupport {
26
27     public TitledBorderBeanInfo() {
28         super("titledBorder", javax.swing.border.TitledBorder JavaDoc.class); // NOI18N
29
}
30
31     protected PropertyDescriptor[] createPropertyDescriptors() throws IntrospectionException {
32         PropertyDescriptor[] pds = new PropertyDescriptor[] {
33             createRW(TitledBorder JavaDoc.class, "border"), // NOI18N
34
createRW(TitledBorder JavaDoc.class, "title"), // NOI18N
35
createRW(TitledBorder JavaDoc.class, "titleJustification"), // NOI18N
36
createRW(TitledBorder JavaDoc.class, "titlePosition"), // NOI18N
37
createRW(TitledBorder JavaDoc.class, "titleColor"), // NOI18N
38
createRW(TitledBorder JavaDoc.class, "titleFont"), // NOI18N
39
};
40         pds[2].setPropertyEditorClass(JustificationPropertyEditor.class);
41         pds[3].setPropertyEditorClass(PositionPropertyEditor.class);
42         return pds;
43     }
44
45
46     public static class PositionPropertyEditor extends BISupport.TaggedPropertyEditor {
47         public PositionPropertyEditor() {
48             super(
49                 new int[] {
50                     TitledBorder.DEFAULT_POSITION,
51                     TitledBorder.ABOVE_TOP,
52                     TitledBorder.TOP,
53                     TitledBorder.BELOW_TOP,
54                     TitledBorder.ABOVE_BOTTOM,
55                     TitledBorder.BOTTOM,
56                     TitledBorder.BELOW_BOTTOM
57                 },
58                 new String JavaDoc[] {
59                     "javax.swing.border.TitledBorder.DEFAULT_POSITION", // NOI18N
60
"javax.swing.border.TitledBorder.ABOVE_TOP", // NOI18N
61
"javax.swing.border.TitledBorder.TOP", // NOI18N
62
"javax.swing.border.TitledBorder.BELOW_TOP", // NOI18N
63
"javax.swing.border.TitledBorder.ABOVE_BOTTOM", // NOI18N
64
"javax.swing.border.TitledBorder.BOTTOM", // NOI18N
65
"javax.swing.border.TitledBorder.BELOW_BOTTOM" // NOI18N
66
},
67                 new String JavaDoc[] {
68                     "VALUE_PosDefault", // NOI18N
69
"VALUE_PosAboveTop", // NOI18N
70
"VALUE_PosTop", // NOI18N
71
"VALUE_PosBelowTop", // NOI18N
72
"VALUE_PosAboveBottom", // NOI18N
73
"VALUE_PosBottom", // NOI18N
74
"VALUE_PosBelowBottom", // NOI18N
75
}
76             );
77         }
78     }
79
80     public static class JustificationPropertyEditor extends BISupport.TaggedPropertyEditor {
81         public JustificationPropertyEditor() {
82             super(
83                 new int[] {
84                     TitledBorder.DEFAULT_JUSTIFICATION,
85                     TitledBorder.LEFT,
86                     TitledBorder.CENTER,
87                     TitledBorder.RIGHT,
88                     TitledBorder.LEADING,
89                     TitledBorder.TRAILING,
90                 },
91                 new String JavaDoc[] {
92                     "javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION", // NOI18N
93
"javax.swing.border.TitledBorder.LEFT", // NOI18N
94
"javax.swing.border.TitledBorder.CENTER", // NOI18N
95
"javax.swing.border.TitledBorder.RIGHT", // NOI18N
96
"javax.swing.border.TitledBorder.LEADING", // NOI18N
97
"javax.swing.border.TitledBorder.TRAILING", // NOI18N
98
},
99                 new String JavaDoc[] {
100                     "VALUE_JustDefault", // NOI18N
101
"VALUE_JustLeft", // NOI18N
102
"VALUE_JustCenter", // NOI18N
103
"VALUE_JustRight", // NOI18N
104
"VALUE_JustLeading", // NOI18N
105
"VALUE_JustTrailing", // NOI18N
106
}
107             );
108         }
109     }
110
111 }
112
Popular Tags