KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > tests > j2eeserver > plugin > jsr88 > EarConfigBeanBeanInfo


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 package org.netbeans.tests.j2eeserver.plugin.jsr88;
20
21 import org.netbeans.tests.j2eeserver.plugin.jsr88.ui.EarConfigBeanPanel;
22 import java.beans.*;
23
24 public class EarConfigBeanBeanInfo extends SimpleBeanInfo {
25
26
27
28     // Bean descriptor//GEN-FIRST:BeanDescriptor
29
/*lazy BeanDescriptor*/
30     private static BeanDescriptor getBdescriptor(){
31         BeanDescriptor beanDescriptor = new BeanDescriptor ( EarConfigBean.class , EarConfigBeanPanel.class );//GEN-HEADEREND:BeanDescriptor
32

33         return beanDescriptor; }//GEN-LAST:BeanDescriptor
34

35
36     // Property identifiers//GEN-FIRST:Properties
37
private static final int PROPERTY_securityLevel = 0;
38     private static final int PROPERTY_sessionParam = 1;
39
40     // Property array
41
/*lazy PropertyDescriptor*/
42     private static PropertyDescriptor[] getPdescriptor(){
43         PropertyDescriptor[] properties = new PropertyDescriptor[2];
44     
45         try {
46             properties[PROPERTY_securityLevel] = new PropertyDescriptor ( "securityLevel", EarConfigBean.class, "getSecurityLevel", "setSecurityLevel" );
47             properties[PROPERTY_sessionParam] = new PropertyDescriptor ( "sessionParam", EarConfigBean.class, "getSessionParam", "setSessionParam" );
48         }
49         catch( IntrospectionException e) {}//GEN-HEADEREND:Properties
50

51         // Here you can add code for customizing the properties array.
52

53         return properties; }//GEN-LAST:Properties
54

55     // EventSet identifiers//GEN-FIRST:Events
56
private static final int EVENT_propertyChangeListener = 0;
57
58     // EventSet array
59
/*lazy EventSetDescriptor*/
60     private static EventSetDescriptor[] getEdescriptor(){
61         EventSetDescriptor[] eventSets = new EventSetDescriptor[1];
62     
63             try {
64             eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( org.netbeans.tests.j2eeserver.plugin.jsr88.EarConfigBean.class, "propertyChangeListener", java.beans.PropertyChangeListener JavaDoc.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" );
65         }
66         catch( IntrospectionException e) {}//GEN-HEADEREND:Events
67

68         // Here you can add code for customizing the event sets array.
69

70         return eventSets; }//GEN-LAST:Events
71

72     // Method identifiers//GEN-FIRST:Methods
73

74     // Method array
75
/*lazy MethodDescriptor*/
76     private static MethodDescriptor[] getMdescriptor(){
77         MethodDescriptor[] methods = new MethodDescriptor[0];//GEN-HEADEREND:Methods
78

79         // Here you can add code for customizing the methods array.
80

81         return methods; }//GEN-LAST:Methods
82

83
84     private static final int defaultPropertyIndex = -1;//GEN-BEGIN:Idx
85
private static final int defaultEventIndex = -1;//GEN-END:Idx
86

87
88 //GEN-FIRST:Superclass
89

90     // Here you can add code for customizing the Superclass BeanInfo.
91

92 //GEN-LAST:Superclass
93

94     /**
95      * Gets the bean's <code>BeanDescriptor</code>s.
96      *
97      * @return BeanDescriptor describing the editable
98      * properties of this bean. May return null if the
99      * information should be obtained by automatic analysis.
100      */

101     public BeanDescriptor getBeanDescriptor() {
102         return getBdescriptor();
103     }
104
105     /**
106      * Gets the bean's <code>PropertyDescriptor</code>s.
107      *
108      * @return An array of PropertyDescriptors describing the editable
109      * properties supported by this bean. May return null if the
110      * information should be obtained by automatic analysis.
111      * <p>
112      * If a property is indexed, then its entry in the result array will
113      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
114      * A client of getPropertyDescriptors can use "instanceof" to check
115      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
116      */

117     public PropertyDescriptor[] getPropertyDescriptors() {
118         return getPdescriptor();
119     }
120
121     /**
122      * Gets the bean's <code>EventSetDescriptor</code>s.
123      *
124      * @return An array of EventSetDescriptors describing the kinds of
125      * events fired by this bean. May return null if the information
126      * should be obtained by automatic analysis.
127      */

128     public EventSetDescriptor[] getEventSetDescriptors() {
129         return getEdescriptor();
130     }
131
132     /**
133      * Gets the bean's <code>MethodDescriptor</code>s.
134      *
135      * @return An array of MethodDescriptors describing the methods
136      * implemented by this bean. May return null if the information
137      * should be obtained by automatic analysis.
138      */

139     public MethodDescriptor[] getMethodDescriptors() {
140         return getMdescriptor();
141     }
142
143     /**
144      * A bean may have a "default" property that is the property that will
145      * mostly commonly be initially chosen for update by human's who are
146      * customizing the bean.
147      * @return Index of default property in the PropertyDescriptor array
148      * returned by getPropertyDescriptors.
149      * <P> Returns -1 if there is no default property.
150      */

151     public int getDefaultPropertyIndex() {
152         return defaultPropertyIndex;
153     }
154
155     /**
156      * A bean may have a "default" event that is the event that will
157      * mostly commonly be used by human's when using the bean.
158      * @return Index of default event in the EventSetDescriptor array
159      * returned by getEventSetDescriptors.
160      * <P> Returns -1 if there is no default event.
161      */

162     public int getDefaultEventIndex() {
163         return defaultEventIndex;
164     }
165     
166     /** Claim there are no icons available. You can override
167      * this if you want to provide icons for your bean.
168      *
169      */

170     public java.awt.Image JavaDoc getIcon(int iconKind) {
171         java.awt.Image JavaDoc retValue;
172         
173         retValue = super.getIcon(iconKind);
174         return retValue;
175     }
176     
177 }
178
179
Popular Tags