Last Updated:

Structured Table Views

Andy Lapping Tip

Context Patterns in Table Layouts

As you probably already know, Table Layouts in Rhapsody may be defined using Context Patterns - an extremely powerful capability that can even include java plugins to grab model data. These can sometimes be very long and complex but a simple example might look like this:

Project*,{pkg}Package,{cls}Class,{op}Operation,{arg}Argument

A basic Table View based on such a layout might then look like this:

Basic Table View

Collapsing The First Column

While this gives the expected data it isn't particularly readable. Setting the layout to collapse the first column helps a little:

Table View With Collapsed First Column

Collapsing All Columns

But did you know there is another option ? You can turn the entire table into a structured view that makes every part collapsible, not just the first column:

Collapsing All Columns

So cool !

So what's the secret sauce for this little gem ? Simple:

  • Add another column to your table
  • Move it to the top - it MUST be the first column
  • When it is the first column, an additional option appears in the Type selector - Context Pattern Hierarchy

Thats it - no need to select anything else in any of the other fields:

Table layout

Whats the downside ? The twisties for filtering the table based on the column data vanish so those options are gone but thats a small price to pay - and in any case you can always have two layouts displaying the data in twqo different ways, one as a tree and the other as a searchable list.  

The Profile Builder

If you think the Context Pattern syntax is a bit hairy - you are not alone. Fortunately you never have to write another one by hand if you use the Profile Builder, my latest creation available now from Sodius Willert. 

This powerful little package is the profile builder's dream - it makes the creation and maintenance of profiles a pleasure rather than a chore. And if you already have a profile, no problem - the Profile Builder can reverse engineer it into a model. It provides the following capabilities: