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 WS70MailResourceBeanBeanInfo extends SimpleBeanInfo { 34 35 private static BeanDescriptor beanDescriptor = null; 37 private static BeanDescriptor getBdescriptor(){ 38 BeanDescriptor beanDescriptor = new BeanDescriptor ( WS70MailResourceBean.class , null ); 40 42 return beanDescriptor; } static private String getLabel(String 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 private static PropertyDescriptor[] properties = null; 60 private static PropertyDescriptor[] getPdescriptor(){ 61 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 102 return properties; } 104 private static EventSetDescriptor[] eventSets = null; 106 private static EventSetDescriptor[] getEdescriptor(){ 107 109 111 return eventSets; } 113 private static MethodDescriptor[] methods = null; 115 private static MethodDescriptor[] getMdescriptor(){ 116 118 120 return methods; } 122 123 private static int defaultPropertyIndex = -1; private static int defaultEventIndex = -1; 126 127 129 131 133 140 public BeanDescriptor getBeanDescriptor() { 141 return getBdescriptor(); 142 } 143 144 156 public PropertyDescriptor[] getPropertyDescriptors() { 157 return getPdescriptor(); 158 } 159 160 167 public EventSetDescriptor[] getEventSetDescriptors() { 168 return getEdescriptor(); 169 } 170 171 178 public MethodDescriptor[] getMethodDescriptors() { 179 return getMdescriptor(); 180 } 181 182 190 public int getDefaultPropertyIndex() { 191 return defaultPropertyIndex; 192 } 193 194 201 public int getDefaultEventIndex() { 202 return defaultEventIndex; 203 } 204 } 205 206 | Popular Tags |