package com.eglis; import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; import java.beans.SimpleBeanInfo; import java.util.ArrayList; import java.util.List; /** * BeanInfo class for the RedBlackTextField. */ public class RedBlackTextFieldBeanInfo extends SimpleBeanInfo { /** * Returns the list of PropertyDescriptions for the RedBlackTextField. * @return the list of PropertyDescriptions for the RedBlackTextField. */ public PropertyDescriptor[] getPropertyDescriptors() { try { List p = new ArrayList (); PropertyDescriptor redBlackDataDesc = new PropertyDescriptor("redBlackData", RedBlackTextField.class); redBlackDataDesc.setPropertyEditorClass (RedBlackEditor.class); p.add (redBlackDataDesc); return (PropertyDescriptor[]) p.toArray (new PropertyDescriptor [p.size()]); } catch (IntrospectionException e) { return null; } } /** * Gets the icon that represents the RedBlackTextField in a bean container. * * @param iconKind the kind (size) of the icon to return * @return the icon that represents the RedBlackTextField in a bean container. **/ public java.awt.Image getIcon(int iconKind) { if (iconKind == BeanInfo.ICON_MONO_16x16 || iconKind == BeanInfo.ICON_COLOR_16x16) { return loadImage ("redblacktextfield16x16.gif"); } if (iconKind == BeanInfo.ICON_MONO_32x32 || iconKind == BeanInfo.ICON_COLOR_32x32) { return loadImage ("redblacktextfield32x32.gif"); } return null; } }