1 19 package org.netbeans.modules.xml.catalog.impl.sun; 20 21 import java.beans.*; 22 import java.awt.Image ; 23 24 import org.openide.util.Utilities; 25 26 import org.netbeans.modules.xml.catalog.spi.*; 27 28 public class CatalogBeanInfo extends SimpleBeanInfo { 29 30 private static final String ICON_DIR_BASE = "org/netbeans/modules/xml/catalog/impl/sun/"; 32 39 public BeanDescriptor getBeanDescriptor() { 40 BeanDescriptor beanDescriptor = new BeanDescriptor ( Catalog.class , CatalogCustomizer.class ); 41 beanDescriptor.setDisplayName ( Util.THIS.getString("PROP_Catalog") ); 42 beanDescriptor.setShortDescription ( Util.THIS.getString("PROP_Catalog_desc") ); 44 46 return beanDescriptor; 47 } 48 49 61 public PropertyDescriptor[] getPropertyDescriptors() { 62 int PROPERTY_displayName = 0; 63 int PROPERTY_shortDescription = 1; 64 int PROPERTY_icon = 2; 65 PropertyDescriptor[] properties = new PropertyDescriptor[3]; 66 67 try { 68 properties[PROPERTY_displayName] = new PropertyDescriptor ( "displayName", Catalog.class, "getDisplayName", null ); 69 properties[PROPERTY_displayName].setDisplayName ( Util.THIS.getString("PROP_catalog_name") ); 70 properties[PROPERTY_displayName].setShortDescription ( Util.THIS.getString("PROP_catalog_name_desc") ); 71 properties[PROPERTY_shortDescription] = new PropertyDescriptor ( "shortDescription", Catalog.class, "getShortDescription", null ); 72 properties[PROPERTY_shortDescription].setDisplayName ( Util.THIS.getString("PROP_catalog_info") ); 73 properties[PROPERTY_shortDescription].setShortDescription ( Util.THIS.getString("PROP_catalog_info_desc") ); 74 properties[PROPERTY_icon] = new IndexedPropertyDescriptor ( "icon", Catalog.class, null, null, "getIcon", null ); 75 properties[PROPERTY_icon].setHidden ( true ); 76 } 77 catch( IntrospectionException e) {} properties[PROPERTY_shortDescription].setName(CatalogDescriptor.PROP_CATALOG_DESC); 79 properties[PROPERTY_displayName].setName(CatalogDescriptor.PROP_CATALOG_NAME); 80 properties[PROPERTY_icon].setName(CatalogDescriptor.PROP_CATALOG_ICON); 81 82 return properties; 83 } 84 85 92 public EventSetDescriptor[] getEventSetDescriptors() { 93 return new EventSetDescriptor[0]; 94 } 95 96 103 public MethodDescriptor[] getMethodDescriptors() { 104 return new MethodDescriptor[0]; 105 } 106 107 128 public Image getIcon (int type) { 129 if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || 130 (type == java.beans.BeanInfo.ICON_MONO_16x16)) { 131 132 return Utilities.loadImage (ICON_DIR_BASE + "sunCatalog.gif"); } else { 134 return null; 135 } 136 } 137 138 } 139 | Popular Tags |