KickJava   Java API By Example, From Geeks To Geeks.

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


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
23 public class CmpEntityEjbBeanInfo extends SimpleBeanInfo {
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 ( CmpEntityEjb.class , org.netbeans.modules.j2ee.sun.share.configbean.customizers.ejbmodule.CmpEntityEjbCustomizer.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_commitOption = 0;
51             int PROPERTY_consistency = 1;
52             int PROPERTY_isReadOnlyBean = 2;
53             int PROPERTY_jndiName = 3;
54             int PROPERTY_passByReference = 4;
55             int PROPERTY_principalName = 5;
56             int PROPERTY_refreshPeriodInSeconds = 6;
57             int PROPERTY_schema = 7;
58             int PROPERTY_tableName = 9;
59             
60             PropertyDescriptor[] properties = new PropertyDescriptor[9];
61
62             try {
63                 properties[PROPERTY_commitOption] = new PropertyDescriptor ( "commitOption", CmpEntityEjb.class, "getCommitOption", "setCommitOption" );
64                 properties[PROPERTY_commitOption].setHidden ( true );
65                 properties[PROPERTY_consistency] = new PropertyDescriptor ( "consistency", CmpEntityEjb.class, "getConsistency", "setConsistency" );
66                 properties[PROPERTY_consistency].setHidden ( true );
67                 properties[PROPERTY_isReadOnlyBean] = new PropertyDescriptor ( "isReadOnlyBean", CmpEntityEjb.class, "getIsReadOnlyBean", "setIsReadOnlyBean" );
68                 properties[PROPERTY_isReadOnlyBean].setHidden ( true );
69                 properties[PROPERTY_jndiName] = new PropertyDescriptor ( "jndiName", CmpEntityEjb.class, "getJndiName", "setJndiName" );
70                 properties[PROPERTY_passByReference] = new PropertyDescriptor ( "passByReference", CmpEntityEjb.class, "getPassByReference", "setPassByReference" );
71                 properties[PROPERTY_principalName] = new PropertyDescriptor ( "principalName", CmpEntityEjb.class, "getPrincipalName", "setPrincipalName" );
72                 properties[PROPERTY_principalName].setHidden ( true );
73                 properties[PROPERTY_refreshPeriodInSeconds] = new PropertyDescriptor ( "refreshPeriodInSeconds", CmpEntityEjb.class, "getRefreshPeriodInSeconds", "setRefreshPeriodInSeconds" );
74                 properties[PROPERTY_refreshPeriodInSeconds].setHidden ( true );
75                 properties[PROPERTY_schema] = new PropertyDescriptor ( "schema", CmpEntityEjb.class, "getSchema", "setSchema" );
76                 properties[PROPERTY_schema].setHidden ( true );
77                 properties[PROPERTY_tableName] = new PropertyDescriptor ( "tableName", CmpEntityEjb.class, "getTableName", "setTableName" );
78                 properties[PROPERTY_tableName].setHidden ( true );
79             } catch( IntrospectionException e) {}//GEN-HEADEREND:Properties
80
return properties;
81     }
82     
83     /**
84      * Gets the bean's <code>EventSetDescriptor</code>s.
85      *
86      * @return An array of EventSetDescriptors describing the kinds of
87      * events fired by this bean. May return null if the information
88      * should be obtained by automatic analysis.
89      */

90     public EventSetDescriptor[] getEventSetDescriptors() {
91             EventSetDescriptor[] eventSets = new EventSetDescriptor[0];//GEN-HEADEREND:Events
92
return eventSets;
93     }
94     
95     /**
96      * Gets the bean's <code>MethodDescriptor</code>s.
97      *
98      * @return An array of MethodDescriptors describing the methods
99      * implemented by this bean. May return null if the information
100      * should be obtained by automatic analysis.
101      */

102     public MethodDescriptor[] getMethodDescriptors() {
103         return new MethodDescriptor[0];
104     }
105     
106     /** Return an appropriate icon (currently, only 16x16 color is available)
107      */

108     public java.awt.Image JavaDoc getIcon(int iconKind) {
109             return loadImage("resources/EntityBean.png"); // NOI18N
110
}
111 }
112
113
Popular Tags