KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > ide > sunresources > beans > ConnPoolBeanBeanInfo


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.ide.sunresources.beans;
20
21 import java.beans.*;
22 import org.openide.util.NbBundle;
23 import org.netbeans.modules.j2ee.sun.ide.editors.BooleanEditor;
24 import org.netbeans.modules.j2ee.sun.ide.editors.Int0Editor;
25 import org.netbeans.modules.j2ee.sun.ide.editors.LongEditor;
26 import org.netbeans.modules.j2ee.sun.ide.editors.IsolationLevelEditor;
27 import org.netbeans.modules.j2ee.sun.ide.editors.DataSourceTypeEditor;
28 import org.netbeans.modules.j2ee.sun.ide.editors.ValidationMethodEditor;
29 import org.openide.util.Exceptions;
30
31 public class ConnPoolBeanBeanInfo extends SimpleBeanInfo {
32     
33     static private String JavaDoc getLabel(String JavaDoc key){
34         return NbBundle.getMessage(ConnPoolBean.class, key);
35     }
36
37     /**
38      * Gets the bean's <code>BeanDescriptor</code>s.
39      *
40      * @return BeanDescriptor describing the editable
41      * properties of this bean. May return null if the
42      * information should be obtained by automatic analysis.
43      */

44     public BeanDescriptor getBeanDescriptor() {
45         BeanDescriptor beanDescriptor = new BeanDescriptor ( org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class , null );
46         return beanDescriptor;
47     }
48     
49     /**
50      * Gets the bean's <code>PropertyDescriptor</code>s.
51      *
52      * @return An array of PropertyDescriptors describing the editable
53      * properties supported by this bean. May return null if the
54      * information should be obtained by automatic analysis.
55      * <p>
56      * If a property is indexed, then its entry in the result array will
57      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
58      * A client of getPropertyDescriptors can use "instanceof" to check
59      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
60      */

61     public PropertyDescriptor[] getPropertyDescriptors() {
62         int PROPERTY_allowNonComponentCallers = 0;
63         int PROPERTY_connValidMethod = 1;
64         int PROPERTY_description = 2;
65         int PROPERTY_dsClass = 3;
66         int PROPERTY_failAllConns = 4;
67         int PROPERTY_idleIimeoutSecond = 5;
68         int PROPERTY_isConnValidReq = 6;
69         int PROPERTY_isIsoLevGuaranteed = 7;
70         int PROPERTY_maxPoolSize = 8;
71         int PROPERTY_maxWaitTimeMilli = 9;
72         int PROPERTY_name = 10;
73         int PROPERTY_nontranxconns = 11;
74         int PROPERTY_poolResizeQty = 12;
75         int PROPERTY_resType = 13;
76         int PROPERTY_steadyPoolSize = 14;
77         int PROPERTY_tranxIsoLevel = 15;
78         int PROPERTY_validationTableName = 16;
79         PropertyDescriptor[] properties = new PropertyDescriptor[17];
80     
81         try {
82             properties[PROPERTY_allowNonComponentCallers] = new PropertyDescriptor ( "allowNonComponentCallers", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getAllowNonComponentCallers", "setAllowNonComponentCallers" ); // NOI18N
83
properties[PROPERTY_allowNonComponentCallers].setDisplayName ( getLabel("LBL_allow_non_comp_callers") );
84             properties[PROPERTY_allowNonComponentCallers].setShortDescription ( getLabel("LBL_allow_non_comp_callers") );
85             properties[PROPERTY_allowNonComponentCallers].setPropertyEditorClass ( BooleanEditor.class );
86             properties[PROPERTY_connValidMethod] = new PropertyDescriptor ( "connValidMethod", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getConnValidMethod", "setConnValidMethod" ); // NOI18N
87
properties[PROPERTY_connValidMethod].setDisplayName ( getLabel("LBL_conn_valid_method") );
88             properties[PROPERTY_connValidMethod].setShortDescription ( getLabel("DSC_conn_valid_method") );
89             properties[PROPERTY_connValidMethod].setPropertyEditorClass ( ValidationMethodEditor.class );
90             properties[PROPERTY_description] = new PropertyDescriptor ( "description", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getDescription", "setDescription" ); // NOI18N
91
properties[PROPERTY_description].setDisplayName ( getLabel("LBL_Description") );
92             properties[PROPERTY_description].setShortDescription ( getLabel("DSC_Description") );
93             properties[PROPERTY_dsClass] = new PropertyDescriptor ( "dsClass", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getDsClass", "setDsClass" ); // NOI18N
94
properties[PROPERTY_dsClass].setDisplayName ( getLabel("LBL_DSClassName") );
95             properties[PROPERTY_dsClass].setShortDescription ( getLabel("DSC_DSClassName") );
96             properties[PROPERTY_failAllConns] = new PropertyDescriptor ( "failAllConns", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getFailAllConns", "setFailAllConns" ); // NOI18N
97
properties[PROPERTY_failAllConns].setDisplayName ( getLabel("LBL_fail_all_connections") );
98             properties[PROPERTY_failAllConns].setShortDescription ( getLabel("DSC_fail_all_connections") );
99             properties[PROPERTY_failAllConns].setPropertyEditorClass ( BooleanEditor.class );
100             properties[PROPERTY_idleIimeoutSecond] = new PropertyDescriptor ( "idleIimeoutSecond", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getIdleIimeoutSecond", "setIdleIimeoutSecond" ); // NOI18N
101
properties[PROPERTY_idleIimeoutSecond].setDisplayName ( getLabel("LBL_connection_idle_timeout_in_seconds") );
102             properties[PROPERTY_idleIimeoutSecond].setShortDescription ( getLabel("DSC_connection_idle_timeout_in_seconds") );
103             properties[PROPERTY_idleIimeoutSecond].setPropertyEditorClass ( LongEditor.class );
104             properties[PROPERTY_isConnValidReq] = new PropertyDescriptor ( "isConnValidReq", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getIsConnValidReq", "setIsConnValidReq" ); // NOI18N
105
properties[PROPERTY_isConnValidReq].setDisplayName ( getLabel("LBL_is_connection_validation_required") );
106             properties[PROPERTY_isConnValidReq].setShortDescription ( getLabel("DSC_is_connection_validation_required") );
107             properties[PROPERTY_isConnValidReq].setPropertyEditorClass ( BooleanEditor.class );
108             properties[PROPERTY_isIsoLevGuaranteed] = new PropertyDescriptor ( "isIsoLevGuaranteed", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getIsIsoLevGuaranteed", "setIsIsoLevGuaranteed" ); // NOI18N
109
properties[PROPERTY_isIsoLevGuaranteed].setDisplayName ( getLabel("LBL_is_isolation_level_guaranteed") );
110             properties[PROPERTY_isIsoLevGuaranteed].setShortDescription ( getLabel("DSC_is_isolation_level_guaranteed") );
111             properties[PROPERTY_isIsoLevGuaranteed].setPropertyEditorClass ( BooleanEditor.class );
112             properties[PROPERTY_maxPoolSize] = new PropertyDescriptor ( "maxPoolSize", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getMaxPoolSize", "setMaxPoolSize" ); // NOI18N
113
properties[PROPERTY_maxPoolSize].setDisplayName ( getLabel("LBL_max_pool_size") );
114             properties[PROPERTY_maxPoolSize].setShortDescription ( getLabel("DSC_max_pool_size") );
115             properties[PROPERTY_maxPoolSize].setPropertyEditorClass ( Int0Editor.class );
116             properties[PROPERTY_maxWaitTimeMilli] = new PropertyDescriptor ( "maxWaitTimeMilli", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getMaxWaitTimeMilli", "setMaxWaitTimeMilli" ); // NOI18N
117
properties[PROPERTY_maxWaitTimeMilli].setDisplayName ( getLabel("LBL_max_connection_wait_time_in_millis") );
118             properties[PROPERTY_maxWaitTimeMilli].setShortDescription ( getLabel("DSC_max_connection_wait_time_in_millis") );
119             properties[PROPERTY_maxWaitTimeMilli].setPropertyEditorClass ( LongEditor.class );
120             properties[PROPERTY_name] = new PropertyDescriptor ( "name", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getName", "setName" ); // NOI18N
121
properties[PROPERTY_name].setDisplayName ( getLabel("LBL_pool_name") );
122             properties[PROPERTY_name].setShortDescription ( getLabel("DSC_pool_name") );
123             properties[PROPERTY_nontranxconns] = new PropertyDescriptor ( "nontranxconns", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getNontranxconns", "setNontranxconns" ); // NOI18N
124
properties[PROPERTY_nontranxconns].setDisplayName ( getLabel("LBL_non_tranx_conns") );
125             properties[PROPERTY_nontranxconns].setShortDescription ( getLabel("DSC_non_tranx_conns") );
126             properties[PROPERTY_nontranxconns].setPropertyEditorClass ( BooleanEditor.class );
127             properties[PROPERTY_poolResizeQty] = new PropertyDescriptor ( "poolResizeQty", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getPoolResizeQty", "setPoolResizeQty" ); // NOI18N
128
properties[PROPERTY_poolResizeQty].setDisplayName ( getLabel("LBL_pool_resize_qty") );
129             properties[PROPERTY_poolResizeQty].setShortDescription ( getLabel("DSC_pool_resize_qty") );
130             properties[PROPERTY_poolResizeQty].setPropertyEditorClass ( Int0Editor.class );
131             properties[PROPERTY_resType] = new PropertyDescriptor ( "resType", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getResType", "setResType" ); // NOI18N
132
properties[PROPERTY_resType].setDisplayName ( getLabel("LBL_res_type") );
133             properties[PROPERTY_resType].setShortDescription ( getLabel("DSC_res_type") );
134             properties[PROPERTY_resType].setPropertyEditorClass ( DataSourceTypeEditor.class );
135             properties[PROPERTY_steadyPoolSize] = new PropertyDescriptor ( "steadyPoolSize", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getSteadyPoolSize", "setSteadyPoolSize" ); // NOI18N
136
properties[PROPERTY_steadyPoolSize].setDisplayName ( getLabel("LBL_steady_pool_size") );
137             properties[PROPERTY_steadyPoolSize].setShortDescription ( getLabel("DSC_steady_pool_size") );
138             properties[PROPERTY_steadyPoolSize].setPropertyEditorClass ( Int0Editor.class );
139             properties[PROPERTY_tranxIsoLevel] = new PropertyDescriptor ( "tranxIsoLevel", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getTranxIsoLevel", "setTranxIsoLevel" ); // NOI18N
140
properties[PROPERTY_tranxIsoLevel].setDisplayName ( getLabel("LBL_transaction_isolation_level") );
141             properties[PROPERTY_tranxIsoLevel].setShortDescription ( getLabel("DSC_transaction_isolation_level") );
142             properties[PROPERTY_tranxIsoLevel].setPropertyEditorClass ( IsolationLevelEditor.class );
143             properties[PROPERTY_validationTableName] = new PropertyDescriptor ( "validationTableName", org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "getValidationTableName", "setValidationTableName" ); // NOI18N
144
properties[PROPERTY_validationTableName].setDisplayName ( getLabel("LBL_validation_table_name") );
145             properties[PROPERTY_validationTableName].setShortDescription ( getLabel("DSC_validation_table_name") );
146         }
147         catch(IntrospectionException e) {
148             Exceptions.printStackTrace(e);
149         }
150         
151         return properties;
152     }
153     
154     /**
155      * Gets the bean's <code>EventSetDescriptor</code>s.
156      *
157      * @return An array of EventSetDescriptors describing the kinds of
158      * events fired by this bean. May return null if the information
159      * should be obtained by automatic analysis.
160      */

161     public EventSetDescriptor[] getEventSetDescriptors() {
162         int EVENT_propertyChangeListener = 0;
163         EventSetDescriptor[] eventSets = new EventSetDescriptor[1];
164     
165         try {
166             eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ConnPoolBean.class, "propertyChangeListener", java.beans.PropertyChangeListener JavaDoc.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); // NOI18N
167
}
168         catch(IntrospectionException e) {
169             Exceptions.printStackTrace(e);
170         }
171         return eventSets;
172     }
173     
174     /**
175      * Gets the bean's <code>MethodDescriptor</code>s.
176      *
177      * @return An array of MethodDescriptors describing the methods
178      * implemented by this bean. May return null if the information
179      * should be obtained by automatic analysis.
180      */

181     public MethodDescriptor[] getMethodDescriptors() {
182         return new MethodDescriptor[0];
183     }
184     
185 }
186
187
Popular Tags