alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
* TestFormExecutorBeanInfo.java
*/ 

package org.netbeans.examples.modules.testforms;

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

import org.openide.execution.ThreadExecutor;

/** Description of the executor.
 *
 * @author jglick
 */
public class TestFormExecutorBeanInfo extends SimpleBeanInfo {

    // Inherit properties and so on from Executor.
    public BeanInfo[] getAdditionalBeanInfo () {
        try {
            return new BeanInfo[] {
                       Introspector.getBeanInfo (ThreadExecutor.class)
                   };
        } catch (IntrospectionException ie) {
            org.openide.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 (TestFormExecutor.class);
        // Display name also serves as default for instances:
        desc.setDisplayName ("Test Forms");
        desc.setShortDescription ("Tests forms.");
        return desc;
    }

    public PropertyDescriptor[] getPropertyDescriptors () {
//        try {
            /*
            PropertyDescriptor myProp = new PropertyDescriptor ("myProp", TestFormExecutor.class);
            myProp.setDisplayName (NbBundle.getBundle (TestFormExecutorBeanInfo.class).getString ("PROP_myProp"));
            myProp.setShortDescription (NbBundle.getBundle (TestFormExecutorBeanInfo.class).getString ("HINT_myProp"));
            */
            return new PropertyDescriptor[] { };
    }

    private static Image icon, icon32;
    public Image getIcon (int type) {
        if (type == BeanInfo.ICON_COLOR_16x16 || type == BeanInfo.ICON_MONO_16x16) {
            if (icon == null)
            icon = loadImage ("TestFormExecutorIcon.gif");
            return icon;
        } else {
            if (icon32 == null)
              icon32 = loadImage ("TestFormExecutorIcon32.gif");
            return icon32;
        }
    }

}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.