1 19 package org.netbeans.modules.xml.catalog.impl; 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.CatalogDescriptor; 27 28 public class XCatalogBeanInfo extends SimpleBeanInfo { 29 30 37 public BeanDescriptor getBeanDescriptor() { 38 BeanDescriptor beanDescriptor = new BeanDescriptor ( XCatalog.class , XCatalogCustomizer.class ); 39 beanDescriptor.setDisplayName ( Util.THIS.getString("NAME_x_catalog") ); 40 beanDescriptor.setShortDescription ( Util.THIS.getString("TEXT_x_catalog_desc") ); 41 42 return beanDescriptor; 43 } 44 45 57 public PropertyDescriptor[] getPropertyDescriptors() { 58 PropertyDescriptor[] properties = new PropertyDescriptor[4]; 59 int PROPERTY_source = 0; 60 int PROPERTY_displayName = 1; 61 int PROPERTY_shortDescription = 2; 62 int PROPERTY_icon = 3; 63 try { 64 properties[PROPERTY_source] = new PropertyDescriptor ( "source", XCatalog.class, "getSource", "setSource" ); 65 properties[PROPERTY_source].setExpert ( true ); 66 properties[PROPERTY_source].setDisplayName ( Util.THIS.getString("PROP_xcatalog_location") ); 67 properties[PROPERTY_source].setShortDescription ( Util.THIS.getString("PROP_xcatalog_location_desc") ); 68 properties[PROPERTY_displayName] = new PropertyDescriptor ( "displayName", XCatalog.class, "getDisplayName", null ); 69 properties[PROPERTY_displayName].setDisplayName ( Util.THIS.getString("PROP_xcatalog_name") ); 70 properties[PROPERTY_displayName].setShortDescription ( Util.THIS.getString("PROP_xcatalog_name_desc") ); 71 properties[PROPERTY_shortDescription] = new PropertyDescriptor ( "shortDescription", XCatalog.class, "getShortDescription", null ); 72 properties[PROPERTY_shortDescription].setDisplayName ( Util.THIS.getString("PROP_xcatalog_info") ); 73 properties[PROPERTY_shortDescription].setShortDescription ( Util.THIS.getString("PROP_xcatalog_info_desc") ); 74 properties[PROPERTY_icon] = new IndexedPropertyDescriptor ( "icon", XCatalog.class, null, null, "getIcon", null ); 75 properties[PROPERTY_icon].setHidden ( true ); 76 } 77 catch( IntrospectionException e) {} 79 81 properties[PROPERTY_shortDescription].setName(CatalogDescriptor.PROP_CATALOG_DESC); 82 properties[PROPERTY_displayName].setName(CatalogDescriptor.PROP_CATALOG_NAME); 83 properties[PROPERTY_icon].setName(CatalogDescriptor.PROP_CATALOG_ICON); 84 return properties; 85 } 86 87 public Image getIcon (int type) { 88 if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || 89 (type == java.beans.BeanInfo.ICON_MONO_16x16)) { 90 91 return Utilities.loadImage ("org/netbeans/modules/xml/catalog/impl/xmlCatalog.gif"); } else { 93 return null; 94 } 95 } 96 97 } 98 | Popular Tags |