KickJava   Java API By Example, From Geeks To Geeks.

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


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 WebModuleConfigBeanBeanInfo extends SimpleBeanInfo {
24
25
26     // Bean descriptor//GEN-FIRST:BeanDescriptor
27
/*lazy BeanDescriptor*/;
28     private static BeanDescriptor getBdescriptor(){
29         BeanDescriptor beanDescriptor = new BeanDescriptor ( WebModuleConfigBean.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_securityDomain = 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_securityDomain] = new PropertyDescriptor ( "securityDomain", WebModuleConfigBean.class, "getSecurityDomain", "setSecurityDomain" );
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 ( WebModuleConfigBean.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 ( WebModuleConfigBean.class.getMethod("getDConfigBean", new Class JavaDoc[] {javax.enterprise.deploy.model.DDBean JavaDoc.class}));
82             methods[METHOD_getDConfigBean0].setDisplayName ( "" );
83             methods[METHOD_notifyDDChange1] = new MethodDescriptor ( WebModuleConfigBean.class.getMethod("notifyDDChange", new Class JavaDoc[] {javax.enterprise.deploy.model.XpathEvent JavaDoc.class}));
84             methods[METHOD_notifyDDChange1].setDisplayName ( "" );
85             methods[METHOD_removeDConfigBean2] = new MethodDescriptor ( WebModuleConfigBean.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     private static int PROPERTY_contextRoot;
99
100
101 //GEN-FIRST:Superclass
102

103     // Here you can add code for customizing the Superclass BeanInfo.
104

105 //GEN-LAST:Superclass
106

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

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

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

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

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

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

175     public int getDefaultEventIndex() {
176         return defaultEventIndex;
177     }
178     
179     public java.awt.Image JavaDoc getIcon(int type) {
180        String JavaDoc res = "org/netbeans/tests/j2eeserver/plugin/registry/manager.gif";
181         return org.openide.util.Utilities.loadImage (res);
182     }
183 }
184
185
Popular Tags