Creating User Bean Templates

If you frequently use a bean with the same specific settings, you may save the bean with its settings as a template. This template is displayed in the Bean selector under given name, behaves as a normal bean and could be added to any project. The template has the same properties as the original bean. The values of the properties are preset in the template and could be marked as read only.
In this section, we will show how to create a bean template and save it.

How to Create and Save Templates.

Click the right mouse button on the selected bean icon on the Project panel in order to display the Bean pop-up menu.

 

Figure 1 - Bean Pop-up Menu

Select the Save bean settings as template item to open the Bean Template dialog window which allows to create and save the template.

 

Figure 2 - Bean Template Dialog

Dialog window has the following parts:

  • Bean template name: Name of the new template
  • Icon Icon representing the template. Click the icon to select a different icon.
  • Template author: Your name, name of the firm etc...
  • Customize settings... Button invokes the Template Editor which allows to change the settings of the bean. These settings will be saved as a template. (See the following section 'Customizing Bean Template Settings' for details).
  • Short template description: Type a short description.
  • User gets on of the messages: "Setting of the bean template is not dependent on the target CPU." or "Warning: Setting of the bean template is dependent on the target CPU". The second one means that the template will be shown in bean selector only for the current target CPU.
  • Associated peripheral / Mode - This setting is present only if it is meaningful. If the user chooses a peripheral, the template will be shown in OnChipPeripheral mode only for this peripheral.
  • Existing templates Shows list of the existing templates for the bean. Clicking on the item in the list will load the templates settings into the input fields.

 

After clicking the OK button, the bean template is saved and automatically added to the Beans Selector tree.

Customizing Bean Template Settings

If you click Customize settings... button in the Bean Template dialog the Template Editor dialog window is shown and you can make the following changes into the template:

 

  • set default values of properties,
  • set default values of methods or events (whether it has be generated or not generated),
  • rename methods (by double clicking on method name),
  • set feature of properties, methods or events as Read Only (the user cannot edit the default values for properties or change features like whether to generate or not to generate methods or events) or Changeable (user can edit default values of properties or change features generate/not generate of methods or events) by double clicking in the first column in Bean Inspector. The icon shows the status:
    • - feature is ReadOnly.
    • - feature is Changeable.
  • set level of visibility of properties, methods or events by repeatedly double clicking in last column in Bean Inspector. When you use the template you may change the level of visibility in the View menu in the Bean Inspector ( See chapter Bean Inspector for details. ).
    Possible values:
    • Type: BASIC - property/method/event will always be visible.
    • Type: ADVANCED - property/method/event will be visible if it is selected in Advanced view.
    • Type: EXPERT - property/method/event will be visible if it is selected in Expert view.
    • Type: @ HIDDEN @ - property/method/event will never be visible.

 

 

Figure 3 - Template Editor Window

Finally, click the icon on the bean inspector's toolbar to accept the changes.
To discard the changes and return without changing a template settings close the window or click the icon.


 

 

[top of page]