1 19 package org.netbeans.modules.xml.tax.beans.beaninfo; 20 21 import java.beans.*; 22 import org.netbeans.tax.TreeAttribute; 23 import org.netbeans.modules.xml.tax.beans.customizer.TreeAttributeCustomizer; 24 import org.openide.util.Exceptions; 25 26 31 public class TreeAttributeBeanInfo extends SimpleBeanInfo { 32 33 40 public BeanDescriptor getBeanDescriptor() { 41 return new BeanDescriptor ( TreeAttribute.class , TreeAttributeCustomizer.class ); 42 } 43 44 56 public PropertyDescriptor[] getPropertyDescriptors() { 57 int PROPERTY_QName = 0; 58 int PROPERTY_value = 1; 59 60 PropertyDescriptor[] properties = new PropertyDescriptor[2]; 61 62 try { 63 properties[PROPERTY_QName] = new PropertyDescriptor ( "name", TreeAttribute.class, "getQName", "setQName" ); properties[PROPERTY_QName].setDisplayName ( Util.THIS.getString ( "PROP_TreeAttributeBeanInfo_QName" ) ); 65 properties[PROPERTY_QName].setShortDescription ( Util.THIS.getString ( "HINT_TreeAttributeBeanInfo_QName" ) ); 66 67 properties[PROPERTY_value] = new PropertyDescriptor ( "value", TreeAttribute.class, "getValue", "setValue" ); properties[PROPERTY_value].setDisplayName ( Util.THIS.getString ( "PROP_TreeAttributeBeanInfo_value" ) ); 69 properties[PROPERTY_value].setShortDescription ( Util.THIS.getString ( "HINT_TreeAttributeBeanInfo_value" ) ); 70 } catch( IntrospectionException e) { 71 Exceptions.printStackTrace(e); 72 } 73 return properties; 74 } 75 76 83 public EventSetDescriptor[] getEventSetDescriptors() { 84 int EVENT_propertyChangeListener = 0; 85 EventSetDescriptor[] eventSets = new EventSetDescriptor[1]; 86 87 try { 88 eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( org.netbeans.tax.TreeAttribute.class, "propertyChangeListener", java.beans.PropertyChangeListener .class, new String [] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); } 90 catch( IntrospectionException e) { 91 Exceptions.printStackTrace(e); 92 } 93 94 return eventSets; 95 } 96 97 104 public MethodDescriptor[] getMethodDescriptors() { 105 return new MethodDescriptor[0]; 106 } 107 108 } 109 | Popular Tags |