Une image contenant texte, signe

Description générée automatiquement

Create Table Layout from Stereotype

 

Overview

This helper automates the process of creating a new table layout based on a stereotype with tags.

 

Applicable To

Table Layout, Table View

Menu Entry

Power Pack Create Table Layout

Demonstration

Watch the Video

 

Creating a table layout that reports the name of model elements is relatively quick and easy. Creating a table layout that reports the tag values for model elements can be laborious. This helper creates a table layout for a stereotype that has tags.

Table Layout Name

The new layout is named [Stereotype Name] Table Layout

If a layout exists (anywhere in the model) with that name, then the helper offers to replace it.

Table Layout Location

If the stereotype is in a read-write package, then the new layout is created there. If the stereotype is instead in a read only package (such as a profile imported by reference) then a new package is created at project level to hold the new stereotype (since layouts cannot be created at project level directly). That package is named StereotypeTableLayouts

Table Layout Columns

Generated table layouts contain a column for the name, description and then a column for each tag on the stereotype.

 

Table Layout Criteria

The layout criteria for the table layout depends on whether or not the stereotype is a new term:

 

New Terms

Table layouts generated for new term stereotypes simply have their criteria set to that new term (either the name of the stereotype or it’s Name property if that has been used).

 

Non-New Terms

Since non-new terms could potentially be applied to any element (for example a stereotype applicable to Class could be applied to Block) we cannot simply set the criteria to that type. A table layout with a criteria of Class would not show any Blocks (that’s not how Rhapsody tables work). For that reason, these generated layouts have their criteria set to the following context pattern:

ModelElement+,ModelElement.stereotype(stereotypeName)

 

This basically means ‘get all model elements that have this stereotype applied’.