package Templates.API_Support.Compiler_API;

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

import org.openide.ErrorManager;
import org.openide.compiler.ExternalCompilerType;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;

/** Description of the compiler type.
 *
 * @author __USER__
 */
public class __Sample_external__CompilerTypeBeanInfo extends SimpleBeanInfo {

    // Inherit properties and so on from ExternalCompilerType.
    public BeanInfo[] getAdditionalBeanInfo() {
        try {
            return new BeanInfo[] {
                Introspector.getBeanInfo(ExternalCompilerType.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$CompilerTypeBeanInfo$CompilerType$MyCompilerType__.class);
        // Display name also serves as default for instances:
        desc.setDisplayName(NbBundle.getMessage(__NAME__.class, "LBL_CompilerType"));
        desc.setShortDescription(NbBundle.getMessage(__NAME__.class, "HINT_CompilerType"));
        return desc;
    }

    public PropertyDescriptor[] getPropertyDescriptors() {
        try {
            PropertyDescriptor valueOfMyOption = new PropertyDescriptor("valueOfMyOption", __NAME$CompilerTypeBeanInfo$CompilerType$MyCompilerType__.class);
            valueOfMyOption.setDisplayName(NbBundle.getMessage(__NAME__.class, "PROP_valueOfMyOption"));
            valueOfMyOption.setShortDescription(NbBundle.getMessage(__NAME__.class, "HINT_valueOfMyOption"));
            // If you wish to provide a custom set of preconfigured error expressions:
            /*
            PropertyDescriptor errorExpression = new PropertyDescriptor("errorExpression", __NAME$CompilerTypeBeanInfo$CompilerType$MyCompilerType__.class);
            errorExpression.setDisplayName(NbBundle.getMessage(__NAME__.class, "PROP_errorExpression"));
            errorExpression.setShortDescription(NbBundle.getMessage(__NAME__.class, "HINT_errorExpression"));
            errorExpression.setPropertyEditorClass(ErrExprEd.class);
            */
            return new PropertyDescriptor[] {valueOfMyOption /* , errorExpression */};
        } 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$CompilerTypeBeanInfo$CompilerIcon$MyIcon__.gif");
        } else {
            return Utilities.loadImage("__PACKAGE_AND_NAME_SLASHES$CompilerTypeBeanInfo$CompilerIcon32$MyIcon32__.gif");
        }
    }

    /*
    public static class ErrExprEd extends org.openide.explorer.propertysheet.editors.ExternalCompiler.ErrorExpressionEditor {

	public ErrExprEd() {
	    super(makeCollection());
	}

	private static Collection makeCollection() {
	    java.util.List list = new java.util.ArrayList();
	    list.addAll(java.util.Arrays.asList(__NAME$CompilerTypeBeanInfo$CompilerType$MyCompilerType__.ERROR_EXPRS));
	    return list;
	}

    }
    */

}
