KickJava   Java API By Example, From Geeks To Geeks.

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


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 EjbJarRootBeanInfo extends SimpleBeanInfo {
25     
26     /** Return an appropriate icon (currently, only 16x16 color is available)
27      */

28     public java.awt.Image JavaDoc getIcon(int iconKind) {
29         return loadImage("resources/EjbJarRootIcon16.gif"); // NOI18N
30
}
31     
32     /**
33      * Gets the bean's <code>BeanDescriptor</code>s.
34      *
35      * @return BeanDescriptor describing the editable
36      * properties of this bean. May return null if the
37      * information should be obtained by automatic analysis.
38      */

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

56     public PropertyDescriptor[] getPropertyDescriptors() {
57             int PROPERTY_cmpResource = 0;
58             int PROPERTY_identity = 1;
59             int PROPERTY_messageDestination = 2;
60             int PROPERTY_name = 3;
61             int PROPERTY_pmDescriptors = 4;
62             int PROPERTY_refIdentity = 5;
63             PropertyDescriptor[] properties = new PropertyDescriptor[6];
64
65             try {
66                 properties[PROPERTY_cmpResource] = new PropertyDescriptor ( "cmpResource", org.netbeans.modules.j2ee.sun.share.configbean.EjbJarRoot.class, "getCmpResource", "setCmpResource" );
67                 properties[PROPERTY_cmpResource].setPropertyEditorClass ( org.netbeans.modules.j2ee.sun.share.configbean.editors.DummyPropertyEditor.class );
68                 properties[PROPERTY_identity] = new PropertyDescriptor ( "identity", org.netbeans.modules.j2ee.sun.share.configbean.EjbJarRoot.class, "getIdentity", "setIdentity" );
69                 properties[PROPERTY_messageDestination] = new IndexedPropertyDescriptor ( "messageDestination", org.netbeans.modules.j2ee.sun.share.configbean.EjbJarRoot.class, "getMessageDestination", "setMessageDestination", "getMessageDestination", "setMessageDestination" );
70                 properties[PROPERTY_messageDestination].setPropertyEditorClass ( org.netbeans.modules.j2ee.sun.share.configbean.editors.DummyPropertyEditor.class );
71                 properties[PROPERTY_name] = new PropertyDescriptor ( "name", org.netbeans.modules.j2ee.sun.share.configbean.EjbJarRoot.class, "getName", "setName" );
72                 properties[PROPERTY_pmDescriptors] = new PropertyDescriptor ( "pmDescriptors", org.netbeans.modules.j2ee.sun.share.configbean.EjbJarRoot.class, "getPmDescriptors", "setPmDescriptors" );
73                 properties[PROPERTY_pmDescriptors].setPropertyEditorClass ( org.netbeans.modules.j2ee.sun.share.configbean.editors.DummyPropertyEditor.class );
74                 properties[PROPERTY_refIdentity] = new PropertyDescriptor ( "refIdentity", org.netbeans.modules.j2ee.sun.share.configbean.EjbJarRoot.class, "getRefIdentity", null );
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             return new EventSetDescriptor[0];
90     }
91     
92     /**
93      * Gets the bean's <code>MethodDescriptor</code>s.
94      *
95      * @return An array of MethodDescriptors describing the methods
96      * implemented by this bean. May return null if the information
97      * should be obtained by automatic analysis.
98      */

99     public MethodDescriptor[] getMethodDescriptors() {
100             return new MethodDescriptor[0];
101     }
102     
103 }
104
105
Popular Tags