borland Packages  Class Hierarchy  jb.util Package 

BasicBeanInfo class (abstract)

java.lang.Object
   +----com.borland.jb.util.BasicBeanInfo
           +----com.borland.datastore.DataStoreBeanInfo
           +----com.borland.datastore.DataStoreConnectionBeanInfo
           +----com.borland.datastore.TxManagerBeanInfo
           +----com.borland.datastore.jdbc.DataStoreServerBeanInfo
           +----com.borland.dx.dataset.ColumnBeanInfo
           +----com.borland.dx.dataset.DataSetViewBeanInfo
           +----com.borland.dx.dataset.ParameterRowBeanInfo
           +----com.borland.dx.dataset.StorageDataSetBeanInfo
           +----com.borland.dx.dataset.TextDataFileBeanInfo
           +----com.borland.dx.sql.dataset.DatabaseBeanInfo
           +----com.borland.dx.sql.dataset.ProcedureResolverBeanInfo
           +----com.borland.dx.sql.dataset.QueryResolverBeanInfo

About the BasicBeanInfo class

Variables  Properties  Methods  

Implements BeanInfo

A convenient implementation of the java.beans.BeanInfo interface, designed to be subclassed to fill in appropriate properties, methods, and events for a JavaBean. Extend BasicBeanInfo when you want to provide explicit information about your component rather than have JBuilder and other such tools derive the information through introspection.


BasicBeanInfo variables

Variables implemented in this class

BasicBeanInfo properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

BasicBeanInfo methods

Methods implemented in this class

Methods implemented in java.lang.Object


BasicBeanInfo variables

additionalBeanInfo

  protected BeanInfo[]additionalBeanInfo
An array of other other bean information objects.

beanClass

  protected Class beanClass
The JavaBean component class. A subclassed bean information class must specify a component class, which is the only required field.

CONTAINER_DELEGATE

  public static final String CONTAINER_DELEGATE = "containerDelegate"
A Bean descriptor key value used to inform a designer that the add calls and layout setting should not be applied directly to the component, but should call this method first.

The method is assumed to take no parameters. javax.swing.JFrame contains the following example:

 setValue("containerDelegate","getContentPane");

customizerClass

  protected Class customizerClass
The customizer class for this JavaBean, if one exists.

defaultEventIndex

  protected int defaultEventIndex
The index of the default event for your JavaBean. The index identifies the event in the set of event descriptors described held in the array of the the eventSetDescriptors property. An index value of -1 means there is no default event.

defaultPropertyIndex

  protected int defaultPropertyIndex
The index of the default property for your JavaBean. The index identifies the property in the set of property descriptors held in the array of the the propertyDescriptors property. An index value of -1 means there is no default property.

ENUMERATION

  public static final String ENUMERATION = "enumerationValues"
A property descriptor key value that will cause a tag list property editor to be associated with this property.

The value for this key should be an Object array with three values for each entry desired in the tag list. The first value in each set is the text that will appear in the tag list, the next value is the live value and the third value is the java Initialization String.

eventListenerMethods

  protected String[][]eventListenerMethods
The names of each event set's listener methods. Specify the names using this format:

 {{"listener1Method1", "listener1Method2",
     "listener1Method3", ...}, ...} 

Example:

{{"actionPerformed"}, ...}

eventSetDescriptors

  protected String[][]eventSetDescriptors
The event information for your JavaBean. Specify the event information using this format:
{{"EventSetName", "EventListenerClass", "AddMethod", 
    "RemoveMethod"}, ...}

Example:

{{"ActionListener", "java.awt.event.ActionListener", "addActionListener", "removeActionListener"}, ...}

iconColor16x16

  protected Image iconColor16x16
A 16x16 pixel color icon for your JavaBean. If none is specified, one will be searched for using a default resource name.

iconColor32x32

  protected Image iconColor32x32
A 32x32 pixel color icon for your JavaBean.

iconMono16x16

  protected Image iconMono16x16
A 16x16 pixel monochromatic icon for your JavaBean. If none is specified, one will be searched for using a default resource name.

iconMono32x32

  protected Image iconMono32x32
A 32x32 pixel monochromatic icon for your JavaBean. If none is specified, one will be searched for using a default resource name.

IS_CONTAINER

  public static final String IS_CONTAINER = "isContainer"
A Bean descriptor key value used to inform a designer that although the bean extends java.awt.Container it should not be treated as one. The value should be false.

When not present, beans that extend java.awt.Container are treated as a containers.

LATE_SETTING

  public static final String LATE_SETTING = "lateSetting"
A property descriptor key value that operates as a hint to the designer that this property setting should come near the end (after the add calls). The value should be set to true.

When not present, this variable is assumed to be false.

methodNames

  protected String[]methodNames
The method names for your JavaBean. Don't include the access methods for properties. Specify the method names using this format:
{"method1", "method2", "method3", ...}

Example:

{"fillRect", "eraseRect", "close", "open"}

methodParameters

  protected String[][]methodParameters
The method parameters for each of your JavaBean's methods. Specify the parameters using this format:
{{"method1Parameter1", "method1Parameter2", ...}, ...} 

Example:

{{"java.awt.Graphics", "java.awt.Rectangle", ...}, ...}

namedAttributes

  protected Object[][]namedAttributes
Any additional named attributes for the JavaBean. Specify the attributes using this format:
{{"AttributeName", AttributeSetting}, ...}

Example:

{{"isContainer", Boolean.TRUE}, {"containerDelegate", "getContentPane"}, ...}

propertyDescriptorAttributes

  protected Object[][]propertyDescriptorAttributes
Additional attributes for each property described in the propertyDescriptors array. Entries in the propertyDescriptorAttributes array and the propertyDescriptors array are matched by an index position in each array. Use a null value as a placeholder for property entries without attributes. The propertyDescriptorAttributes array need not be the same size as the propertyDescriptors array.

Specify the attributes using this format:

{{"AttributeName", "AttributeValueAsString"}, ...} 

Example:

{null, {"enumerationValues", "LEFT, 2, SwingConstants.LEFT, CENTER, 0, SwingConstants.CENTER"},}

propertyDescriptors

  protected String[][]propertyDescriptors
The property information for your JavaBean. Null parameters are ignored, with the exception of GetterMethodName and SetterMethodName for which a null value (not "") indicates the property should be write-only or read-only, respectively.

Setting both the GetterMethodName and SetterMethodName to the empty string ("") indicates that the standard Java property naming rules should be applied to determine the getter and setter names from the property name.

The first four entries are required; use null as a placeholder to ignore properties. If the SetterMethodParamType entry is non-null, it will be used to find the actual setter method with that parameter type, rather than letting java.beans.PropertyDescriptor find it. To specify a primitive type as the parameter type, append ".class" to the end of the primitive type name. Specify the property information using this format:

{{"PropertyName", "Short Description", "GetterMethodName", "SetterMethodName", "PropertyEditor", "Expert", "Hidden", "SetterMethodParamType"}, ...} Example: {{"text", "Control Text", "getText", "setText", "mypackage.MyPropertyEditor", "true", "false", "java.lang.String"}, ...} 

Example:

{{"eigenvalue", "Complex property", "", "", null, "true", "true", "int.class"}, ...}


BasicBeanInfo properties

additionalBeanInfo

 public BeanInfo[]getAdditionalBeanInfo()
Returns the array of bean information objects for this JavaBean.

beanDescriptor

 public BeanDescriptor getBeanDescriptor()
Returns the bean descriptor associated with this JavaBean.

defaultEventIndex

 public int getDefaultEventIndex()
Returns the default event index for this JavaBean. The index returned locates the event in the eventSetDescriptors array. An index value of -1 means there is no default event for this bean.

defaultPropertyIndex

 public int getDefaultPropertyIndex()
Returns the default property index for this JavaBean. The index returned locates the property in the propertyDescriptors array. An index value of -1 means there is no default property for this bean.

eventSetDescriptors

 public EventSetDescriptor[]getEventSetDescriptors()
Returns the array of event set descriptors for this JavaBean.

methodDescriptors

 public MethodDescriptor[]getMethodDescriptors()
Returns the array of method descriptors for this JavaBean.

propertyDescriptors

 public PropertyDescriptor[]getPropertyDescriptors()
Returns the array of property descriptors for this JavaBean.

BasicBeanInfo methods

getDefaultIconResource(int)

  protected String getDefaultIconResource(int iconKind)
Returns the default resource to use to find an icon for a JavaBean.

If an icon is requested, and not explicitly set in the subclass of BasicBeanInfo, an icon is searched for using a simple look-up using the beanClass's name and the requested icon type.

Following is a simple chart describing the default resource locations using an example of the JavaBean class package1.package2.MyBean:

ICON_COLOR_16x16
image/MyBean_Color16.gif
ICON_COLOR_32x32
image/MyBean_Color32.gif
ICON_MONO_16x16
image/MyBean_Mono16.gif
ICON_MONO_32x32
image/MyBean_Mono32.gif

Parameters:

iconKind
The int representing the icon type from java.beans.BeanInfo

getImage(java.lang.String)

  public Image getImage(String resource)
This is a simple utility function that retrieves an Image object from a resource. The resource must by specified as a relative path to the beanClass resource.

Parameters:

resource
The resource name relative to the beanClass resource.