Prev | Next |
Add an Enumeration to a Stereotype
Enumeration elements can be used to generate a drop-down list of values for a Tagged Value associated with a Stereotype element. The list is displayed, and the value selected, in the Tagged Values window.
In this example, the enumeration 'Color' provides the drop-down list of values ('Yellow', 'Red', 'Green') for the 'myTag' Tagged Value on the 'myStereotype' element.
Add an Enumeration to the Stereotype
Step |
Description |
See also |
---|---|---|
1 |
Open the Profile Package child diagram. |
|
2 |
In the Toolbox, locate and select the 'Profile' pages. |
|
3 |
Drag the 'Enumeration' icon from the Toolbox onto the diagram. If the 'Properties' dialog does not display, double-click on the element on the diagram. |
|
4 |
In the 'Name' field, type the name of the new Enumeration element. |
|
5 |
Click on the 'Details' tab and on the . The Features window displays, showing the 'Attributes' page. |
|
6 |
In the 'Name' field, type the name of the Enumeration attribute (for example, 'Yellow'). |
|
7 |
Click on the New Attribute text and type the name of the next Enumeration attribute. Repeat this step for additional attributes, to define the other values for the drop-down list. |
|
8 |
When you have defined all the values, click on the and, on the 'Properties' dialog, on the . |
|
9 |
Right-click on the Stereotype element and select the 'Attributes' option. The Features window displays for the stereotype, at the 'Attributes' page. |
|
10 |
In the 'Name' field type a name for the attribute. |
|
11 |
In the 'Type' field click on the drop-down arrow and on the 'Select Type' option, and browse for and select the name of the Enumeration element from the 'Select <Item>' dialog. |
|
12 |
In the 'Initial' field type the name of the required Enumeration attribute that defines the default value. |
|
13 |
Click on the . You have now generated a drop-down list for setting the value of the tag in the Tagged Values window. When the Profile is in use, the Tagged Value for an element created with the stereotype might appear as shown:
|
Learn more