import java.beans.SimpleBeanInfo;
import java.beans.BeanDescriptor;
import java.beans.EventSetDescriptor;
import java.beans.MethodDescriptor;
import java.beans.PropertyDescriptor;
import java.beans.ParameterDescriptor;
import java.beans.BeanInfo;

public class ShowTextBeanInfo extends SimpleBeanInfo {

    public ShowTextBeanInfo() throws Exception {

        // Publish methods -------------------------------------------------

        _methodDescriptor = new MethodDescriptor[0];

        // Publish properties ----------------------------------------------
        _propertyDescriptor = new PropertyDescriptor[1];

        _propertyDescriptor[0] = new PropertyDescriptor("message",
                                  Class.forName("ShowText"));

        // Publish events --------------------------------------------------
        _eventSetDescriptor = new EventSetDescriptor[0];

    }

    public BeanDescriptor getBeanDescriptor() {
        try {
            return new BeanDescriptor(Class.forName("ShowText"));
        } catch (Exception e) {
            return null;
        }
        //if this ever gets a Customizer, then use other constructor
    }

    public EventSetDescriptor[] getEventSetDescriptors() {
        return _eventSetDescriptor;
    }

    public MethodDescriptor[] getMethodDescriptors() {
        return _methodDescriptor;
    }

    public PropertyDescriptor[] getPropertyDescriptors() {
        return _propertyDescriptor;
    }

    public BeanInfo[] getAdditionalBeanInfo() {
        return null;
    }

    public int getDefaultEventIndex() {
        return -1;
    }

    public int getDefaultPropertyIndex() {
        return -1;
    }

    private EventSetDescriptor[] _eventSetDescriptor;
    private MethodDescriptor[]   _methodDescriptor;
    private PropertyDescriptor[] _propertyDescriptor;
}