1 package org.enhydra.kelp.forte.services; 2 3 import java.awt.Image ; 4 import java.beans.*; 5 6 import org.openide.execution.ProcessExecutor; 7 import org.openide.util.NbBundle; 8 9 13 public class KelpExecutorBeanInfo extends SimpleBeanInfo { 14 15 public BeanInfo[] getAdditionalBeanInfo () { 17 try { 18 return new BeanInfo[] { 19 Introspector.getBeanInfo (ProcessExecutor.class) 20 }; 21 } catch (IntrospectionException ie) { 22 if (Boolean.getBoolean ("netbeans.debug.exceptions")) 23 ie.printStackTrace (); 24 return null; 25 } 26 } 27 28 public BeanDescriptor getBeanDescriptor () { 29 BeanDescriptor desc = new BeanDescriptor (KelpExecutor.class); 31 desc.setDisplayName (NbBundle.getMessage (KelpExecutorBeanInfo.class, "LBL_executor")); 33 desc.setShortDescription (NbBundle.getMessage (KelpExecutorBeanInfo.class, "HINT_executor")); 34 return desc; 35 } 36 37 public PropertyDescriptor[] getPropertyDescriptors () { 38 try { 39 PropertyDescriptor valueOfMyOption = new PropertyDescriptor ("valueOfMyOption", KelpExecutor.class); 40 valueOfMyOption.setDisplayName (NbBundle.getMessage (KelpExecutorBeanInfo.class, "PROP_valueOfMyOption")); 41 valueOfMyOption.setShortDescription (NbBundle.getMessage (KelpExecutorBeanInfo.class, "HINT_valueOfMyOption")); 42 return new PropertyDescriptor[] { valueOfMyOption }; 43 } catch (IntrospectionException ie) { 44 if (Boolean.getBoolean ("netbeans.debug.exceptions")) 45 ie.printStackTrace (); 46 return null; 47 } 48 } 49 50 private static Image icon, icon32; 51 public Image getIcon (int type) { 52 if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) { 53 if (icon == null) 54 icon = loadImage ("enhydraObject.gif"); 55 return icon; 56 } else { 57 if (icon32 == null) 58 icon32 = loadImage ("enhydraObject32.gif"); 59 return icon32; 60 } 61 } 62 63 } 64 | Popular Tags |