1 19 package org.netbeans.modules.xml.core; 20 21 import java.beans.*; 22 import java.awt.Image ; 23 import org.openide.util.Utilities; 24 import org.openide.loaders.MultiFileLoader; 25 import org.openide.util.Exceptions; 26 27 32 public class EntityDataLoaderBeanInfo extends SimpleBeanInfo { 33 34 private static final String ICON_DIR_BASE = "org/netbeans/modules/xml/core/resources/"; 36 43 public BeanDescriptor getBeanDescriptor() { 44 BeanDescriptor beanDescriptor = new BeanDescriptor ( EntityDataLoader.class , null ); 45 beanDescriptor.setDisplayName ( Util.THIS.getString ("PROP_EntityLoader_Name") ); 46 return beanDescriptor; 47 } 48 49 61 public PropertyDescriptor[] getPropertyDescriptors() { 62 int PROPERTY_extensions = 0; 63 PropertyDescriptor[] properties = new PropertyDescriptor[1]; 64 65 try { 66 properties[PROPERTY_extensions] = new PropertyDescriptor ( "extensions", EntityDataLoader.class, "getExtensions", "setExtensions" ); 67 properties[PROPERTY_extensions].setDisplayName ( Util.THIS.getString ("PROP_Entity_Extensions") ); 68 properties[PROPERTY_extensions].setShortDescription ( Util.THIS.getString ("HINT_Entity_Extensions") ); 69 } 70 catch( IntrospectionException e) { 71 Exceptions.printStackTrace(e); 72 } 73 74 76 return properties; 77 } 78 79 86 public EventSetDescriptor[] getEventSetDescriptors() { 87 return new EventSetDescriptor[0]; 88 } 89 90 97 public MethodDescriptor[] getMethodDescriptors() { 98 return new MethodDescriptor[0]; 99 } 100 101 104 public Image getIcon(final int type) { 105 if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || 106 (type == java.beans.BeanInfo.ICON_MONO_16x16)) { 107 108 return Utilities.loadImage (ICON_DIR_BASE + "entObject.gif"); } else { 110 return Utilities.loadImage (ICON_DIR_BASE + "entObject32.gif"); } 112 } 113 114 public BeanInfo[] getAdditionalBeanInfo() { 115 try { 116 return new BeanInfo[] { 117 java.beans.Introspector.getBeanInfo (MultiFileLoader.class) 118 }; 119 } catch (IntrospectionException e) { 120 Exceptions.printStackTrace(e); 121 } 122 return super.getAdditionalBeanInfo(); 123 } 124 125 } 126 | Popular Tags |