1 19 package org.netbeans.modules.j2ee.sun.ide.sunresources.beans; 20 21 import java.beans.*; 22 import org.openide.util.Exceptions; 23 import org.openide.util.NbBundle; 24 import org.netbeans.modules.j2ee.sun.ide.editors.BooleanEditor; 25 26 public class JMSBeanBeanInfo extends SimpleBeanInfo { 27 28 29 static private String getLabel(String key){ 30 return NbBundle.getMessage(JMSBean.class,key); 31 } 32 33 private static final int PROPERTY_description = 0; 35 private static final int PROPERTY_isEnabled = 1; 36 private static final int PROPERTY_jndiName = 2; 37 private static final int PROPERTY_name = 3; 38 private static final int PROPERTY_resType = 4; 39 40 private static final int EVENT_propertyChangeListener = 0; 41 42 49 public BeanDescriptor getBeanDescriptor() { 50 return new BeanDescriptor ( JMSBean.class , null ); 51 } 52 53 65 public PropertyDescriptor[] getPropertyDescriptors() { 66 PropertyDescriptor[] properties = new PropertyDescriptor[5]; 67 68 try { 69 properties[PROPERTY_description] = new PropertyDescriptor ( "description", JMSBean.class, "getDescription", "setDescription" ); 70 properties[PROPERTY_description].setDisplayName ( getLabel("LBL_Description") ); 71 properties[PROPERTY_description].setShortDescription ( getLabel("DSC_Description") ); 72 properties[PROPERTY_isEnabled] = new PropertyDescriptor ( "isEnabled", JMSBean.class, "getIsEnabled", "setIsEnabled" ); 73 properties[PROPERTY_isEnabled].setDisplayName ( getLabel("LBL_Enabled") ); 74 properties[PROPERTY_isEnabled].setShortDescription ( getLabel("DSC_Enabled") ); 75 properties[PROPERTY_isEnabled].setPropertyEditorClass ( BooleanEditor.class ); 76 properties[PROPERTY_jndiName] = new PropertyDescriptor ( "jndiName", JMSBean.class, "getJndiName", "setJndiName" ); 77 properties[PROPERTY_jndiName].setDisplayName ( getLabel("LBL_JndiName") ); 78 properties[PROPERTY_jndiName].setShortDescription ( getLabel("DSC_JMSJndiName") ); 79 properties[PROPERTY_name] = new PropertyDescriptor ( "name", JMSBean.class, "getName", "setName" ); 80 properties[PROPERTY_name].setHidden ( true ); 81 properties[PROPERTY_resType] = new PropertyDescriptor ( "resType", JMSBean.class, "getResType", "setResType" ); 82 properties[PROPERTY_resType].setDisplayName ( getLabel("LBL_JMSResType") ); 83 properties[PROPERTY_resType].setShortDescription ( getLabel("DSC_JMSResType") ); 84 } 85 catch( IntrospectionException e) { 86 Exceptions.printStackTrace(e); 87 } 88 89 return properties; 90 } 91 92 public EventSetDescriptor[] getEventSetDescriptors() { 93 EventSetDescriptor[] eventSets = new EventSetDescriptor[1]; 94 95 try { 96 eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( JMSBean.class, "propertyChangeListener", java.beans.PropertyChangeListener .class, new String [] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); 97 } 98 catch( IntrospectionException e) { 99 Exceptions.printStackTrace(e); 100 } 101 102 104 return eventSets; 105 } 106 107 public MethodDescriptor[] getMethodDescriptors() { 108 return new MethodDescriptor[0]; 109 } 110 111 } 112 113 | Popular Tags |