/*
 * NervousTextBeanInfo.java    1.0 97/08/28
 *
 * Copyright (c) 1997 Netscape Communications Corporation
 *
 * Netscape grants you a non-exclusive, royalty free, license to use,
 * modify and redistribute this software in source and binary code form,
 * provided that i) this copyright notice and license appear on all copies of
 * the software; and ii) Licensee does not utilize the software in a manner
 * which is disparaging to Netscape.
 *
 * This software is provided "AS IS," without a warranty of any kind.
 * See the CDK License Agreement for additional terms and conditions.
 * created: 2/97 cls
 */

package netscape.peas;


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 NervousTextBeanInfo extends SimpleBeanInfo {

    public NervousTextBeanInfo() throws Exception {

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

        _methodDescriptor = new MethodDescriptor[0];

//        ParameterDescriptor[] params = new ParameterDescriptor[0];
//        _methodDescriptor[0] = new MethodDescriptor(params);
//        _methodDescriptor[0].setName("getMessage");
//
//        params = new ParameterDescriptor[1];
//        params[0] = new ParameterDescriptor();
//        params[0].setName("newMessage");
//        _methodDescriptor[1] = new MethodDescriptor(params);
//        _methodDescriptor[1].setName("setMessage");


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

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

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

    }

    public BeanDescriptor getBeanDescriptor() {
        try {
            return new BeanDescriptor(Class.forName("netscape.peas.NervousText"));
        } 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;
}
