Define method features to represent bean behaviors or functions that you
want other beans to have access to.
Add a new method feature in the BeanInfo page as follows:
- From the tool bar, select
New Method Feature. If you prefer, you can select New
Method Feature from the Features menu. Either
selection opens the SmartGuide - New Method Feature window.
- In the SmartGuide - New Method Feature window, do the
following:
- Specify the method name in the Method name field.
- Specify the method return type in the Return type field.
- If your method feature requires parameter input, specify the number of
parameters in the Parameter count field.
- Select Next to open the either the SmartGuide - Parameter
window or the SmartGuide - Bean Information window.
- In the SmartGuide - Parameter window for each parameter, do the
following:
- Specify the parameter name in the Parameter name field.
- Specify the parameter type in the Parameter type field.
- If you want a name other than the actual parameter name to be displayed
for the parameter in the Visual Composition Editor, specify the name in the
Display name field. This name appears when the parameter is
listed in visual composition windows.
- If you want a description other than the feature name to be displayed for
the parameter in the Visual Composition Editor, specify the description in the
Short description field. This description appears when the
parameter is selected in visual composition windows.
- 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 method in the Visual Composition Editor, specify the name in the
Display name field. This name appears when the method is
listed in connection menus, the Promote Features window, and other
windows.
- If you want a description other than the feature name to be displayed for
the method 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
method is selected.
- If you do not want the method to appear in development windows unless the
user chooses to display expert features, select the expert check
box.
- If you do not want the method to be exposed to the bean consumer, select
the hidden check box.
- Select Finish to add the method. VisualAge generates the
following:
- A public method 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 method in the Information pane
of the BeanInfo page. If you want the method to appear as a preferred
feature in the connection menu of the bean, set the feature's
Preferred property to true.
Feature naming guidelines
Generated code
Defining bean interfaces for visual composition
Creating and modifying a BeanInfo class
Specifying expert features
Specifying hidden features
New Method Feature SmartGuide
Parameter SmartGuide
Bean Information SmartGuide
Features pane--BeanInfo page
