KickJava   Java API By Example, From Geeks To Geeks.

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


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 import java.beans.*;
21 import org.openide.util.Exceptions;
22
23 public class StatefulEjbBeanInfo extends SimpleBeanInfo { // BaseEjbBeanInfo implements Constants {
24

25     /**
26      * Gets the bean's <code>BeanDescriptor</code>s.
27      *
28      * @return BeanDescriptor describing the editable
29      * properties of this bean. May return null if the
30      * information should be obtained by automatic analysis.
31      */

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

49     public PropertyDescriptor[] getPropertyDescriptors() {
50         int PROPERTY_beanCache = 0;
51         int PROPERTY_DDBean = 1;
52         int PROPERTY_iorSecurityConfig = 2;
53         int PROPERTY_jndiName = 3;
54         int PROPERTY_parent = 4;
55         int PROPERTY_passByReference = 5;
56         int PROPERTY_principalName = 6;
57         int PROPERTY_webserviceEndpoint = 7;
58         int PROPERTY_xpaths = 8;
59         PropertyDescriptor[] properties = new PropertyDescriptor[9];
60         
61         try {
62             properties[PROPERTY_beanCache] = new PropertyDescriptor ( "beanCache", StatefulEjb.class, "getBeanCache", "setBeanCache" );
63             properties[PROPERTY_beanCache].setPropertyEditorClass ( org.netbeans.modules.j2ee.sun.share.configbean.editors.DummyPropertyEditor.class );
64             properties[PROPERTY_DDBean] = new PropertyDescriptor ( "DDBean", StatefulEjb.class, "getDDBean", null );
65             properties[PROPERTY_DDBean].setHidden ( true );
66             properties[PROPERTY_iorSecurityConfig] = new PropertyDescriptor ( "iorSecurityConfig", StatefulEjb.class, "getIorSecurityConfig", "setIorSecurityConfig" );
67             properties[PROPERTY_iorSecurityConfig].setPropertyEditorClass ( org.netbeans.modules.j2ee.sun.share.configbean.editors.DummyPropertyEditor.class );
68             properties[PROPERTY_jndiName] = new PropertyDescriptor ( "jndiName", StatefulEjb.class, "getJndiName", "setJndiName" );
69             properties[PROPERTY_parent] = new PropertyDescriptor ( "parent", StatefulEjb.class, "getParent", null );
70             properties[PROPERTY_parent].setHidden ( true );
71             properties[PROPERTY_passByReference] = new PropertyDescriptor ( "passByReference", StatefulEjb.class, "getPassByReference", "setPassByReference" );
72             properties[PROPERTY_principalName] = new PropertyDescriptor ( "principalName", StatefulEjb.class, "getPrincipalName", "setPrincipalName" );
73             properties[PROPERTY_principalName].setHidden ( true );
74             properties[PROPERTY_webserviceEndpoint] = new IndexedPropertyDescriptor ( "webserviceEndpoint", StatefulEjb.class, "getWebserviceEndpoint", "setWebserviceEndpoint", "getWebserviceEndpoint", "setWebserviceEndpoint" );
75             properties[PROPERTY_webserviceEndpoint].setPropertyEditorClass ( org.netbeans.modules.j2ee.sun.share.configbean.editors.DummyPropertyEditor.class );
76             properties[PROPERTY_xpaths] = new PropertyDescriptor ( "xpaths", StatefulEjb.class, "getXpaths", null );
77             properties[PROPERTY_xpaths].setHidden ( true );
78         } catch( IntrospectionException e) {
79             Exceptions.printStackTrace(e);
80         }
81         return properties;
82     }
83     
84     /**
85      * Gets the bean's <code>EventSetDescriptor</code>s.
86      *
87      * @return An array of EventSetDescriptors describing the kinds of
88      * events fired by this bean. May return null if the information
89      * should be obtained by automatic analysis.
90      */

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

116     public MethodDescriptor[] getMethodDescriptors() {
117         return new MethodDescriptor[0];
118     }
119     
120     /** Return an appropriate icon (currently, only 16x16 color is available)
121      */

122     public java.awt.Image JavaDoc getIcon(int iconKind) {
123             return loadImage("resources/SessionBean.png"); // NOI18N
124
}
125 }
126
127
Popular Tags