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 |
|---|---|
|
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. |
|
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 |
|
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 |
|
Shows reference usages, such as ports, attributes and usages declared in a
package. See Include flags in grid views. |
|
Shows abstract elements. See Include flags in grid views. |
|
Walks a recursive |
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 |
|---|---|
|
Which element each cell is about: a navigation chain applied to every row. A chain starts from
|
|
What aspect of the chain’s target to render, a value of the
|
|
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 |
|
Shown when the chain never resolved to an element, for example a |
|
Initial column width in pixels. Resizing in the UI updates this attribute when
view changes are saved. |
|
Persisted filter text for this column. Like |
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 |
|---|---|
|
|
|
The members of |
|
|
|
One tree per member of |
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 |
|---|---|
|
Whether rows start collapsed when the view opens. Set to |
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.