1 package org.compiere.grid.ed; 2 3 import java.beans.*; 4 5 11 12 public class VNumberBeanInfo extends SimpleBeanInfo 13 { 14 private Class beanClass = VNumber.class; 15 private String iconColor16x16Filename; 16 private String iconColor32x32Filename; 17 private String iconMono16x16Filename; 18 private String iconMono32x32Filename; 19 20 public VNumberBeanInfo() 21 { 22 } 23 public PropertyDescriptor[] getPropertyDescriptors() 24 { 25 try 26 { 27 PropertyDescriptor _background = new PropertyDescriptor("background", beanClass, null, "setBackground"); 28 PropertyDescriptor _display = new PropertyDescriptor("display", beanClass, "getDisplay", null); 29 PropertyDescriptor _displayType = new PropertyDescriptor("displayType", beanClass, null, "setDisplayType"); 30 PropertyDescriptor _editable = new PropertyDescriptor("editable", beanClass, "isEditable", "setEditable"); 31 PropertyDescriptor _foreground = new PropertyDescriptor("foreground", beanClass, null, "setForeground"); 32 PropertyDescriptor _mandatory = new PropertyDescriptor("mandatory", beanClass, "isMandatory", "setMandatory"); 33 PropertyDescriptor _value = new PropertyDescriptor("value", beanClass, "getValue", "setValue"); 34 PropertyDescriptor[] pds = new PropertyDescriptor[] { 35 _background, 36 _display, 37 _displayType, 38 _editable, 39 _foreground, 40 _mandatory, 41 _value}; 42 return pds; 43 44 45 46 47 48 49 50 } 51 catch(IntrospectionException ex) 52 { 53 ex.printStackTrace(); 54 return null; 55 } 56 } 57 public java.awt.Image getIcon(int iconKind) 58 { 59 switch (iconKind) { 60 case BeanInfo.ICON_COLOR_16x16: 61 return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null; 62 case BeanInfo.ICON_COLOR_32x32: 63 return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null; 64 case BeanInfo.ICON_MONO_16x16: 65 return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null; 66 case BeanInfo.ICON_MONO_32x32: 67 return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null; 68 } 69 return null; 70 } 71 public BeanInfo[] getAdditionalBeanInfo() 72 { 73 Class superclass = beanClass.getSuperclass(); 74 try 75 { 76 BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass); 77 return new BeanInfo[] { superBeanInfo }; 78 } 79 catch(IntrospectionException ex) 80 { 81 ex.printStackTrace(); 82 return null; 83 } 84 } 85 } | Popular Tags |