package Templates.API_Support.Execution_API;

import java.awt.Image;
import java.beans.*;

import org.openide.ErrorManager;
import org.openide.execution.ProcessExecutor;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;

/** Description of the executor.
 *
 * @author __USER__
 */
public class __Sample_external__ExecutorBeanInfo extends SimpleBeanInfo {

    // Inherit properties and so on from ProcessExecutor.
    public BeanInfo[] getAdditionalBeanInfo() {
        try {
            return new BeanInfo[] {
                Introspector.getBeanInfo(ProcessExecutor.class)
            };
        } catch (IntrospectionException ie) {
            ErrorManager.getDefault().notify(ie);
            return null;
        }
    }

    public BeanDescriptor getBeanDescriptor() {
        // Here is where to include a customizer class if you have one:
        BeanDescriptor desc = new BeanDescriptor(__NAME$ExecutorBeanInfo$Executor$MyExecutor__.class);
        // Display name also serves as default for instances:
        desc.setDisplayName(NbBundle.getMessage(__NAME__.class, "LBL_executor"));
        desc.setShortDescription(NbBundle.getMessage(__NAME__.class, "HINT_executor"));
        return desc;
    }

    public PropertyDescriptor[] getPropertyDescriptors() {
        try {
            PropertyDescriptor valueOfMyOption = new PropertyDescriptor("valueOfMyOption", __NAME$ExecutorBeanInfo$Executor$MyExecutor__.class);
            valueOfMyOption.setDisplayName(NbBundle.getMessage(__NAME__.class, "PROP_valueOfMyOption"));
            valueOfMyOption.setShortDescription(NbBundle.getMessage(__NAME__.class, "HINT_valueOfMyOption"));
            return new PropertyDescriptor[] {valueOfMyOption};
        } catch (IntrospectionException ie) {
            ErrorManager.getDefault().notify(ie);
            return null;
        }
    }

    public Image getIcon(int type) {
        if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) {
            return Utilities.loadImage("__PACKAGE_AND_NAME_SLASHES$ExecutorBeanInfo$ExecutorIcon$MyIcon__.gif");
        } else {
            return Utilities.loadImage("__PACKAGE_AND_NAME_SLASHES$ExecutorBeanInfo$ExecutorIcon32$MyIcon32__.gif");
        }
    }

}
