1 7 8 package java.beans; 9 10 20 21 public class SimpleBeanInfo implements BeanInfo { 22 23 27 public BeanDescriptor getBeanDescriptor() { 28 return null; 29 } 30 31 35 public PropertyDescriptor [] getPropertyDescriptors() { 36 return null; 37 } 38 39 43 public int getDefaultPropertyIndex() { 44 return -1; 45 } 46 47 51 public EventSetDescriptor [] getEventSetDescriptors() { 52 return null; 53 } 54 55 59 public int getDefaultEventIndex() { 60 return -1; 61 } 62 63 67 public MethodDescriptor [] getMethodDescriptors() { 68 return null; 69 } 70 71 76 public BeanInfo [] getAdditionalBeanInfo() { 77 return null; 78 } 79 80 84 public java.awt.Image getIcon(int iconKind) { 85 return null; 86 } 87 88 99 public java.awt.Image loadImage(final String resourceName) { 100 try { 101 final Class c = getClass(); 102 java.awt.image.ImageProducer ip = (java.awt.image.ImageProducer ) 103 java.security.AccessController.doPrivileged( 104 new java.security.PrivilegedAction () { 105 public Object run() { 106 java.net.URL url; 107 if ((url = c.getResource(resourceName)) == null) { 108 return null; 109 } else { 110 try { 111 return url.getContent(); 112 } catch (java.io.IOException ioe) { 113 return null; 114 } 115 } 116 } 117 }); 118 119 if (ip == null) 120 return null; 121 java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit(); 122 return tk.createImage(ip); 123 } catch (Exception ex) { 124 return null; 125 } 126 } 127 128 } 129 | Popular Tags |