KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > share > configbean > EntityEjbBeanInfo


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.modules.j2ee.sun.share.configbean;
20
21 import java.beans.*;
22 import org.openide.util.Exceptions;
23
24 public class EntityEjbBeanInfo extends SimpleBeanInfo {
25
26     /**
27      * Gets the bean's <code>BeanDescriptor</code>s.
28      *
29      * @return BeanDescriptor describing the editable
30      * properties of this bean. May return null if the
31      * information should be obtained by automatic analysis.
32      */

33     public BeanDescriptor getBeanDescriptor() {
34         BeanDescriptor beanDescriptor = new BeanDescriptor ( EntityEjb.class , org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule.EntityEjbCustomizer.class );//GEN-HEADEREND:BeanDescriptor
35
return beanDescriptor;
36     }
37     
38     /**
39      * Gets the bean's <code>PropertyDescriptor</code>s.
40      *
41      * @return An array of PropertyDescriptors describing the editable
42      * properties supported by this bean. May return null if the
43      * information should be obtained by automatic analysis.
44      * <p>
45      * If a property is indexed, then its entry in the result array will
46      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
47      * A client of getPropertyDescriptors can use "instanceof" to check
48      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
49      */

50     public PropertyDescriptor[] getPropertyDescriptors() {
51         int PROPERTY_beanCache = 0;
52         int PROPERTY_beanPool = 1;
53         int PROPERTY_commitOption = 2;
54         int PROPERTY_ejbName = 3;
55         int PROPERTY_identity = 4;
56         int PROPERTY_iorSecurityConfig = 5;
57         int PROPERTY_isReadOnlyBean = 6;
58         int PROPERTY_jndiName = 7;
59         int PROPERTY_passByReference = 8;
60         int PROPERTY_refreshPeriodInSeconds = 9;
61         PropertyDescriptor[] properties = new PropertyDescriptor[10];
62
63         try {
64             properties[PROPERTY_beanCache] = new PropertyDescriptor ( "beanCache", EntityEjb.class, "getBeanCache", "setBeanCache" );
65             properties[PROPERTY_beanPool] = new PropertyDescriptor ( "beanPool", EntityEjb.class, "getBeanPool", "setBeanPool" );
66             properties[PROPERTY_commitOption] = new PropertyDescriptor ( "commitOption", EntityEjb.class, "getCommitOption", "setCommitOption" );
67             properties[PROPERTY_ejbName] = new PropertyDescriptor ( "ejbName", EntityEjb.class, "getEjbName", null );
68             properties[PROPERTY_identity] = new PropertyDescriptor ( "identity", EntityEjb.class, "getIdentity", "setIdentity" );
69             properties[PROPERTY_iorSecurityConfig] = new PropertyDescriptor ( "iorSecurityConfig", EntityEjb.class, "getIorSecurityConfig", "setIorSecurityConfig" );
70             properties[PROPERTY_isReadOnlyBean] = new PropertyDescriptor ( "isReadOnlyBean", EntityEjb.class, "getIsReadOnlyBean", "setIsReadOnlyBean" );
71             properties[PROPERTY_jndiName] = new PropertyDescriptor ( "jndiName", EntityEjb.class, "getJndiName", "setJndiName" );
72             properties[PROPERTY_passByReference] = new PropertyDescriptor ( "passByReference", EntityEjb.class, "getPassByReference", "setPassByReference" );
73             properties[PROPERTY_refreshPeriodInSeconds] = new PropertyDescriptor ( "refreshPeriodInSeconds", EntityEjb.class, "getRefreshPeriodInSeconds", "setRefreshPeriodInSeconds" );
74         }
75         catch( IntrospectionException e) {
76             Exceptions.printStackTrace(e);
77         }
78         return properties;
79     }
80     
81     /**
82      * Gets the bean's <code>EventSetDescriptor</code>s.
83      *
84      * @return An array of EventSetDescriptors describing the kinds of
85      * events fired by this bean. May return null if the information
86      * should be obtained by automatic analysis.
87      */

88     public EventSetDescriptor[] getEventSetDescriptors() {
89         int EVENT_propertyChangeListener = 0;
90         int EVENT_vetoableChangeListener = 1;
91         
92         EventSetDescriptor[] eventSets = new EventSetDescriptor[2];
93
94         try {
95             eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.EntityEjb.class, "propertyChangeListener", java.beans.PropertyChangeListener JavaDoc.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" );
96             eventSets[EVENT_vetoableChangeListener] = new EventSetDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.EntityEjb.class, "vetoableChangeListener", java.beans.VetoableChangeListener JavaDoc.class, new String JavaDoc[] {"vetoableChange"}, "addVetoableChangeListener", "removeVetoableChangeListener" );
97         } catch( IntrospectionException e) {
98             Exceptions.printStackTrace(e);
99         }
100         return eventSets;
101     }
102     
103     /**
104      * Gets the bean's <code>MethodDescriptor</code>s.
105      *
106      * @return An array of MethodDescriptors describing the methods
107      * implemented by this bean. May return null if the information
108      * should be obtained by automatic analysis.
109      */

110     public MethodDescriptor[] getMethodDescriptors() {
111         return new MethodDescriptor[0];
112     }
113     
114     /** Return an appropriate icon (currently, only 16x16 color is available)
115      */

116     public java.awt.Image JavaDoc getIcon(int iconKind) {
117             return loadImage("resources/EntityBean.png"); // NOI18N
118
}
119 }
120
121
Popular Tags