com.elj.beaninfo.awt
Class SimpleBeanInfo

java.lang.Object
  |
  +--java.beans.SimpleBeanInfo
        |
        +--com.elj.beaninfo.awt.SimpleBeanInfo
All Implemented Interfaces:
java.beans.BeanInfo
Direct Known Subclasses:
ComponentBeanInfo

public abstract class SimpleBeanInfo
extends java.beans.SimpleBeanInfo

Simple BeanInfo Abstract class provides the utility methods to set/get the properties. It's subclass should override the methods : getPropertyDescriptors(), getBeanDescriptor().


Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
 
Constructor Summary
SimpleBeanInfo()
           
 
Method Summary
 java.beans.PropertyDescriptor[] add(java.beans.PropertyDescriptor[] array1, java.beans.PropertyDescriptor[] array2)
          Adds the property descriptors array.
abstract  java.beans.BeanDescriptor getBeanDescriptor()
          Denies knowledge about the class and customizer of the bean
protected  java.beans.IndexedPropertyDescriptor getIndexedPropertyDescriptor(java.lang.String strProperty)
          Gets the indexed property descriptor with specified property name
 java.beans.PropertyDescriptor getPropertyDescriptor(java.beans.PropertyDescriptor[] array, java.lang.String propName)
          Gets the property descriptor from the array by specified property name.
protected  java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String strProperty)
          Gets the property descriptor with specified property name
abstract  java.beans.PropertyDescriptor[] getPropertyDescriptors()
          Denies knowledge of properties.
protected  java.beans.PropertyDescriptor getReadOnlyPropertyDescriptor(java.lang.String strProperty)
          Gets the read only property descriptor with specified property name
protected  java.beans.PropertyDescriptor getWriteOnlyPropertyDescriptor(java.lang.String strProperty)
          Gets the write only property descriptor with specified property name
 java.beans.PropertyDescriptor[] removePropertyDescriptor(java.beans.PropertyDescriptor[] array, java.lang.String propName)
          Removes the property descriptor from the array by specified property name.
 java.beans.PropertyDescriptor[] removePropertyDescriptors(java.beans.PropertyDescriptor[] array, java.lang.String[] propNames)
          Removes the property descriptors from the array by specified property names.
 
Methods inherited from class java.beans.SimpleBeanInfo
getAdditionalBeanInfo, getDefaultEventIndex, getDefaultPropertyIndex, getEventSetDescriptors, getIcon, getMethodDescriptors, loadImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleBeanInfo

public SimpleBeanInfo()
Method Detail

add

public java.beans.PropertyDescriptor[] add(java.beans.PropertyDescriptor[] array1,
                                           java.beans.PropertyDescriptor[] array2)
Adds the property descriptors array.
Parameters:
array1 - the array of property descriptor
array2 - the array of property descriptor
Returns:
the combined array of property descriptor

getPropertyDescriptor

public java.beans.PropertyDescriptor getPropertyDescriptor(java.beans.PropertyDescriptor[] array,
                                                           java.lang.String propName)
Gets the property descriptor from the array by specified property name.
Parameters:
array - the array of property descriptor
propName - the name of the property
Returns:
the property descriptor which name is propName if found in the array, otherwise null

removePropertyDescriptor

public java.beans.PropertyDescriptor[] removePropertyDescriptor(java.beans.PropertyDescriptor[] array,
                                                                java.lang.String propName)
Removes the property descriptor from the array by specified property name.
Parameters:
array - the array of property descriptor
propName - the name of the property
Returns:
the property descriptor array which name is propName if found in the array, otherwise null

removePropertyDescriptors

public java.beans.PropertyDescriptor[] removePropertyDescriptors(java.beans.PropertyDescriptor[] array,
                                                                 java.lang.String[] propNames)
Removes the property descriptors from the array by specified property names.
Parameters:
array - the array of property descriptor
propNames - the names of the properties
Returns:
the property descriptor array which names in propNames if found in the array, otherwise null

getPropertyDescriptor

protected final java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String strProperty)
Gets the property descriptor with specified property name
Parameters:
strProperty - the name of the property
Returns:
the property descriptor with the specified name

getIndexedPropertyDescriptor

protected final java.beans.IndexedPropertyDescriptor getIndexedPropertyDescriptor(java.lang.String strProperty)
Gets the indexed property descriptor with specified property name
Parameters:
strProperty - the name of the property
Returns:
the indexed property descriptor with the specified name

getReadOnlyPropertyDescriptor

protected final java.beans.PropertyDescriptor getReadOnlyPropertyDescriptor(java.lang.String strProperty)
Gets the read only property descriptor with specified property name
Parameters:
strProperty - the name of the property
Returns:
the read only property descriptor with the specified name

getWriteOnlyPropertyDescriptor

protected final java.beans.PropertyDescriptor getWriteOnlyPropertyDescriptor(java.lang.String strProperty)
Gets the write only property descriptor with specified property name
Parameters:
strProperty - the name of the property
Returns:
the write only property descriptor with the specified name

getPropertyDescriptors

public abstract java.beans.PropertyDescriptor[] getPropertyDescriptors()
Denies knowledge of properties.
Overrides:
getPropertyDescriptors in class java.beans.SimpleBeanInfo
Returns:
An array of PropertyDescriptor describing the editable properties supported by this bean. May return null if the information should be obtained by automatic analysis. If a property is indexed, then its entry in the result array will belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor. A client of getPropertyDescriptors can use "instanceof" to check if a given PropertyDescriptor is an IndexedPropertyDescriptor. A subclass of this class should override this method

getBeanDescriptor

public abstract java.beans.BeanDescriptor getBeanDescriptor()
Denies knowledge about the class and customizer of the bean
Overrides:
getBeanDescriptor in class java.beans.SimpleBeanInfo
Returns:
BeanDescriptor providing overall information about the bean, such as its displayName, its customizer, etc. May return null if the information should be obtained by automatic analysis A subclass of this class should override this method