1 19 package org.netbeans.modules.xml.tax.beans.beaninfo; 20 21 import java.beans.*; 22 import org.netbeans.tax.TreeEntityDecl; 23 import org.netbeans.modules.xml.tax.beans.customizer.TreeEntityDeclCustomizer; 24 import org.netbeans.modules.xml.tax.beans.editor.NullStringEditor; 25 import org.openide.util.Exceptions; 26 27 32 public class TreeEntityDeclBeanInfo extends SimpleBeanInfo { 33 34 41 public BeanDescriptor getBeanDescriptor() { 42 return new BeanDescriptor ( TreeEntityDecl.class , TreeEntityDeclCustomizer.class ); 43 } 44 45 57 public PropertyDescriptor[] getPropertyDescriptors() { 58 int PROPERTY_name = 0; 59 int PROPERTY_parameter = 1; 60 int PROPERTY_notationName = 2; 61 int PROPERTY_systemId = 3; 62 int PROPERTY_internalText = 4; 63 int PROPERTY_publicId = 5; 64 PropertyDescriptor[] properties = new PropertyDescriptor[6]; 65 66 try { 67 properties[PROPERTY_name] = new PropertyDescriptor ( "name", TreeEntityDecl.class, "getName", null ); properties[PROPERTY_name].setDisplayName ( Util.THIS.getString ( "PROP_TreeEntityDeclBeanInfo_name" ) ); 69 properties[PROPERTY_name].setShortDescription ( Util.THIS.getString ( "HINT_TreeEntityDeclBeanInfo_name" ) ); 70 71 properties[PROPERTY_parameter] = new PropertyDescriptor ( "parameter", TreeEntityDecl.class, "isParameter", null ); properties[PROPERTY_parameter].setDisplayName ( Util.THIS.getString ( "PROP_TreeEntityDeclBeanInfo_parameter" ) ); 73 properties[PROPERTY_parameter].setShortDescription ( Util.THIS.getString ( "HINT_TreeEntityDeclBeanInfo_parameter" ) ); 74 75 properties[PROPERTY_notationName] = new PropertyDescriptor ( "notationName", TreeEntityDecl.class, "getNotationName", null ); properties[PROPERTY_notationName].setDisplayName ( Util.THIS.getString ( "PROP_TreeEntityDeclBeanInfo_notationName" ) ); 77 properties[PROPERTY_notationName].setShortDescription ( Util.THIS.getString ( "HINT_TreeEntityDeclBeanInfo_notationName" ) ); 78 properties[PROPERTY_notationName].setPropertyEditorClass ( NullStringEditor.class ); 79 80 properties[PROPERTY_systemId] = new PropertyDescriptor ( "systemId", TreeEntityDecl.class, "getSystemId", null ); properties[PROPERTY_systemId].setDisplayName ( Util.THIS.getString ( "PROP_TreeEntityDeclBeanInfo_systemId" ) ); 82 properties[PROPERTY_systemId].setShortDescription ( Util.THIS.getString ( "HINT_TreeEntityDeclBeanInfo_systemId" ) ); 83 properties[PROPERTY_systemId].setPropertyEditorClass ( NullStringEditor.class ); 84 85 properties[PROPERTY_internalText] = new PropertyDescriptor ( "internalText", TreeEntityDecl.class, "getInternalText", null ); properties[PROPERTY_internalText].setDisplayName ( Util.THIS.getString ( "PROP_TreeEntityDeclBeanInfo_internalText" ) ); 87 properties[PROPERTY_internalText].setShortDescription ( Util.THIS.getString ( "HINT_TreeEntityDeclBeanInfo_internalText" ) ); 88 properties[PROPERTY_internalText].setPropertyEditorClass ( NullStringEditor.class ); 89 90 properties[PROPERTY_publicId] = new PropertyDescriptor ( "publicId", TreeEntityDecl.class, "getPublicId", null ); properties[PROPERTY_publicId].setDisplayName ( Util.THIS.getString ( "PROP_TreeEntityDeclBeanInfo_publicId" ) ); 92 properties[PROPERTY_publicId].setShortDescription ( Util.THIS.getString ( "HINT_TreeEntityDeclBeanInfo_publicId" ) ); 93 properties[PROPERTY_publicId].setPropertyEditorClass ( NullStringEditor.class ); 94 } catch( IntrospectionException e) { 95 Exceptions.printStackTrace(e); 96 } 97 return properties; 98 } 99 100 107 public EventSetDescriptor[] getEventSetDescriptors() { 108 EventSetDescriptor[] eventSets = new EventSetDescriptor[1]; 109 110 try { 111 eventSets[0] = new EventSetDescriptor ( org.netbeans.tax.TreeEntityDecl.class, "propertyChangeListener", java.beans.PropertyChangeListener .class, new String [] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); } catch( IntrospectionException e) { 113 Exceptions.printStackTrace(e); 114 } 115 return eventSets; 116 } 117 118 125 public MethodDescriptor[] getMethodDescriptors() { 126 return new MethodDescriptor[0]; 127 } 128 129 } 130 | Popular Tags |