Table view structure

A table view in the Syside VS Code Extension is built from a selection of rows, a set of columns, and attributes that tune how both behave. A hierarchical table view arranges the same parts as a collapsible tree.

A TableView is a SysML view definition, so expose and filter select which elements appear as rows, and the include flags refine which elements are included.

Table attributes

These attributes are inherited from TableView and affect the entire table:

Attribute

Description

maxRowHeight

Maximum height of each row in pixels. Content exceeding this height is clipped, and the cell becomes scrollable and shows the full content in a tooltip on hover.
Default: 125.

globalFilter

Persisted global search-bar filter, applied across all columns. It matches the text shown in the cells, not SysML semantics, so it is not a filter expression. Typically not authored by hand: typing in the search bar and saving view changes writes it here. Per-column filter text is persisted separately, in each column’s columnFilter attribute (see Column views).
Default: unset.

columnOrder

Reference list that overrides the visual column order without reordering the SysML source. Drag-and-drop reordering and the Shown columns dropdown in the UI update this attribute when view changes are saved. Columns omitted from columnOrder are hidden.
Default: unset.

includeReferenceElements

Shows reference usages, such as ports, attributes and usages declared in a package. See Include flags in grid views.
Default: false.

includeAbstractElements

Shows abstract elements. See Include flags in grid views.
Default: false.

recursiveFeatureExpose

Walks a recursive expose X::** through every feature, owned and inherited. false follows SysML’s recursive import exactly, which stops one level into inherited features. It exists for conformance with the specification. Fixed to true in a hierarchical table.
Default: true.

columnOrder is a reference list, so it is redefined without the attribute keyword:

view Requirements : TVD::TableView {
    expose ExampleModel::**;
    // Reference list: no attribute keyword
    :>> columnOrder = (Description, ID);

    view ID :> columnViews {
        attribute :>> featureRepresentation :> ColRep::declaredShortName;
    }
    view Description :> columnViews {
        attribute :>> featureRepresentation :> ColRep::documentation;
    }
}

Column views

columnViews is a child view of TableView. Each view usage that subsets it becomes one column in the rendered table. The name of the column is the name of the child view: view ID and view Description produce headers ID and Description. By default, columns appear in the order their child views are declared in the SysML source, though this order can be overridden through columnOrder or by drag-and-drop in the UI.

A column pairs a navigation chain, written in columnFeature, which selects the element each cell is about, with a representation, written in featureRepresentation, which selects what to show about it. Rows, columns and cells explains how the two combine.

Column attributes

Each column contains the following attributes:

Attribute

Description

columnFeature

Which element each cell is about: a navigation chain applied to every row. A chain starts from baseViewElement, a reference usage standing for the row’s element.
Default: baseViewElement.

featureRepresentation

What aspect of the chain’s target to render, a value of the SysideViews::Representation enumeration. The full catalog of values is in Cell representations.
Default: ColRep::qualifiedName.

defaultValue

Shown grayed out when the chain reached its target but the representation holds no value there (for example, an attribute that is declared but not set). Such a cell stays editable when the representation is writable. In a featureValue column whose last step is NamedUsage(…, UsageKind::attributeUsage), an attribute the element does not have also shows it, and saving creates the attribute (see Missing attributes). See Cell outcomes.
Default: "".

notApplicableValue

Shown when the chain never resolved to an element, for example a Subject step applied to a part, or a fan-out that found nothing. Such a cell is always read-only. See Cell outcomes.
Default: "N/A".

columnWidth

Initial column width in pixels. Resizing in the UI updates this attribute when view changes are saved.
Default: 150.

columnFilter

Persisted filter text for this column. Like globalFilter, it matches the text shown in the cells, not SysML semantics. Typically not authored by hand: filtering the column and saving view changes writes it here.
Default: unset.

columnFeature is a plain feature, so it is redefined without the attribute keyword. A column binds its chain to columnFeature but subsets a representation value:

view OwnerName :> columnViews {
    // Binding (=): the chain is the value of columnFeature
    :>> columnFeature = Owner(baseViewElement);
    // Subsetting (:>): the representation is one of the enumeration's values
    attribute :>> featureRepresentation :> ColRep::declaredName;
}

Warning

Writing attribute :>> columnFeature = … changes the feature’s type and breaks the column.

Hierarchical table view specifics

A hierarchical table view renders its rows as a collapsible tree. It is typed by TVD::HierarchicalTableView instead of TVD::TableView, and takes the same columns, navigation chains and representations as a flat table. Each row below the top is a feature, shown under the feature or definition it was reached from (see Hierarchical tables).

Expose

A hierarchical table takes one expose. A view with two or more reports an error instead of rendering. The form of the expose decides the rows:

Expose

Rows

expose X;

X alone

expose X::*;

The members of X, one level, no tree

expose X::**;

X as the top row, with its feature tree beneath

expose X::*::**;

One tree per member of X, without an X row

Only a definition or usage has features to show beneath it, so expose Pkg::** on a package renders empty with a banner, and expose Pkg::*::** shows one tree per definition the package owns. A usage declared directly in a package is a reference usage, so it gets a tree only when the view sets includeReferenceElements.

Filter and flags

The filter and the include flags judge every row, top rows included, and a row that fails is removed with everything beneath it. A view whose top rows are all removed renders empty with a banner naming them. Under expose X::*::**, X is not a row and is not judged.

Hierarchical table attributes

Hierarchical tables add one table attribute:

Attribute

Description

defaultCollapse

Whether rows start collapsed when the view opens. Set to false to open with the whole tree expanded.
Default: true.

The tree column

The first column carries the tree: its cells are indented by depth and hold the expand/collapse control. It is the view usage hierarchicalColumn, present in every hierarchical table, and shows each row’s qualified name unless redefined. To change what it shows, redefine it (view Name :>> hierarchicalColumn) rather than subsetting columnViews. It differs from other columns in three ways:

  • It is always the first column, and columnOrder cannot move another column ahead of it.

  • It cannot be hidden through the UI.

  • Its chain may not contain a Fan step.

Build a hierarchical table view builds a hierarchical table step by step.