1 19 package org.netbeans.modules.xml.core; 20 21 import java.beans.*; 22 import java.util.*; 23 import java.awt.Image ; 24 import org.openide.util.Exceptions; 25 import org.openide.util.Utilities; 26 27 32 public class XMLDataLoaderBeanInfo extends SimpleBeanInfo { 33 34 private static final String ICON_DIR_BASE = "org/netbeans/modules/xml/core/resources/"; 36 private static final String PROP_EXT = Util.THIS.getString ("PROP_Extensions"); private static final String HINT_EXT = Util.THIS.getString ("HINT_Extensions"); 39 51 public PropertyDescriptor[] getPropertyDescriptors() { 52 int PROPERTY_extensions = 0; 53 PropertyDescriptor[] properties = new PropertyDescriptor[1]; 54 55 try { 56 properties[PROPERTY_extensions] = new PropertyDescriptor ( "extensions", XMLDataLoader.class, "getExtensions", "setExtensions" ); properties[PROPERTY_extensions].setDisplayName ( PROP_EXT ); 58 properties[PROPERTY_extensions].setShortDescription ( HINT_EXT ); 59 } catch( IntrospectionException e) { 60 Exceptions.printStackTrace(e); 61 } 62 return properties; 63 } 64 65 72 public EventSetDescriptor[] getEventSetDescriptors() { 73 int EVENT_propertyChangeListener = 0; 74 EventSetDescriptor[] eventSets = new EventSetDescriptor[1]; 75 76 try { 77 eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( XMLDataLoader.class, "propertyChangeListener", java.beans.PropertyChangeListener .class, new String [] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); } catch( IntrospectionException e) { 79 Exceptions.printStackTrace(e); 80 } 81 return eventSets; 82 } 83 84 91 public MethodDescriptor[] getMethodDescriptors() { 92 return new MethodDescriptor[0]; 93 } 94 95 98 public Image getIcon (int type) { 99 if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || 100 (type == java.beans.BeanInfo.ICON_MONO_16x16)) { 101 102 return Utilities.loadImage (ICON_DIR_BASE + "xmlObject.gif"); } else { 104 return Utilities.loadImage (ICON_DIR_BASE + "xmlObject32.gif"); } 106 } 107 108 public BeanInfo[] getAdditionalBeanInfo() { 109 try { 110 return new BeanInfo[] { 111 java.beans.Introspector.getBeanInfo(org.openide.loaders.MultiFileLoader.class) 112 }; 113 } catch (IntrospectionException e) { 114 } 116 return super.getAdditionalBeanInfo(); 117 } 118 119 } 120 | Popular Tags |