KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.beans.*;
22
23 public class EjbRefConfigBeanBeanInfo extends SimpleBeanInfo {
24
25
26     // Bean descriptor//GEN-FIRST:BeanDescriptor
27
/*lazy BeanDescriptor*/;
28     private static BeanDescriptor getBdescriptor(){
29         BeanDescriptor beanDescriptor = new BeanDescriptor ( EjbRefConfigBean.class , null );//GEN-HEADEREND:BeanDescriptor
30

31         // Here you can add code for customizing the BeanDescriptor.
32

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

35
36     // Property identifiers//GEN-FIRST:Properties
37
private static final int PROPERTY_jndiName = 0;
38
39     // Property array
40
/*lazy PropertyDescriptor*/;
41     private static PropertyDescriptor[] getPdescriptor(){
42         PropertyDescriptor[] properties = new PropertyDescriptor[1];
43
44         try {
45             properties[PROPERTY_jndiName] = new PropertyDescriptor ( "jndiName", EjbRefConfigBean.class, "getJndiName", "setJndiName" );
46         }
47         catch( IntrospectionException e) {}//GEN-HEADEREND:Properties
48

49         // Here you can add code for customizing the properties array.
50

51         return properties; }//GEN-LAST:Properties
52

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

66         // Here you can add code for customizing the event sets array.
67

68         return eventSets; }//GEN-LAST:Events
69

70     // Method identifiers//GEN-FIRST:Methods
71
private static final int METHOD_getDConfigBean0 = 0;
72     private static final int METHOD_notifyDDChange1 = 1;
73     private static final int METHOD_removeDConfigBean2 = 2;
74
75     // Method array
76
/*lazy MethodDescriptor*/;
77     private static MethodDescriptor[] getMdescriptor(){
78         MethodDescriptor[] methods = new MethodDescriptor[3];
79
80         try {
81             methods[METHOD_getDConfigBean0] = new MethodDescriptor ( EjbRefConfigBean.class.getMethod("getDConfigBean", new Class JavaDoc[] {javax.enterprise.deploy.model.DDBean JavaDoc.class}));
82             methods[METHOD_getDConfigBean0].setDisplayName ( "" );
83             methods[METHOD_notifyDDChange1] = new MethodDescriptor ( EjbRefConfigBean.class.getMethod("notifyDDChange", new Class JavaDoc[] {javax.enterprise.deploy.model.XpathEvent JavaDoc.class}));
84             methods[METHOD_notifyDDChange1].setDisplayName ( "" );
85             methods[METHOD_removeDConfigBean2] = new MethodDescriptor ( EjbRefConfigBean.class.getMethod("removeDConfigBean", new Class JavaDoc[] {javax.enterprise.deploy.spi.DConfigBean JavaDoc.class}));
86             methods[METHOD_removeDConfigBean2].setDisplayName ( "" );
87         }
88         catch( Exception JavaDoc e) {}//GEN-HEADEREND:Methods
89

90         // Here you can add code for customizing the methods array.
91

92         return methods; }//GEN-LAST:Methods
93

94
95     private static final int defaultPropertyIndex = -1;//GEN-BEGIN:Idx
96
private static final int defaultEventIndex = -1;//GEN-END:Idx
97

98
99 //GEN-FIRST:Superclass
100

101     // Here you can add code for customizing the Superclass BeanInfo.
102

103 //GEN-LAST:Superclass
104

105     /**
106      * Gets the bean's <code>BeanDescriptor</code>s.
107      *
108      * @return BeanDescriptor describing the editable
109      * properties of this bean. May return null if the
110      * information should be obtained by automatic analysis.
111      */

112     public BeanDescriptor getBeanDescriptor() {
113         return getBdescriptor();
114     }
115
116     /**
117      * Gets the bean's <code>PropertyDescriptor</code>s.
118      *
119      * @return An array of PropertyDescriptors describing the editable
120      * properties supported by this bean. May return null if the
121      * information should be obtained by automatic analysis.
122      * <p>
123      * If a property is indexed, then its entry in the result array will
124      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
125      * A client of getPropertyDescriptors can use "instanceof" to check
126      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
127      */

128     public PropertyDescriptor[] getPropertyDescriptors() {
129         return getPdescriptor();
130     }
131
132     /**
133      * Gets the bean's <code>EventSetDescriptor</code>s.
134      *
135      * @return An array of EventSetDescriptors describing the kinds of
136      * events fired by this bean. May return null if the information
137      * should be obtained by automatic analysis.
138      */

139     public EventSetDescriptor[] getEventSetDescriptors() {
140         return getEdescriptor();
141     }
142
143     /**
144      * Gets the bean's <code>MethodDescriptor</code>s.
145      *
146      * @return An array of MethodDescriptors describing the methods
147      * implemented by this bean. May return null if the information
148      * should be obtained by automatic analysis.
149      */

150     public MethodDescriptor[] getMethodDescriptors() {
151         return getMdescriptor();
152     }
153
154     /**
155      * A bean may have a "default" property that is the property that will
156      * mostly commonly be initially chosen for update by human's who are
157      * customizing the bean.
158      * @return Index of default property in the PropertyDescriptor array
159      * returned by getPropertyDescriptors.
160      * <P> Returns -1 if there is no default property.
161      */

162     public int getDefaultPropertyIndex() {
163         return defaultPropertyIndex;
164     }
165
166     /**
167      * A bean may have a "default" event that is the event that will
168      * mostly commonly be used by human's when using the bean.
169      * @return Index of default event in the EventSetDescriptor array
170      * returned by getEventSetDescriptors.
171      * <P> Returns -1 if there is no default event.
172      */

173     public int getDefaultEventIndex() {
174         return defaultEventIndex;
175     }
176 }
177
178
Popular Tags