1 19 package org.netbeans.tests.j2eeserver.plugin.jsr88; 20 21 import java.beans.*; 22 23 public class ResourceManagerBeanInfo extends SimpleBeanInfo { 24 25 26 ; 28 private static BeanDescriptor getBdescriptor(){ 29 BeanDescriptor beanDescriptor = new BeanDescriptor ( ResourceManager.class , null ); 31 33 return beanDescriptor; } 35 36 private static final int PROPERTY_resourceName = 0; 38 private static final int PROPERTY_resourceJndiName = 1; 39 private static final int PROPERTY_resourceUrl = 2; 40 41 ; 43 private static PropertyDescriptor[] getPdescriptor(){ 44 PropertyDescriptor[] properties = new PropertyDescriptor[3]; 45 46 try { 47 properties[PROPERTY_resourceName] = new PropertyDescriptor ( "resourceName", ResourceManager.class, "getResourceName", null ); 48 properties[PROPERTY_resourceJndiName] = new PropertyDescriptor ( "resourceJndiName", ResourceManager.class, "getResourceJndiName", "setResourceJndiName" ); 49 properties[PROPERTY_resourceUrl] = new PropertyDescriptor ( "resourceUrl", ResourceManager.class, "getResourceUrl", "setResourceUrl" ); 50 } 51 catch( IntrospectionException e) {} 53 55 return properties; } 57 private static final int EVENT_propertyChangeListener = 0; 59 60 ; 62 private static EventSetDescriptor[] getEdescriptor(){ 63 EventSetDescriptor[] eventSets = new EventSetDescriptor[1]; 64 65 try { 66 eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( ResourceManager.class, "propertyChangeListener", java.beans.PropertyChangeListener .class, new String [] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); 67 } 68 catch( IntrospectionException e) {} 70 72 return eventSets; } 74 76 ; 78 private static MethodDescriptor[] getMdescriptor(){ 79 MethodDescriptor[] methods = new MethodDescriptor[0]; 81 83 return methods; } 85 86 private static final int defaultPropertyIndex = -1; private static final int defaultEventIndex = -1; 89 90 92 94 96 103 public BeanDescriptor getBeanDescriptor() { 104 return getBdescriptor(); 105 } 106 107 119 public PropertyDescriptor[] getPropertyDescriptors() { 120 return getPdescriptor(); 121 } 122 123 130 public EventSetDescriptor[] getEventSetDescriptors() { 131 return getEdescriptor(); 132 } 133 134 141 public MethodDescriptor[] getMethodDescriptors() { 142 return getMdescriptor(); 143 } 144 145 153 public int getDefaultPropertyIndex() { 154 return defaultPropertyIndex; 155 } 156 157 164 public int getDefaultEventIndex() { 165 return defaultEventIndex; 166 } 167 } 168 169 | Popular Tags |