1 23 24 package org.enhydra.kelp.forte; 25 26 import java.awt.Image ; 27 import java.awt.Component ; 28 import java.beans.*; 29 import java.util.ResourceBundle ; 30 import javax.swing.JFileChooser ; 31 32 import org.enhydra.tool.common.IconSet; 33 34 import org.openide.util.NbBundle; 35 36 40 public class XMLCSettingsBeanInfo extends SimpleBeanInfo { 41 42 private static final ResourceBundle bundle = NbBundle.getBundle(XMLCSettingsBeanInfo.class); 43 44 public BeanDescriptor getBeanDescriptor() 45 { 46 return new BeanDescriptor(XMLCSettings.class, XMLCSettingsCustomizer.class); 47 } 48 49 public PropertyDescriptor[] getPropertyDescriptors () { 50 try { 51 52 57 PropertyDescriptor root = new PropertyDescriptor ("Root", XMLCSettings.class); 58 root.setDisplayName (NbBundle.getMessage (XMLCSettingsBeanInfo.class, "PROP_enhydra.xmlc.project.root")); 59 root.setShortDescription (NbBundle.getMessage (XMLCSettingsBeanInfo.class, "HINT_enhydra.xmlc.project.root")); 60 root.setPropertyEditorClass(DirEd.class); 61 62 PropertyDescriptor source = new PropertyDescriptor ("Source", XMLCSettings.class); 63 source.setDisplayName (NbBundle.getMessage (XMLCSettingsBeanInfo.class, "PROP_enhydra.xmlc.src.dir")); 64 source.setShortDescription (NbBundle.getMessage (XMLCSettingsBeanInfo.class, "HINT_enhydra.xmlc.src.dir")); 65 source.setPropertyEditorClass(DirEd.class); 66 67 return new PropertyDescriptor[] {root, source}; 68 } catch (IntrospectionException ie) { 69 if (Boolean.getBoolean ("netbeans.debug.exceptions")) 70 ie.printStackTrace (); 71 return null; 72 } 73 } 74 75 private static Image icon, icon32; 76 public Image getIcon (int type) { 77 if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) { 78 if (icon == null) 79 icon = loadImage("enhydraObject.gif"); 80 return icon; 81 82 } else { 83 if (icon32 == null) 84 icon32 = loadImage("enhydraObject32.gif"); 85 return icon32; 86 87 } 88 } 89 90 public static class DirEd extends PropertyEditorSupport { 91 92 public boolean supportsCustomEditor() 93 { 94 return true; 95 } 96 97 public Component getCustomeEditor() 98 { 99 return new JFileChooser (); 100 } 101 } 102 114 115 140 } 141 | Popular Tags |