MagicDraw 18.4 Documentation

Skip to end of metadata
Go to start of metadata

While working with generic tables, it is useful to know the following actions:

Setting detailed column names

Column names in the generic table header are set automatically, and they are element property names. You cannot change column names.

If an element has some properties with the same name (for example, in associations or if a tag of stereotypes is selected as a column), the detailed column names could provide more precise information.


To see detailed column names


  • On the Options toolbar, click  and then select Show Detailed Column Name.
    The group name (between brackets), to which the selected property belongs, and/or the stereotype name (just before the property name) will be displayed in the column heading.

The following picture gives the example of three different columns with the same name for the association element: NameName (Role of A), and Name (Role of B) and a column for the class element with the stereotype «Teacher». Name (Tags). If the command Show Detailed Column Name were not selected, there would be four columns with same headings, i.e., Name.

Example of detailed column names in generic tableExample of detailed column names in generic table

Sorting data

To sort data


  • Click the header of the column by which you want to sort table data. A small arrow appears on that column header. This arrow shows, how records are sorted: ascending or descending.

Orders for sorting data in generic table

Rows are renumbered automatically after the sorting.

Adding or removing element types

To add or remove element types


  1. In the Criteria area, click the ... button next to the Element Type box. The dialog with the element and stereotype list opens.
  2. Do one of the following:
  • To add element types select the appropriate check boxes in the list.

    Properties corresponding to the selected types will be added to the list of available columns.

  • To remove element types click to clear appropriate check boxes in the list.

    Properties corresponding to the deselected types will be removed from the list of available columns.

To add an element type, you can also drag a selected element to the Element Type box directly from the Model Browser.

  • To select adjacent elements, select a single element and then hold down the Shift key while you click other elements.
  • To select nonadjacent elements, select a single element and then hold down the Ctrl key while you click other elements.

The new value of the Element Type box replaces the old value.

Specifying the scope for the generic table

To specify the scope


  1. In the Criteria area of the generic table, click the ... button next to the Scope (optional) box.


  2. In the tree or list on the left side of the Select Scope dialog, select one or more containers, for example, packages or smart packages, and add them to the Selected Elements list.

    The Select Scope dialog is a modification of the element Selection dialog.

  3. Click OK to both confirm the addition and close the dialog. The scope is defined, and the contents of the generic table becomes updated with the elements from the selected scope. In future, all the elements created in that scope will be automatically added to the table.

If the contents of the table has not been updated, try the following:

  • Click on the View toolbar. This helps in case a smart package is specified as the scope criteria.
  • Make sure the specified scope contains elements, which types are specified in the Element Type box. Element types must correspond to the selected element types!
  • Make sure at least one element type is specified for the table.

To add an element type, you can also drag a selected element to the Element Type box directly from the Model Browser.

  • To select adjacent elements, select a single element and then hold down the Shift key while you click other elements.
  • To select nonadjacent elements, select a single element and then hold down the Ctrl key while you click other elements.

The new value of the Element Type box replaces the old value.

Using drag-and-drop operation to specify scope for generic table

 

In case you need to collect elements that are not necessarily owned by the same package, you can specify the query in the Specification window of the table or from the Criteria area, and see the results added to it right away.



To specify the scope query


  1. Click the Specify Query (optional) icon in the Scope (optional) field.


  2. In the Edit Query dialog, specify the criteria that defines your scope.
  3. Click OK to close the dialog.

Adding new elements

To add a new element


At least one element type must be selected in the Element Type box before adding a new element.

  1. Click the Add New button on the Edit toolbar. If there is more than the one element type selected, a submenu with the list of available element types opens.

    Only element types available to create in a possible diagram owner which contains the generic table will be displayed on the submenu.

  2. Select an element type. The element of the selected type will be added to the last row of the table and to the model.

  3. Name the new element in the table.

 

Adding existing elements from the model

To add an existing element from the model


Elements you want to add should correspond to selected element types.

  1. Click the Add Existing button on the Edit toolbar. The  Select Element dialog opens.

  2. Select the element you want to add to the generic table. This element and its name will be added to the table as the last row.

    Use the Multiple Selection mode to add more than one element at a time.

If you have not defined the element type before starting to add elements to the table, it is automatically set after the first element is added to the table. The type of this element becomes the value of the Element Type box.

To add an existing element, you can also drag a selected element to the contents of the generic table directly from the Model Browser.
If you drag a container, for example, a package or a smart package, the generic table will display its contents, but not the container itself.

 

Adding or removing columns

To add or remove columns


  1. To open the available columns list:
    • On the toolbar, click Show Columns to open the menu with common properties corresponding to element types that have been selected for the generic table.
    • On the toolbar, click Show Columns > Select Columns to open the dialog with all properties, including tags of stereotypes corresponding to selected element types.

    Using the Select Columns dialog, you can choose to display not only the properties of the specified element type, but also the properties that are subtypes of the specified element type.

  2. Do either:
    • Select the properties you want to see as columns in the table.
    • Unselect the properties you do not want to see as columns is the table.

 

To add custom columns


  1. In the toolbar, click Show Columns > New Custom Column.


  2. In the Expression dialog, specify criteria for the custom column, and click OK.

    You can read more about that in Defining expressions, as the procedure for custom columns and for derived properties is the same.

    You can also select to show implied relationships in the table. The procedure for specifying which relationships to display in the table is the same as described in Specifying dependency criterion.

To remove custom columns


  • Right-click the custom column you want to remove, and select Remove Custom Column.

 

Editing element's properties in a cell

To edit element’s property in a cell


The property can be edited in the element’s Specification window if it is not locked.

  1. Click a cell you want to edit.
  2. Do one of the following:

All changes made in the generic table are saved in the model.

Using Quick Filter

Using the Quick filter box you can quickly find the required rows in the table. This is especially handy when you are working with a large table containing many rows and columns. Rows can be filtered by the text in the Filter box.

When using a Quick Filter, you can specify several criteria:

  • Specify columns wherein you want to search (1).

    You can search in the entire table or select one or several columns.

  • Specify case sensitivity (2)

  • Specify if you want to use a wild card or regular expression (3)

  • Specify how the results should match your key words (4)


You can save the filter criteria for a particular table. Even after reloading the project or restarting MagicDraw, the filter criteria will remain saved.

 

To save the filter criteria


  • On the Options toolbar, click  and then select Save Filter Criteria.

When exporting the table, only the filtered out columns and rows will be included in the result.

 

Exporting a generic table

You can export the selected generic table to an *.html, *.csv, or *.xlsx file.

 

To export a generic table


  1. On the Publish toolbar, click Export.
  2. In the opened dialog, do the following:
    1. Browse for a location to save a table.
    2. Type the exported table name.
    3. Select the exported table format.
  3. Click Save when you are done. The table is exported to the location you have specified.

The style of *.html tables is specified in template.html which can be found in <MagicDraw installation directory>\data\table. The file stores cascading style sheets (CSS) that define the appearance of an exported generic table. Before exporting a table, you can customize the template.html according to your needs.

Manipulations in a generic table

To open the element’s Specification window


Do either:

  • Double-click a non-editable cell in the element’s row, if there is such cell.
  • Right-click on a cell and from the shortcut menu select Specification. Then:

    • If the selected cell does not refer to any element, the Specification window of the element in the row will open.
    • If the selected cell refers to some elements, the submenu with the list of appropriate elements will open. Choose the element whose Specification window you want to open.
    Submenu of Open Specification command

 

To reorder the columns


  • Click the column header and drag it to a desired place. Only the first column cannot be moved.

 

 

  • No labels