1 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 getLabel(String key){ 34 return NbBundle.getMessage(ConnPoolBean.class, key); 35 } 36 37 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 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" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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" ); 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 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 .class, new String [] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); } 168 catch(IntrospectionException e) { 169 Exceptions.printStackTrace(e); 170 } 171 return eventSets; 172 } 173 174 181 public MethodDescriptor[] getMethodDescriptors() { 182 return new MethodDescriptor[0]; 183 } 184 185 } 186 187 | Popular Tags |