1 19 package org.netbeans.modules.xml.tax.beans.beaninfo; 20 21 import java.beans.*; 22 import org.netbeans.tax.TreeDTD; 23 import org.netbeans.modules.xml.tax.beans.customizer.TreeDTDCustomizer; 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 TreeDTDBeanInfo extends SimpleBeanInfo { 34 35 42 public BeanDescriptor getBeanDescriptor() { 43 return new BeanDescriptor ( TreeDTD.class , TreeDTDCustomizer.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", TreeDTD.class, "getEncoding", null ); properties[PROPERTY_encoding].setDisplayName ( Util.THIS.getString ( "PROP_TreeDTDBeanInfo_encoding" ) ); 66 properties[PROPERTY_encoding].setShortDescription ( Util.THIS.getString ( "HINT_TreeDTDBeanInfo_encoding" ) ); 67 properties[PROPERTY_encoding].setPropertyEditorClass ( EncodingEditor.class ); 68 69 properties[PROPERTY_version] = new PropertyDescriptor ( "version", TreeDTD.class, "getVersion", null ); properties[PROPERTY_version].setDisplayName ( Util.THIS.getString ( "PROP_TreeDTDBeanInfo_version" ) ); 71 properties[PROPERTY_version].setShortDescription ( Util.THIS.getString ( "HINT_TreeDTDBeanInfo_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.TreeDTD.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 |