Define property features to represent bean data or attributes that you want
other beans to have access to.
Add a new property feature in the BeanInfo page as follows:
- From the tool bar, select
New Property Feature. If you prefer, you can select
New Property Feature from the Features menu.
Either selection opens the SmartGuide - New Property Feature
window.
- In the SmartGuide - New Property Feature window, do the
following:
- Specify the property name in the Property name field.
- Specify the property type in the Property type field.
- If you want the property value to be retrievable, make sure that the
Readable check box is selected. If this option is selected,
a get method is generated for the property.
- If you want the property value to be modifiable, make sure that the
Writeable check box is selected. If this option is selected,
a set method is generated for the property.
- If you want the property to send value changes on connections, make sure
that the bound check box is selected.
- If the property consists of an array of elements, select the
Indexed check box. After you finish adding the property
feature, select Add Available Features from the Features
menu to add the get and set array element methods as features so you can make
connections to them.
- If you want other beans to be able to veto value changes for the property,
select the constrained check box.
- Select Next to open the SmartGuide - Bean Information
window.
- In the SmartGuide - Bean Information window, do the following:
- If you want a name other than the actual feature name to be displayed for
the property in the Visual Composition Editor, specify the name in the
Display name field. This name appears when the property is
listed in connection menus, the bean property sheet, and other windows.
- If you want a description other than the feature name to be displayed for
the property in the Visual Composition Editor, specify the description in the
Short description field. This description appears in certain
windows, such as connection windows and the Promote Features window, when the
property is selected.
- If you do not want the property to appear in development windows unless
the user chooses to display expert features, select the expert
check box.
- If you do not want the property to be exposed to the bean consumer, select
the hidden check box.
- If you want to provide customized initialization of the property, specify
a property editor class.
- Select Finish to add the property. VisualAge generates
the following:
- Public methods for the feature in the bean class
- Bean information code that describes the feature in the BeanInfo class for
the bean
You can modify BeanInfo for the property in the Information pane
of the BeanInfo page. If you want the property to appear as a preferred
feature in the connection menu of the bean, set the feature's
Preferred property to true. If you do not want
the property to appear in the property sheet of the bean, set the
feature's Design time property property to
false.
Feature naming guidelines
Generated code
Defining bean interfaces for visual composition
Creating and modifying a BeanInfo class
Specifying expert features
Specifying hidden features
New Property Feature SmartGuide
Bean Information SmartGuide
Features pane--BeanInfo page
