KickJava   Java API By Example, From Geeks To Geeks.

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


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 MDEjbBeanInfo 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 ( MDEjb.class , org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule.MDEjbCustomizer.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_beanPool = 0;
52         int PROPERTY_ejbName = 1;
53         int PROPERTY_iorSecurityConfig = 2;
54         int PROPERTY_jndiName = 3;
55         int PROPERTY_maxMessageLoad = 4;
56         int PROPERTY_mdbConnectionFactory = 5;
57         int PROPERTY_mdbResourceAdapter = 6;
58         int PROPERTY_passByReference = 7;
59         int PROPERTY_subscriptionName = 8;
60         PropertyDescriptor[] properties = new PropertyDescriptor[9];
61     
62         try {
63             properties[PROPERTY_beanPool] = new PropertyDescriptor ( "beanPool", MDEjb.class, "getBeanPool", "setBeanPool" );
64             properties[PROPERTY_ejbName] = new PropertyDescriptor ( "ejbName", MDEjb.class, "getEjbName", null );
65             properties[PROPERTY_iorSecurityConfig] = new PropertyDescriptor ( "iorSecurityConfig", MDEjb.class, "getIorSecurityConfig", "setIorSecurityConfig" );
66             properties[PROPERTY_jndiName] = new PropertyDescriptor ( "jndiName", MDEjb.class, "getJndiName", "setJndiName" );
67             properties[PROPERTY_maxMessageLoad] = new PropertyDescriptor ( "maxMessageLoad", MDEjb.class, "getMaxMessageLoad", "setMaxMessageLoad" );
68             properties[PROPERTY_maxMessageLoad].setHidden ( true );
69             properties[PROPERTY_mdbConnectionFactory] = new PropertyDescriptor ( "mdbConnectionFactory", MDEjb.class, "getMdbConnectionFactory", "setMdbConnectionFactory" );
70             properties[PROPERTY_mdbResourceAdapter] = new PropertyDescriptor ( "mdbResourceAdapter", MDEjb.class, "getMdbResourceAdapter", "setMdbResourceAdapter" );
71             properties[PROPERTY_passByReference] = new PropertyDescriptor ( "passByReference", MDEjb.class, "getPassByReference", "setPassByReference" );
72             properties[PROPERTY_subscriptionName] = new PropertyDescriptor ( "subscriptionName", MDEjb.class, "getSubscriptionName", "setSubscriptionName" );
73             properties[PROPERTY_subscriptionName].setHidden ( true );
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         EventSetDescriptor[] eventSets = new EventSetDescriptor[2];
92     
93             try {
94             eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.MDEjb.class, "propertyChangeListener", java.beans.PropertyChangeListener JavaDoc.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" );
95             eventSets[EVENT_vetoableChangeListener] = new EventSetDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.MDEjb.class, "vetoableChangeListener", java.beans.VetoableChangeListener JavaDoc.class, new String JavaDoc[] {"vetoableChange"}, "addVetoableChangeListener", "removeVetoableChangeListener" );
96         }
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/MessageBean.png"); // NOI18N
118
}
119 }
120
121
Popular Tags