BeanInfo reference
Created by Stefan Rennick Egglestone 2005-11-16
Last updated by Chris Greenhalgh 2005-11-28
Introduction
Using the BeanDescriptor
Using PropertyDescriptors
Supplying an icon
The provision of one BeanInfo class per component is
one method which can
be used to indicate to ECT the existence of that component. For more
information,
see the Component
Development Guide.
BeanInfo classes can either be auto-generated from a component class,
or can
be manually constructed by a developer. This reference guide is
intended for those who wish to use this latter method, and describes
the information about
a component that can be specified in a BeanInfo class.
Classes which implement the BeanInfo interface must provide
a method which can return a java.beans.BeanDescriptor)
object which describes the bean. Information included in a generic
bean descriptor includes:
BeanInfo classes representing components should use
these properties
and attributes
as following:
- displayName should be used as the normally
presented bean name. It is displayed, for example, in the tree
presented in the capability editor
- shortDescription should be a brief description of the component.
It is displayed, for example, in a line of text at the bottom of the
capability browser, and as a tooltip in the capability browser.
Optionally, it can be formatted in HTML.
- preferred, expert and hidden should not normally be used
- attribute "classification" specifies where the component should
appear in the capability browser; sub-folders
names are separated by '/'. For example, "Hardware/Input" for an input
device interface component. See
component
classifications list
for current classifications.
- attribute "htmlDescription" can be used to specify
any length documentation necessary for a component.
- attribute "DefaultInputProperty" can be used to specify the name
of a property to be used a the (only) default input, for example in the
display editor.
- attribute "DefaultOutputProperty" can be used to specify the name
of a property to be used a the (only) default input, for example in the
display editor.
See Component documentation guide
for more information about how some of these properties and attributes
are used by ECT.
Each component property is described by a Property
Descriptor (java.beans.PropertyDescriptor).
This identifies the properties "external" name, its set and get methods
(normally both, or just a get method for read-only properties) and the
property's type (java class, normally automatically determined).
Property descriptors can contain additional information which may be
used by ECT. In particular
A Bean Info can provide an icon for its bean, in one or
more
combinations of 16x16 or 32x32 and mono or colour. 16x16 colour is
recommended as a minimum, with a transparent background.