1 19 package org.netbeans.modules.css; 20 21 import java.beans.*; 22 import java.awt.Image ; 23 24 import org.openide.util.Utilities; 25 26 31 public class CSSLoaderBeanInfo extends SimpleBeanInfo { 32 33 static final String ICON_DIR_BASE = "org/netbeans/modules/css/resources/"; 35 private static final String PROP_EXT = Util.THIS.getString("PROP_Extensions"); private static final String HINT_EXT = Util.THIS.getString("HINT_Extensions"); 38 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", CSSLoader.class, "getExtensions", "setExtensions" ); properties[PROPERTY_extensions].setDisplayName ( PROP_EXT ); 58 properties[PROPERTY_extensions].setShortDescription ( HINT_EXT ); 59 } catch( IntrospectionException 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 ( CSSLoader.class, "propertyChangeListener", java.beans.PropertyChangeListener .class, new String [] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); } catch( IntrospectionException e) {} 78 return eventSets; 79 } 80 81 88 public MethodDescriptor[] getMethodDescriptors() { 89 return new MethodDescriptor[0]; 90 } 91 92 113 public Image getIcon (int type) { 114 if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || 115 (type == java.beans.BeanInfo.ICON_MONO_16x16)) { 116 117 return Utilities.loadImage (ICON_DIR_BASE + "css.gif"); } else { 119 return null; 120 } 121 } 122 123 public BeanInfo[] getAdditionalBeanInfo() { 124 try { 125 return new BeanInfo[] { 126 java.beans.Introspector.getBeanInfo(org.openide.loaders.MultiFileLoader.class) 127 }; 128 } catch (IntrospectionException e) { 129 } 131 return super.getAdditionalBeanInfo(); 132 } 133 134 } 135 | Popular Tags |