1 19 package org.netbeans.modules.xml.catalog; 20 21 import java.beans.*; 22 import java.awt.Image ; 23 import org.openide.util.Exceptions; 24 import org.openide.util.Utilities; 25 26 public class CatalogEntryBeanInfo extends SimpleBeanInfo { 27 28 private static final String ICON_DIR_BASE = "org/netbeans/modules/xml/catalog/resources/"; 30 private static final String PUBLICID_N = Util.THIS.getString("PROP_public_id"); 31 private static final String PUBLICID_D = Util.THIS.getString("PROP_public_id_desc"); 32 private static final String SYSTEMID_D = Util.THIS.getString("PROP_system_id_desc"); 33 private static final String SYSTEMID_N = Util.THIS.getString("PROP_system_id"); 34 private static final String URI_D = Util.THIS.getString("PROP_uri_desc"); 35 private static final String URI_N = Util.THIS.getString("PROP_uri"); 36 37 49 public PropertyDescriptor[] getPropertyDescriptors() { 50 int PROPERTY_publicID = 0; 51 int PROPERTY_systemID = 1; 52 int PROPERTY_URI = 2; 53 PropertyDescriptor[] properties = new PropertyDescriptor[3]; 54 55 try { 56 properties[PROPERTY_publicID] = new PropertyDescriptor ( "publicID", CatalogEntry.class, "getPublicIDValue", null ); properties[PROPERTY_publicID].setDisplayName ( PUBLICID_N ); 58 properties[PROPERTY_publicID].setShortDescription ( PUBLICID_D ); 59 properties[PROPERTY_systemID] = new PropertyDescriptor ( "systemID", CatalogEntry.class, "getSystemIDValue", null ); properties[PROPERTY_systemID].setDisplayName ( SYSTEMID_N ); 61 properties[PROPERTY_systemID].setShortDescription ( SYSTEMID_D ); 62 properties[PROPERTY_URI] = new PropertyDescriptor ( "uri", CatalogEntry.class, "getUriValue", null ); properties[PROPERTY_URI].setDisplayName ( URI_N ); 64 properties[PROPERTY_URI].setShortDescription ( URI_D ); 65 } 66 catch( IntrospectionException e) { 67 Exceptions.printStackTrace(e); 68 } 69 return properties; 70 } 71 72 79 public EventSetDescriptor[] getEventSetDescriptors() { 80 return new EventSetDescriptor[0]; 81 } 82 83 90 public MethodDescriptor[] getMethodDescriptors() { 91 return new MethodDescriptor[0]; 92 } 93 94 115 public Image getIcon (int type) { 116 if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || 117 (type == java.beans.BeanInfo.ICON_MONO_16x16)) { 118 119 return Utilities.loadImage (ICON_DIR_BASE + "catalog-entry.gif"); } else { 121 return null; 122 } 123 } 124 125 } 126 | Popular Tags |