Adding property features

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:

  1. From the tool bar, select (New Property icon) 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.

  2. In the SmartGuide - New Property Feature window, do the following:

    1. Specify the property name in the Property name field.

    2. Specify the property type in the Property type field.

    3. 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.

    4. 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.

    5. If you want the property to send value changes on connections, make sure that the bound check box is selected.

    6. 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.

    7. If you want other beans to be able to veto value changes for the property, select the constrained check box.

    8. Select Next to open the SmartGuide - Bean Information window.

  3. In the SmartGuide - Bean Information window, do the following:

    1. 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.

    2. 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.

    3. 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.

    4. If you do not want the property to be exposed to the bean consumer, select the hidden check box.

    5. If you want to provide customized initialization of the property, specify a property editor class.

    6. 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.


Related concepts
Feature naming guidelines
Generated code

Related procedures
Defining bean interfaces for visual composition
Creating and modifying a BeanInfo class
Specifying expert features
Specifying hidden features

Related references
New Property Feature SmartGuide
Bean Information SmartGuide
Features pane--BeanInfo page