1 19 package org.netbeans.modules.xml.tax.beans.beaninfo; 20 21 import java.beans.*; 22 import org.netbeans.tax.TreeDocumentFragment; 23 import org.netbeans.modules.xml.tax.beans.customizer.TreeDocumentFragmentCustomizer; 24 import org.netbeans.modules.xml.tax.beans.editor.VersionEditor; 25 import org.netbeans.modules.xml.tax.beans.editor.EncodingEditor; 26 import org.openide.util.Exceptions; 27 28 33 public class TreeDocumentFragmentBeanInfo extends SimpleBeanInfo { 34 35 42 public BeanDescriptor getBeanDescriptor() { 43 return new BeanDescriptor ( TreeDocumentFragment.class , TreeDocumentFragmentCustomizer.class ); 44 } 45 46 58 public PropertyDescriptor[] getPropertyDescriptors() { 59 int PROPERTY_encoding = 0; 60 int PROPERTY_version = 1; 61 PropertyDescriptor[] properties = new PropertyDescriptor[2]; 62 63 try { 64 properties[PROPERTY_encoding] = new PropertyDescriptor ( "encoding", TreeDocumentFragment.class, "getEncoding", "setEncoding" ); properties[PROPERTY_encoding].setDisplayName ( Util.THIS.getString ( "PROP_TreeDocumentFragmentBeanInfo_encoding" ) ); 66 properties[PROPERTY_encoding].setShortDescription ( Util.THIS.getString ( "HINT_TreeDocumentFragmentBeanInfo_encoding" ) ); 67 properties[PROPERTY_encoding].setPropertyEditorClass ( EncodingEditor.class ); 68 69 properties[PROPERTY_version] = new PropertyDescriptor ( "version", TreeDocumentFragment.class, "getVersion", "setVersion" ); properties[PROPERTY_version].setDisplayName ( Util.THIS.getString ( "PROP_TreeDocumentFragmentBeanInfo_version" ) ); 71 properties[PROPERTY_version].setShortDescription ( Util.THIS.getString ( "HINT_TreeDocumentFragmentBeanInfo_version" ) ); 72 properties[PROPERTY_version].setPropertyEditorClass ( VersionEditor.class ); 73 } catch( IntrospectionException e) { 74 Exceptions.printStackTrace(e); 75 } 76 return properties; 77 } 78 79 86 public EventSetDescriptor[] getEventSetDescriptors() { 87 EventSetDescriptor[] eventSets = new EventSetDescriptor[1]; 88 89 try { 90 eventSets[0] = new EventSetDescriptor ( org.netbeans.tax.TreeDocumentFragment.class, "propertyChangeListener", java.beans.PropertyChangeListener .class, new String [] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" ); } catch( IntrospectionException e) { 92 Exceptions.printStackTrace(e); 93 } 94 return eventSets; 95 } 96 97 104 public MethodDescriptor[] getMethodDescriptors() { 105 return new MethodDescriptor[0]; 106 } 107 108 } 109 | Popular Tags |