KickJava   Java API By Example, From Geeks To Geeks.

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


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 StatelessEjbBeanInfo 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 ( StatelessEjb.class , org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule.StatelessEjbCustomizer.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_identity = 1;
53         int PROPERTY_iorSecurityConfig = 2;
54         int PROPERTY_jndiName = 3;
55         int PROPERTY_passByReference = 4;
56         int PROPERTY_principalName = 5;
57         int PROPERTY_webserviceEndpoint = 6;
58         PropertyDescriptor[] properties = new PropertyDescriptor[7];
59     
60         try {
61             properties[PROPERTY_beanPool] = new PropertyDescriptor ( "beanPool", StatelessEjb.class, "getBeanPool", "setBeanPool" );
62             properties[PROPERTY_beanPool].setPropertyEditorClass ( org.netbeans.modules.j2ee.sun.share.configbean.editors.DummyPropertyEditor.class );
63             properties[PROPERTY_identity] = new PropertyDescriptor ( "identity", StatelessEjb.class, "getIdentity", "setIdentity" );
64             properties[PROPERTY_iorSecurityConfig] = new PropertyDescriptor ( "iorSecurityConfig", StatelessEjb.class, "getIorSecurityConfig", "setIorSecurityConfig" );
65             properties[PROPERTY_iorSecurityConfig].setPropertyEditorClass ( org.netbeans.modules.j2ee.sun.share.configbean.editors.DummyPropertyEditor.class );
66             properties[PROPERTY_jndiName] = new PropertyDescriptor ( "jndiName", StatelessEjb.class, "getJndiName", "setJndiName" );
67             properties[PROPERTY_passByReference] = new PropertyDescriptor ( "passByReference", StatelessEjb.class, "getPassByReference", "setPassByReference" );
68             properties[PROPERTY_principalName] = new PropertyDescriptor ( "principalName", StatelessEjb.class, "getPrincipalName", "setPrincipalName" );
69             properties[PROPERTY_principalName].setHidden ( true );
70             properties[PROPERTY_webserviceEndpoint] = new IndexedPropertyDescriptor ( "webserviceEndpoint", StatelessEjb.class, "getWebserviceEndpoint", "setWebserviceEndpoint", "getWebserviceEndpoint", "setWebserviceEndpoint" );
71             properties[PROPERTY_webserviceEndpoint].setPropertyEditorClass ( org.netbeans.modules.j2ee.sun.share.configbean.editors.DummyPropertyEditor.class );
72         }
73         catch( IntrospectionException e) {
74             Exceptions.printStackTrace(e);
75         }
76         return properties;
77     }
78     
79     /**
80      * Gets the bean's <code>EventSetDescriptor</code>s.
81      *
82      * @return An array of EventSetDescriptors describing the kinds of
83      * events fired by this bean. May return null if the information
84      * should be obtained by automatic analysis.
85      */

86     public EventSetDescriptor[] getEventSetDescriptors() {
87         int EVENT_propertyChangeListener = 0;
88         int EVENT_vetoableChangeListener = 1;
89         EventSetDescriptor[] eventSets = new EventSetDescriptor[2];
90     
91             try {
92             eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.StatelessEjb.class, "propertyChangeListener", java.beans.PropertyChangeListener JavaDoc.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" );
93             eventSets[EVENT_propertyChangeListener].setHidden ( true );
94             eventSets[EVENT_vetoableChangeListener] = new EventSetDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.StatelessEjb.class, "vetoableChangeListener", java.beans.VetoableChangeListener JavaDoc.class, new String JavaDoc[] {"vetoableChange"}, "addVetoableChangeListener", "removeVetoableChangeListener" );
95             eventSets[EVENT_vetoableChangeListener].setHidden ( true );
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/SessionBean.png"); // NOI18N
118
}
119 }
120
121
Popular Tags