// Cisco Systems Confidential
// Copyright (c) 1999 by Cisco Systems, Inc.
// All rights reserved.

package com.cisco.ipphone.sdk.wfapi;

import java.beans.*;
import symantec.itools.beans.*;
import com.cisco.wfapi.step.jbstep.WFJBStepUISupport;
import java.io.*;

public class StepPhonePushBeanInfo extends java.beans.SimpleBeanInfo implements WFJBStepUISupport
{
	public StepPhonePushBeanInfo()
	{
	}

	/**
	 * Gets a BeanInfo for the superclass of this bean.
	 * @return BeanInfo[] containing this bean's superclass BeanInfo
	 */
	public BeanInfo[] getAdditionalBeanInfo()
	{
		try
		{
			BeanInfo[] bi = new BeanInfo[1];
			bi[0] = Introspector.getBeanInfo(beanClass.getSuperclass());
			return bi;
		}
		catch (IntrospectionException e)
		{
			throw new Error(e.toString());
		}
	}

	/**
	* Gets the BeanDescriptor for this bean.
	* @return an object of type BeanDescriptor
	* @see java.beans.BeanDescriptor
	*/
	public BeanDescriptor getBeanDescriptor()
	{
		BeanDescriptor bd = new BeanDescriptor(beanClass, StepPhonePushCustomizer.class);
		bd.setDisplayName(StepPhonePush.STEP_NAME);
		return bd;
	}

	/**
	 * Gets an image that may be used to visually represent this bean
	 * (in the toolbar, on a form, etc).
	 * @param iconKind the type of icon desired, one of: BeanInfo.ICON_MONO_16x16,
	 * BeanInfo.ICON_COLOR_16x16, BeanInfo.ICON_MONO_32x32, or BeanInfo.ICON_COLOR_32x32.
	 * @return an image for this bean
	 * @see BeanInfo#ICON_MONO_16x16
	 * @see BeanInfo#ICON_COLOR_16x16
	 * @see BeanInfo#ICON_MONO_32x32
	 * @see BeanInfo#ICON_COLOR_32x32
	 */
	public java.awt.Image getIcon(int nIconKind)
	{
	    if (nIconKind == BeanInfo.ICON_COLOR_16x16)
	    {
	        java.awt.Image img = loadImage("StepPhonePushIconColor16.gif");
	        return img;
        }
        if (nIconKind == BeanInfo.ICON_COLOR_32x32)
        {
            java.awt.Image img = loadImage("StepPhonePushIconColor32.gif");
            return img;
        }
        return null;
	}

	public java.io.InputStream getBitmapInputStream(int nIconKind)
	{
	    if (nIconKind == BeanInfo.ICON_COLOR_16x16)
	    {
	        java.io.InputStream fs = this.getClass().getResourceAsStream("StepPhonePushIconColor16.bmp");
	        return fs;
        }
        if (nIconKind == BeanInfo.ICON_COLOR_32x32)
        {
	        java.io.InputStream fs = this.getClass().getResourceAsStream("StepPhonePushIconColor32.bmp");
	        return fs;
        }
        return null;

	}

	private final Class beanClass = StepPhonePush.class;
}