1 19 package org.netbeans.modules.xml.core; 20 21 import java.beans.*; 22 import java.awt.Image ; 23 import org.openide.util.Exceptions; 24 import org.openide.util.Utilities; 25 26 31 public class DTDDataLoaderBeanInfo extends SimpleBeanInfo { 32 33 private static final String ICON_DIR_BASE = "org/netbeans/modules/xml/core/resources/"; 35 private static final String PROP_DTD_EXT = Util.THIS.getString ("PROP_DTD_Extensions"); private static final String HINT_DTD_EXT = Util.THIS.getString ("HINT_DTD_Extensions"); 38 50 public PropertyDescriptor[] getPropertyDescriptors() { 51 int PROPERTY_extensions = 0; 52 PropertyDescriptor[] properties = new PropertyDescriptor[1]; 53 54 try { 55 properties[PROPERTY_extensions] = new PropertyDescriptor ( "extensions", DTDDataLoader.class, "getExtensions", "setExtensions" ); properties[PROPERTY_extensions].setDisplayName ( PROP_DTD_EXT ); 57 properties[PROPERTY_extensions].setShortDescription ( HINT_DTD_EXT ); 58 } catch( IntrospectionException e) { 59 Exceptions.printStackTrace(e); 60 } 61 return properties; 62 } 63 64 71 public EventSetDescriptor[] getEventSetDescriptors() { 72 int EVENT_propertyChangeListener = 0; 73 EventSetDescriptor[] eventSets = new EventSetDescriptor[1]; 74 75 try { 76 eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( DTDDataLoader.class, "propertyChangeListener", java.beans.PropertyChangeListener .class, new String [] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); } catch( IntrospectionException e) { 78 Exceptions.printStackTrace(e); 79 } 80 return eventSets; 81 } 82 83 90 public MethodDescriptor[] getMethodDescriptors() { 91 return new MethodDescriptor[0]; 92 } 93 94 97 public Image getIcon (int type) { 98 if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || 99 (type == java.beans.BeanInfo.ICON_MONO_16x16)) { 100 101 return Utilities.loadImage (ICON_DIR_BASE + "dtdObject.gif"); } else { 103 return Utilities.loadImage (ICON_DIR_BASE + "dtdObject32.gif"); } 105 } 106 107 public BeanInfo[] getAdditionalBeanInfo() { 108 try { 109 return new BeanInfo[] { 110 java.beans.Introspector.getBeanInfo(org.openide.loaders.MultiFileLoader.class) 111 }; 112 } catch (IntrospectionException e) { 113 } 115 return super.getAdditionalBeanInfo(); 116 } 117 118 } 119 | Popular Tags |