1 19 20 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 33 public class WS70ExternalResourceBeanBeanInfo extends SimpleBeanInfo { 34 35 private static BeanDescriptor beanDescriptor = null; 37 private static BeanDescriptor getBdescriptor(){ 38 BeanDescriptor beanDescriptor = new BeanDescriptor(WS70ExternalResourceBean.class, null ); 40 42 return beanDescriptor; } 44 static private String getLabel(String key){ 45 return NbBundle.getMessage(WS70ExternalResourceBean.class,key); 46 } 47 48 private static final int PROPERTY_jndiName = 0; 49 private static final int PROPERTY_externalJndiName = 1; 50 private static final int PROPERTY_resType = 2; 51 private static final int PROPERTY_factoryClass = 3; 52 private static final int PROPERTY_isEnabled = 4; 53 private static final int PROPERTY_description = 5; 54 private static final int PROPERTY_name = 6; 55 56 57 private static PropertyDescriptor[] properties = null; 59 private static PropertyDescriptor[] getPdescriptor(){ 60 try { 62 properties = new PropertyDescriptor[7]; 63 properties[PROPERTY_jndiName] = new PropertyDescriptor ( "jndiName", WS70ExternalResourceBean.class, "getJndiName", "setJndiName" ); 64 properties[PROPERTY_jndiName].setDisplayName ( getLabel("LBL_ExternalJndi_JndiName") ); 65 properties[PROPERTY_jndiName].setShortDescription ( getLabel("DSC_ExternalJndi_JndiName") ); 66 67 properties[PROPERTY_externalJndiName] = new PropertyDescriptor ( "externalJndiName", WS70ExternalResourceBean.class, "getExternalJndiName", "setExternalJndiName" ); 68 properties[PROPERTY_externalJndiName].setDisplayName ( getLabel("LBL_ExternalJndi") ); 69 properties[PROPERTY_externalJndiName].setShortDescription ( getLabel("DSC_ExternalJndi") ); 70 properties[PROPERTY_resType] = new PropertyDescriptor ( "resType", WS70ExternalResourceBean.class, "getResType", "setResType" ); 71 properties[PROPERTY_resType].setDisplayName ( getLabel("LBL_ResType") ); 72 properties[PROPERTY_resType].setShortDescription ( getLabel("DSC_ResType") ); 73 properties[PROPERTY_factoryClass] = new PropertyDescriptor ( "factoryClass", WS70ExternalResourceBean.class, "getFactoryClass", "setFactoryClass" ); 74 properties[PROPERTY_factoryClass].setDisplayName ( getLabel("LBL_ExternalJndiFactoryClass") ); 75 properties[PROPERTY_factoryClass].setShortDescription ( getLabel("DSC_ExternalJndiFactoryClass") ); 76 properties[PROPERTY_description] = new PropertyDescriptor ( "description", WS70ExternalResourceBean.class, "getDescription", "setDescription" ); 77 properties[PROPERTY_description].setDisplayName ( getLabel("LBL_Description") ); 78 properties[PROPERTY_description].setShortDescription ( getLabel("DSC_Description") ); 79 80 properties[PROPERTY_isEnabled] = new PropertyDescriptor ( "isEnabled", WS70ExternalResourceBean.class, "getIsEnabled", "setIsEnabled" ); 81 properties[PROPERTY_isEnabled].setDisplayName ( getLabel("LBL_Enabled") ); 82 properties[PROPERTY_isEnabled].setShortDescription ( getLabel("DSC_Enabled") ); 83 properties[PROPERTY_isEnabled].setPropertyEditorClass ( BooleanEditor.class ); 84 85 properties[PROPERTY_name] = new PropertyDescriptor ( "name", WS70ExternalResourceBean.class, "getName", "setName" ); 86 properties[PROPERTY_name].setHidden ( true ); 87 } 88 catch( IntrospectionException e){ 89 } 90 92 return properties; } 94 private static EventSetDescriptor[] eventSets = null; 96 private static EventSetDescriptor[] getEdescriptor(){ 97 99 101 return eventSets; } 103 private static MethodDescriptor[] methods = null; 105 private static MethodDescriptor[] getMdescriptor(){ 106 108 110 return methods; } 112 113 private static int defaultPropertyIndex = -1; private static int defaultEventIndex = -1; 116 117 119 121 123 130 public BeanDescriptor getBeanDescriptor() { 131 return getBdescriptor(); 132 } 133 134 146 public PropertyDescriptor[] getPropertyDescriptors() { 147 return getPdescriptor(); 148 } 149 150 157 public EventSetDescriptor[] getEventSetDescriptors() { 158 return getEdescriptor(); 159 } 160 161 168 public MethodDescriptor[] getMethodDescriptors() { 169 return getMdescriptor(); 170 } 171 172 180 public int getDefaultPropertyIndex() { 181 return defaultPropertyIndex; 182 } 183 184 191 public int getDefaultEventIndex() { 192 return defaultEventIndex; 193 } 194 } 195 196 | Popular Tags |