![]() |
![]() |
![]() |
Use the BeanInfo page of the Class/Interface Browser to view, define, or modify bean interface features. These features, consisting of properties, events, and methods, represent the characteristics and behavior of your class. When you add features in the BeanInfo page, you define the external view of your bean to consumers who use the bean. By contrast, when you compose a composite bean in the Visual Composition Editor, you define the internal content of the bean.
When you add a new feature in the BeanInfo page, VisualAge generates code for the feature in the bean class. For some features, particularly properties, you might not need to modify this generated code. Additionally, VisualAge generates code that describes the feature in the BeanInfo class for the bean. If a BeanInfo class does not exist for the bean, it is created when you add the first feature in the BeanInfo page. You can also create a BeanInfo class from the Features menu. See the JavaSoft Home Page for links to detailed information on JavaBeans and BeanInfo.
If you do not want your bean to inherit features from its superclass, turn off BeanInfo inheritance before a BeanInfo class is created for your bean. If BeanInfo is not inherited from the superclass, only features defined in your bean are available to bean consumers. This means that no inherited features are available for connections or the property sheet when your bean is embedded in another bean. BeanInfo inheritence does not affect accessibility within your class to inherited methods and fields. To control Beaninfo inheritance, open the Options window from the Window menu of the Workbench. Then, set the Inherit BeanInfo of bean superclass check box in the Design Time pane.
If you edit an embedded bean in the Visual Composition Editor and then change its features in the BeanInfo page, be sure to refresh the bean interface when you return to the Visual Composition Editor. Do this by selecting Refresh Interface from the bean pop-up menu in the Visual Composition Editor.
From the BeanInfo page, use either the Features menu or the tool bar, or both, to manage bean features. Open the Features menu either by selecting it from the menu bar Features choice or by opening it as a pop-up menu from the Features pane.
Fields
Menu choices
Defining Bean Interfaces for Visual Composition
BeanInfo Page Menus
BeanInfo Page Tools