Home » openjdk-7 » sun » swing » [javadoc | source]
sun.swing
public class: BeanInfoUtils [javadoc | source]
java.lang.Object
   sun.swing.BeanInfoUtils
Field Summary
public static final  String BOUND     
public static final  String CONSTRAINED     
public static final  String PROPERTYEDITORCLASS     
public static final  String READMETHOD     
public static final  String WRITEMETHOD     
public static final  String DISPLAYNAME     
public static final  String EXPERT     
public static final  String HIDDEN     
public static final  String PREFERRED     
public static final  String SHORTDESCRIPTION     
public static final  String CUSTOMIZERCLASS     
Method from sun.swing.BeanInfoUtils Summary:
createBeanDescriptor,   createPropertyDescriptor,   throwError
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from sun.swing.BeanInfoUtils Detail:
 public static BeanDescriptor createBeanDescriptor(Class cls,
    Object[] args) 
    Create a BeanDescriptor object given an of keyword/value arguments. The following sample call shows all of the supported keywords:
         createBeanDescriptor(JWindow..class, new Object[] {
              CUSTOMIZERCLASS, package.MyCustomizer.class,
                  DISPLAYNAME, "JFrame",
                       EXPERT, Boolean.FALSE,
                       HIDDEN, Boolean.FALSE,
                    PREFERRED, Boolean.TRUE,
             SHORTDESCRIPTION, "A top level window with a window manager border",
            "random attribute","random object value"
           }
        );
    
    The keywords correspond to java.beans.BeanDescriptor and java.beans.FeatureDescriptor properties, e.g. providing a value for displayName is comparable to FeatureDescriptor.setDisplayName(). Using createBeanDescriptor instead of the BeanDescriptor constructor and set methods is preferrable in that it regularizes the code in a java.beans.BeanInfo.getBeanDescriptor() method implementation. One can use createBeanDescriptor to set FeatureDescriptor attributes, as in "random attribute" "random object value".
 public static PropertyDescriptor createPropertyDescriptor(Class cls,
    String name,
    Object[] args) 
    Create a beans PropertyDescriptor given an of keyword/value arguments. The following sample call shows all of the supported keywords:
         createPropertyDescriptor("contentPane", new Object[] {
                        BOUND, Boolean.TRUE,
                  CONSTRAINED, Boolean.TRUE,
          PROPERTYEDITORCLASS, package.MyEditor.class,
                   READMETHOD, "getContentPane",
                  WRITEMETHOD, "setContentPane",
                  DISPLAYNAME, "contentPane",
                       EXPERT, Boolean.FALSE,
                       HIDDEN, Boolean.FALSE,
                    PREFERRED, Boolean.TRUE,
             SHORTDESCRIPTION, "A top level window with a window manager border",
            "random attribute","random object value"
           }
        );
    
    The keywords correspond to java.beans.PropertyDescriptor and java.beans.FeatureDescriptor properties, e.g. providing a value for displayName is comparable to FeatureDescriptor.setDisplayName(). Using createPropertyDescriptor instead of the PropertyDescriptor constructor and set methods is preferrable in that it regularizes the code in a java.beans.BeanInfo.getPropertyDescriptors() method implementation. One can use createPropertyDescriptor to set FeatureDescriptor attributes, as in "random attribute" "random object value".

    All properties should provide a reasonable value for the SHORTDESCRIPTION keyword and should set BOUND to Boolean.TRUE if neccessary. The remaining keywords are optional. There's no need to provide values for keywords like READMETHOD if the correct value can be computed, i.e. if the properties get/is method follows the standard beans pattern.

    The PREFERRED keyword is not supported by the JDK1.1 java.beans package. It's still worth setting it to true for properties that are most likely to be interested to the average developer, e.g. AbstractButton.title is a preferred property, AbstractButton.focusPainted is not.

 public static  void throwError(Exception e,
    String s) 
    Fatal errors are handled by calling this method.