Creating a tab button through a stereotype
Typically, you will want to create Stereotypes within a profile Package.
This topic documents creating a Stereotype through the Packages pane. For information about using a Profile Diagram to create a Stereotype, specify valid model item types and define Scripts, see Overview of profile diagrams.
To create a tab button through a stereotype:
1. Right-click the profile Package, and select New > UML > Profiles > Stereotype.
2. Type a name for the Stereotype, and then press the Enter key.
If you want the display name of the Stereotype in Modeler to be different from its real name: on the General tab of the Stereotype's property pages, type the display name in the Name Alias box.
3. Open the Stereotype's Property Pages, and select valid diagram types for the Stereotype (the Stereotype can be applied only to diagrams whose type is valid):
a. Click the Items tab.
b. In the drop-down list box select Model Item Types, and then click the Link button.
c. In the middle or right pane, select the check boxes associated with valid diagram types.
d. In the middle or right pane, clear the check boxes associated with invalid diagram types.
e. Click
OK.
4. Click the Toolbar tab, and then click the New Item button.
5. Ensure that the new entry is selected, and then click the selected cell in the Diagram Toolbar Command column.
6. Select the diagram tab button on which you want to base the new customized tab button.
A diagram button is valid only for the diagram type it specifies. Toolbar buttons that do not include a diagram name are valid for all diagram types.
If you want only to add a standard button to a customized diagram tab, you can ignore the steps that follow.
7. If you want the customized button to be part of a group of tab buttons (split button), such as, the Dependency buttons on the Class Diagram tab.
a. Ensure that the new entry is selected, and then click the selected cell in the Group ID column.
b. Type the value of the group.
All buttons that appear on the tab and have the same group value will appear as buttons of the same split button.
8. Specify the text you want to appear as a ToolTip when you rest the mouse pointer over the button:
a. Ensure that the new entry is selected, and then click the selected cell in the ToolTip column.
b. Type the text you want to appear as a ToolTip.
If you want to use the ToolTip text of the button on which the customized tab button is based, leave the ToolTip box blank.
9. Specify the text you want to appear in the status bar when you rest the mouse pointer over the button:
a. Ensure that the entry is selected, and then click the selected cell in the Status Bar Text column.
b. Type the text you want to appear in the status bar.
If you want to use the status bar text of the button on which the customized button is based, leave the Status Bar Text box blank.
10. If you want a separator to the left of the customized button:
a. Ensure that the new entry is selected, and then click the Separator Before column.
b. Set the Separator Before property to Yes.
11. If you want the customized button to use a different icon to that of the tab button on which it is based, click the Select Icon button, and then select the icon you want to use.
12. Specify the script, which is run after the item has been added to a diagram:
a. Ensure that the new entry is selected, and then click the Edit Script button.
b. Type the script, click the Save button, and then close the window.
Write the script within the available functions for a Diagram Toolbar Command script. For more information about working with scripts, see:
The customized button will be used by any diagram that is stereotyped directly by the Stereotype.