FileDocCategorySizeDatePackage
MoleculeBeanInfo.javaAPI DocExample658Sat Apr 23 22:35:42 BST 2005magicbeans.sunw.demo.molecule

MoleculeBeanInfo.java

package magicbeans.sunw.demo.molecule;

/**
 * BeanInfo for a molecule.  We simply expose a single property
 * the molecule name, with a custome proeprty editor.
 */

import java.beans.*;

public class MoleculeBeanInfo extends SimpleBeanInfo {

    public PropertyDescriptor[] getPropertyDescriptors() {
	try {
	    PropertyDescriptor pd = new PropertyDescriptor("moleculeName",
					    		Molecule.class);
	    pd.setPropertyEditorClass(MoleculeNameEditor.class);
	    PropertyDescriptor result[] = { pd };
	    return result;
	} catch (Exception ex) {
	    System.err.println("MoleculeBeanInfo: unexpected exeption: " + ex);
	    return null;
	}
    }

}