Product Documentation
Abstract
The user interface can be used to swap the order of the table columns, but it is possible to use the API to swap the order of columns in Tables in IBM Rhapsody.
Content
The Model
- The example model has a number of packages, each with many classes:

- A table layout/view is used to list the contents in tabular form

- Context patterns are used to determine what types of information should be displayed in the table.See "Using context patterns in tables" in the Rhapsody docs.

The Code
- In this case we use a custom class, TempColumn, to store the name and context values

- We can use the following API methods: IRPTableLayout.getColumnName and IRPTableLayout.getColumnContext to retrieve data from a table layout.

- If all the columns of the table layout are placed in a list, this order can be swapped with a call to Collections.swap()

- The list can then be iteratively copied back into the table layout using IRPTableLayout.setColumnName and IRPTableLayout.setColumnContext

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Component":"","Platform":[{"code":"PF033","label":"Windows"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]
Product Synonym
Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
ibm10730739