KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

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

36
37     // Property identifiers//GEN-FIRST:Properties
38
private static final int PROPERTY_secure = 0;
39     private static final int PROPERTY_securityDomain = 1;
40     private static final int PROPERTY_resourceManager = 2;
41
42     // Property array
43
/*lazy PropertyDescriptor*/;
44     private static PropertyDescriptor[] getPdescriptor(){
45         PropertyDescriptor[] properties = new PropertyDescriptor[3];
46
47         try {
48             properties[PROPERTY_secure] = new PropertyDescriptor ( "secure", EjbModuleConfigBean.class, "getSecure", "setSecure" );
49             properties[PROPERTY_securityDomain] = new PropertyDescriptor ( "securityDomain", EjbModuleConfigBean.class, "getSecurityDomain", "setSecurityDomain" );
50             properties[PROPERTY_resourceManager] = new IndexedPropertyDescriptor ( "resourceManager", EjbModuleConfigBean.class, null, "setResourceManager", "getResourceManager", "setResourceManager" );
51         }
52         catch( IntrospectionException e) {}//GEN-HEADEREND:Properties
53
try {
54        new IndexedPropertyDescriptor ( "resourceManager", EjbModuleConfigBean.class, null, "setResourceManager", "getResourceManager", "setResourceManager" );
55         // Here you can add code for customizing the properties array.
56
} catch (Exception JavaDoc e) {e.printStackTrace();}
57         return properties; }//GEN-LAST:Properties
58

59     // EventSet identifiers//GEN-FIRST:Events
60
private static final int EVENT_propertyChangeListener = 0;
61
62     // EventSet array
63
/*lazy EventSetDescriptor*/;
64     private static EventSetDescriptor[] getEdescriptor(){
65         EventSetDescriptor[] eventSets = new EventSetDescriptor[1];
66
67             try {
68             eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( EjbModuleConfigBean.class, "propertyChangeListener", java.beans.PropertyChangeListener JavaDoc.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" );
69         }
70         catch( IntrospectionException e) {}//GEN-HEADEREND:Events
71

72         // Here you can add code for customizing the event sets array.
73

74         return eventSets; }//GEN-LAST:Events
75

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

96         // Here you can add code for customizing the methods array.
97

98         return methods; }//GEN-LAST:Methods
99

100
101     private static final int defaultPropertyIndex = -1;//GEN-BEGIN:Idx
102
private static final int defaultEventIndex = -1;//GEN-END:Idx
103

104
105 //GEN-FIRST:Superclass
106

107     // Here you can add code for customizing the Superclass BeanInfo.
108

109 //GEN-LAST:Superclass
110

111     /**
112      * Gets the bean's <code>BeanDescriptor</code>s.
113      *
114      * @return BeanDescriptor describing the editable
115      * properties of this bean. May return null if the
116      * information should be obtained by automatic analysis.
117      */

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

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

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

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

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

179     public int getDefaultEventIndex() {
180         return defaultEventIndex;
181     }
182 }
183
184
Popular Tags