1 19 package org.netbeans.modules.xml.tax.beans.beaninfo; 20 21 import java.beans.*; 22 import org.netbeans.tax.TreeElement; 23 import org.netbeans.modules.xml.tax.beans.customizer.TreeElementCustomizer; 24 import org.netbeans.modules.xml.tax.beans.editor.TreeElementAttributeListEditor; 25 import org.openide.util.Exceptions; 26 27 32 public class TreeElementBeanInfo extends SimpleBeanInfo { 33 34 41 public BeanDescriptor getBeanDescriptor() { 42 return new BeanDescriptor ( TreeElement.class , TreeElementCustomizer.class ); 43 } 44 45 57 public PropertyDescriptor[] getPropertyDescriptors() { 58 int PROPERTY_attributes = 0; 59 int PROPERTY_QName = 1; 60 PropertyDescriptor[] properties = new PropertyDescriptor[2]; 61 62 try { 63 properties[PROPERTY_attributes] = new PropertyDescriptor ( "attributes", TreeElement.class, "getAttributes", null ); properties[PROPERTY_attributes].setDisplayName ( Util.THIS.getString ( "PROP_TreeElementBeanInfo_attributes" ) ); 65 properties[PROPERTY_attributes].setShortDescription ( Util.THIS.getString ( "HINT_TreeElementBeanInfo_attributes" ) ); 66 properties[PROPERTY_attributes].setPropertyEditorClass ( TreeElementAttributeListEditor.class ); 67 68 properties[PROPERTY_QName] = new PropertyDescriptor ( "tagName", TreeElement.class, "getQName", "setQName" ); properties[PROPERTY_QName].setDisplayName ( Util.THIS.getString ( "PROP_TreeElementBeanInfo_QName" ) ); 70 properties[PROPERTY_QName].setShortDescription ( Util.THIS.getString ( "HINT_TreeElementBeanInfo_QName" ) ); 71 } catch( IntrospectionException e) { 72 Exceptions.printStackTrace(e); 73 } 74 return properties; 75 } 76 77 84 public EventSetDescriptor[] getEventSetDescriptors() { 85 EventSetDescriptor[] eventSets = new EventSetDescriptor[1]; 86 87 try { 88 eventSets[0] = new EventSetDescriptor ( org.netbeans.tax.TreeElement.class, "propertyChangeListener", java.beans.PropertyChangeListener .class, new String [] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); } catch( IntrospectionException e) { 90 Exceptions.printStackTrace(e); 91 } 92 return eventSets; 93 } 94 95 102 public MethodDescriptor[] getMethodDescriptors() { 103 return new MethodDescriptor[0]; 104 } 105 106 } 107 | Popular Tags |