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 WS70CustomResourceBeanBeanInfo extends SimpleBeanInfo { 34 35 private static BeanDescriptor beanDescriptor = null; 37 private static BeanDescriptor getBdescriptor(){ 38 BeanDescriptor beanDescriptor = new BeanDescriptor ( WS70CustomResourceBean.class , null ); 40 42 return beanDescriptor; } static private String getLabel(String key){ 44 return NbBundle.getMessage(WS70CustomResourceBean.class,key); 45 } 46 private static final int PROPERTY_jndiName = 0; 47 private static final int PROPERTY_resType = 1; 48 private static final int PROPERTY_factoryClass = 2; 49 private static final int PROPERTY_isEnabled = 3; 50 private static final int PROPERTY_description = 4; 51 private static final int PROPERTY_name = 5; 52 53 private static PropertyDescriptor[] properties = null; 55 private static PropertyDescriptor[] getPdescriptor(){ 56 try { 58 properties = new PropertyDescriptor[6]; 59 properties[PROPERTY_jndiName] = new PropertyDescriptor ( "jndiName", WS70CustomResourceBean.class, "getJndiName", "setJndiName" ); 60 properties[PROPERTY_jndiName].setDisplayName ( getLabel("LBL_CustomJndiName") ); 61 properties[PROPERTY_jndiName].setShortDescription ( getLabel("DSC_CustomJndiName") ); 62 63 properties[PROPERTY_resType] = new PropertyDescriptor ( "resType", WS70CustomResourceBean.class, "getResType", "setResType" ); 64 properties[PROPERTY_resType].setDisplayName ( getLabel("LBL_ResType") ); 65 properties[PROPERTY_resType].setShortDescription ( getLabel("DSC_ResType") ); 66 properties[PROPERTY_factoryClass] = new PropertyDescriptor ( "factoryClass", WS70CustomResourceBean.class, "getFactoryClass", "setFactoryClass" ); 67 properties[PROPERTY_factoryClass].setDisplayName ( getLabel("LBL_CustomFactoryClass") ); 68 properties[PROPERTY_factoryClass].setShortDescription ( getLabel("DSC_CustomFactoryClass") ); 69 properties[PROPERTY_description] = new PropertyDescriptor ( "description", WS70CustomResourceBean.class, "getDescription", "setDescription" ); 70 properties[PROPERTY_description].setDisplayName ( getLabel("LBL_Description") ); 71 properties[PROPERTY_description].setShortDescription ( getLabel("DSC_Description") ); 72 73 properties[PROPERTY_isEnabled] = new PropertyDescriptor ( "isEnabled", WS70CustomResourceBean.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 78 properties[PROPERTY_name] = new PropertyDescriptor ( "name", WS70CustomResourceBean.class, "getName", "setName" ); 79 properties[PROPERTY_name].setHidden ( true ); 80 } 81 catch( IntrospectionException e){ 82 } 83 84 86 return properties; } 88 private static EventSetDescriptor[] eventSets = null; 90 private static EventSetDescriptor[] getEdescriptor(){ 91 93 95 return eventSets; } 97 private static MethodDescriptor[] methods = null; 99 private static MethodDescriptor[] getMdescriptor(){ 100 102 104 return methods; } 106 107 private static int defaultPropertyIndex = -1; private static int defaultEventIndex = -1; 110 111 113 115 117 124 public BeanDescriptor getBeanDescriptor() { 125 return getBdescriptor(); 126 } 127 128 140 public PropertyDescriptor[] getPropertyDescriptors() { 141 return getPdescriptor(); 142 } 143 144 151 public EventSetDescriptor[] getEventSetDescriptors() { 152 return getEdescriptor(); 153 } 154 155 162 public MethodDescriptor[] getMethodDescriptors() { 163 return getMdescriptor(); 164 } 165 166 174 public int getDefaultPropertyIndex() { 175 return defaultPropertyIndex; 176 } 177 178 185 public int getDefaultEventIndex() { 186 return defaultEventIndex; 187 } 188 } 189 190 | Popular Tags |