KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > ws7 > serverresources > beans > WS70MailResourceBeanBeanInfo


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
20 /*
21  * WS70MailResourceBeanBeanInfo.java
22  */

23
24 package org.netbeans.modules.j2ee.sun.ws7.serverresources.beans;
25
26 import java.beans.*;
27 import org.openide.util.NbBundle;
28 import org.netbeans.modules.j2ee.sun.ide.editors.BooleanEditor;
29
30 /**
31  * @author Administrator
32  */

33 public class WS70MailResourceBeanBeanInfo extends SimpleBeanInfo {
34
35     // Bean descriptor information will be obtained from introspection.//GEN-FIRST:BeanDescriptor
36
private static BeanDescriptor beanDescriptor = null;
37     private static BeanDescriptor getBdescriptor(){
38 //GEN-HEADEREND:BeanDescriptor
39
BeanDescriptor beanDescriptor = new BeanDescriptor ( WS70MailResourceBean.class , null );
40         // Here you can add code for customizing the BeanDescriptor.
41

42         return beanDescriptor; }//GEN-LAST:BeanDescriptor
43
static private String JavaDoc getLabel(String JavaDoc key){
44         return NbBundle.getMessage(WS70MailResourceBean.class,key);
45     }
46     private static final int PROPERTY_description = 0;
47     private static final int PROPERTY_fromAddr = 1;
48     private static final int PROPERTY_hostName = 2;
49     private static final int PROPERTY_isEnabled = 3;
50     private static final int PROPERTY_jndiName = 4;
51     private static final int PROPERTY_name = 5;
52     private static final int PROPERTY_storeProt = 6;
53     private static final int PROPERTY_storeProtClass = 7;
54     private static final int PROPERTY_transProt = 8;
55     private static final int PROPERTY_transProtClass = 9;
56     private static final int PROPERTY_userName = 10;
57     
58     // Properties information will be obtained from introspection.//GEN-FIRST:Properties
59
private static PropertyDescriptor[] properties = null;
60     private static PropertyDescriptor[] getPdescriptor(){
61 //GEN-HEADEREND:Properties
62
try {
63             properties = new PropertyDescriptor[11];
64             properties[PROPERTY_description] = new PropertyDescriptor ( "description", WS70MailResourceBean.class, "getDescription", "setDescription" );
65             properties[PROPERTY_description].setDisplayName ( getLabel("LBL_Description") );
66             properties[PROPERTY_description].setShortDescription ( getLabel("DSC_Description") );
67             properties[PROPERTY_fromAddr] = new PropertyDescriptor ( "fromAddr", WS70MailResourceBean.class, "getFromAddr", "setFromAddr" );
68             properties[PROPERTY_fromAddr].setDisplayName ( getLabel("LBL_from") );
69             properties[PROPERTY_fromAddr].setShortDescription ( getLabel("DSC_from") );
70             properties[PROPERTY_hostName] = new PropertyDescriptor ( "hostName", WS70MailResourceBean.class, "getHostName", "setHostName" );
71             properties[PROPERTY_hostName].setDisplayName ( getLabel("LBL_host") );
72             properties[PROPERTY_hostName].setShortDescription ( getLabel("DSC_host") );
73             properties[PROPERTY_isEnabled] = new PropertyDescriptor ( "isEnabled", WS70MailResourceBean.class, "getIsEnabled", "setIsEnabled" );
74             properties[PROPERTY_isEnabled].setDisplayName ( getLabel("LBL_Enabled") );
75             properties[PROPERTY_isEnabled].setShortDescription ( getLabel("DSC_Enabled") );
76             properties[PROPERTY_isEnabled].setPropertyEditorClass ( BooleanEditor.class );
77             properties[PROPERTY_jndiName] = new PropertyDescriptor ( "jndiName", WS70MailResourceBean.class, "getJndiName", "setJndiName" );
78             properties[PROPERTY_jndiName].setDisplayName ( getLabel("LBL_MailJndiName") );
79             properties[PROPERTY_jndiName].setShortDescription ( getLabel("DSC_MailJndiName") );
80             properties[PROPERTY_name] = new PropertyDescriptor ( "name", WS70MailResourceBean.class, "getName", "setName" );
81             properties[PROPERTY_name].setHidden ( true );
82             properties[PROPERTY_storeProt] = new PropertyDescriptor ( "storeProt", WS70MailResourceBean.class, "getStoreProt", "setStoreProt" );
83             properties[PROPERTY_storeProt].setDisplayName ( getLabel("LBL_StoreProtocol") );
84             properties[PROPERTY_storeProt].setShortDescription ( getLabel("DSC_StoreProtocol") );
85             properties[PROPERTY_storeProtClass] = new PropertyDescriptor ( "storeProtClass", WS70MailResourceBean.class, "getStoreProtClass", "setStoreProtClass" );
86             properties[PROPERTY_storeProtClass].setDisplayName ( getLabel("LBL_StoreProtocolClass") );
87             properties[PROPERTY_storeProtClass].setShortDescription ( getLabel("DSC_StoreProtocolClass") );
88             properties[PROPERTY_transProt] = new PropertyDescriptor ( "transProt", WS70MailResourceBean.class, "getTransProt", "setTransProt" );
89             properties[PROPERTY_transProt].setDisplayName ( getLabel("LBL_TransportProtocol") );
90             properties[PROPERTY_transProt].setShortDescription ( getLabel("DSC_TransportProtocol") );
91             properties[PROPERTY_transProtClass] = new PropertyDescriptor ( "transProtClass", WS70MailResourceBean.class, "getTransProtClass", "setTransProtClass" );
92             properties[PROPERTY_transProtClass].setDisplayName ( getLabel("LBL_TransportProtocolClass") );
93             properties[PROPERTY_transProtClass].setShortDescription ( getLabel("DSC_TransportProtocolClass") );
94             properties[PROPERTY_userName] = new PropertyDescriptor ( "userName", WS70MailResourceBean.class, "getUserName", "setUserName" );
95             properties[PROPERTY_userName].setDisplayName ( getLabel("LBL_user") );
96             properties[PROPERTY_userName].setShortDescription ( getLabel("DSC_user") );
97         }
98         catch( IntrospectionException e){
99         }
100         // Here you can add code for customizing the properties array.
101

102         return properties; }//GEN-LAST:Properties
103

104     // Event set information will be obtained from introspection.//GEN-FIRST:Events
105
private static EventSetDescriptor[] eventSets = null;
106     private static EventSetDescriptor[] getEdescriptor(){
107 //GEN-HEADEREND:Events
108

109         // Here you can add code for customizing the event sets array.
110

111         return eventSets; }//GEN-LAST:Events
112

113     // Method information will be obtained from introspection.//GEN-FIRST:Methods
114
private static MethodDescriptor[] methods = null;
115     private static MethodDescriptor[] getMdescriptor(){
116 //GEN-HEADEREND:Methods
117

118         // Here you can add code for customizing the methods array.
119

120         return methods; }//GEN-LAST:Methods
121

122     
123     private static int defaultPropertyIndex = -1;//GEN-BEGIN:Idx
124
private static int defaultEventIndex = -1;//GEN-END:Idx
125

126     
127 //GEN-FIRST:Superclass
128

129     // Here you can add code for customizing the Superclass BeanInfo.
130

131 //GEN-LAST:Superclass
132

133     /**
134      * Gets the bean's <code>BeanDescriptor</code>s.
135      *
136      * @return BeanDescriptor describing the editable
137      * properties of this bean. May return null if the
138      * information should be obtained by automatic analysis.
139      */

140     public BeanDescriptor getBeanDescriptor() {
141         return getBdescriptor();
142     }
143     
144     /**
145      * Gets the bean's <code>PropertyDescriptor</code>s.
146      *
147      * @return An array of PropertyDescriptors describing the editable
148      * properties supported by this bean. May return null if the
149      * information should be obtained by automatic analysis.
150      * <p>
151      * If a property is indexed, then its entry in the result array will
152      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
153      * A client of getPropertyDescriptors can use "instanceof" to check
154      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
155      */

156     public PropertyDescriptor[] getPropertyDescriptors() {
157         return getPdescriptor();
158     }
159     
160     /**
161      * Gets the bean's <code>EventSetDescriptor</code>s.
162      *
163      * @return An array of EventSetDescriptors describing the kinds of
164      * events fired by this bean. May return null if the information
165      * should be obtained by automatic analysis.
166      */

167     public EventSetDescriptor[] getEventSetDescriptors() {
168         return getEdescriptor();
169     }
170     
171     /**
172      * Gets the bean's <code>MethodDescriptor</code>s.
173      *
174      * @return An array of MethodDescriptors describing the methods
175      * implemented by this bean. May return null if the information
176      * should be obtained by automatic analysis.
177      */

178     public MethodDescriptor[] getMethodDescriptors() {
179         return getMdescriptor();
180     }
181     
182     /**
183      * A bean may have a "default" property that is the property that will
184      * mostly commonly be initially chosen for update by human's who are
185      * customizing the bean.
186      * @return Index of default property in the PropertyDescriptor array
187      * returned by getPropertyDescriptors.
188      * <P> Returns -1 if there is no default property.
189      */

190     public int getDefaultPropertyIndex() {
191         return defaultPropertyIndex;
192     }
193     
194     /**
195      * A bean may have a "default" event that is the event that will
196      * mostly commonly be used by human's when using the bean.
197      * @return Index of default event in the EventSetDescriptor array
198      * returned by getEventSetDescriptors.
199      * <P> Returns -1 if there is no default event.
200      */

201     public int getDefaultEventIndex() {
202         return defaultEventIndex;
203     }
204 }
205
206
Popular Tags