-
Notifications
You must be signed in to change notification settings - Fork 1
Config File 5 Tables
herve edited this page Jan 30, 2019
·
1 revision
In addition to simple controls, tabs can also contain tables which can organize controls into rows and columns. The standard properties must be defined:
- x [integer]: horizontal position (in pixels) of the table (0px is left)
- y [integer]: vertical position (in pixels) of the table (0px is top)
- width [integer]: width (in pixels) of the table (default: calculated from the content)
- height [integer]: height (in pixels) of the table (default: calculated from the content)
- background [string]: color of an object's background in RGB comma separated format (default: "240, 240, 240")
- foreground [string]: text color of an object in RGB comma separated format (default: "0, 0, 0")
- tooltip [string]: the text that appears when you hover over an object with your cursor
In addition to the standard properties, one must define the table columns:
-
columns [array]: describe the table columns
- name [string]: column name used for the column header
- class [string]: class of the cells in the column. Must be label, text, combo, or check.
- tooltip [string]: the text that appears when you hover over an object with your cursor (default is no tooltip)
- regexp [string]: allow one to specify a regexp that will change the foreground color of the text. For example, red if regexp is not matched, green if regexp is matched. (For text columns only. Default to regexp if not specified)
- text [string]: literal string to print in the control (for label controls only)
- values [array]: list of valid values for combo and check controls.
- variable [string]: variable to link to the object (for text, combo and check controls) (please refer to Variables)
- default [string]: defines the default value of the variable (in conjunction with only the "variable" property)
- whenEmpty [string]: defines what to do during the "save" operation when the value is empty (in conjunction with only the "variable" property)
After defining columns, you must define your lines (rows):
-
lines [array]: describe the table lines
- cells [array]: this property must contain one variable or literal per column (please refer to Variables). If the corresponding column contains a label, then the literal or variable content is set as the label's "text" property. In case of a text, combo, or check control, the variable is set to the control's variable property.
-
generate [boolean]: must be yes or no
- When the generate property is set to no, a single line is created and the variables refer to the form's selected object.
- when the generate property is set to yes, one line is generated per child of the form's selected object.
- filter {JSON object}: allow one to restrict the list of children added in the table (used with generated lines only) (please refer to Filters)
In the following two exampes we create tables for a form that refers to a view. This table will contain one line per element in the view:
{
"class": "table",
"x": 10,
"y": 10,
"width": 870,
"height": 300,
"background": "200, 200, 200",
"foreground": "0, 0, 0",
"tooltip": "This table contains all the elements present in the view",
"excelSheet": "elements",
"excelFirstLine": 1,
"columns": [
{"name": "Class", "ExcelColumn": "A", "excelCellType": "String", "excelDefault": "zero", "width": 200, "class": "label", "fontItalic": true },
{"name": "Name", "ExcelColumn": "B", "excelCellType": "String", "excelDefault": "zero", "width": 200, "class": "text", "fontBold": true },
{"name": "Describes", "ExcelColumn": "C", "excelCellType": "String", "excelDefault": "zero", "width": 400, "class": "combo", "values": ["the past", "the present", "the future"], "fontSize": 11 }
],
"lines": [
{
"generate": true,
"cells": ["${class}", "${name}", "${property:describes}"],
"filter": {
"genre": "OR",
"tests": [
{ "attribute": "${class}", "operation": "iequals", "value": "Capability" },
{ "attribute": "${class}", "operation": "iequals", "value": "CourseOfAction" },
{ "attribute": "${class}", "operation": "iequals", "value": "Resource" },
{ "attribute": "${class}", "operation": "iequals", "value": "Product" },
{ "attribute": "${class}", "operation": "matches", "value": "Business.*" },
{ "attribute": "${class}", "operation": "iequals", "value": "Contract" },
{ "attribute": "${class}", "operation": "iequals", "value": "Representation" },
{ "attribute": "${class}", "operation": "iequals", "value": "DataObject" },
{ "attribute": "${class}", "operation": "matches", "value": "Application.*" },
{ "attribute": "${class}", "operation": "iequals", "value": "Artifact" },
{ "attribute": "${class}", "operation": "matches", "value": "Technology.*" },
{ "attribute": "${class}", "operation": "iequals", "value": "Node" },
{ "attribute": "${class}", "operation": "iequals", "value": "Device" },
{ "attribute": "${class}", "operation": "iequals", "value": "SystemSoftware" },
{ "attribute": "${class}", "operation": "iequals", "value": "Path" },
{ "attribute": "${class}", "operation": "iequals", "value": "CommunicationNetwork" },
{ "attribute": "${class}", "operation": "iequals", "value": "Material" },
{ "attribute": "${class}", "operation": "iequals", "value": "Equipment" },
{ "attribute": "${class}", "operation": "iequals", "value": "Facility" },
{ "attribute": "${class}", "operation": "iequals", "value": "DistributionNetwork" },
{ "attribute": "${class}", "operation": "iequals", "value": "Workpackage" },
{ "attribute": "${class}", "operation": "iequals", "value": "Deliverable" },
{ "attribute": "${class}", "operation": "iequals", "value": "ImplementationEvent" },
{ "attribute": "${class}", "operation": "iequals", "value": "Plateau" },
{ "attribute": "${class}", "operation": "iequals", "value": "Gap" },
{ "attribute": "${class}", "operation": "iequals", "value": "Stakeholder" },
{ "attribute": "${class}", "operation": "iequals", "value": "Driver" },
{ "attribute": "${class}", "operation": "iequals", "value": "Assessment" },
{ "attribute": "${class}", "operation": "iequals", "value": "Goal" },
{ "attribute": "${class}", "operation": "iequals", "value": "Outcome" },
{ "attribute": "${class}", "operation": "iequals", "value": "Principle" },
{ "attribute": "${class}", "operation": "iequals", "value": "Requirement" },
{ "attribute": "${class}", "operation": "iequals", "value": "Constraint" },
{ "attribute": "${class}", "operation": "iequals", "value": "Meaning" },
{ "attribute": "${class}", "operation": "iequals", "value": "Value" },
{ "attribute": "${class}", "operation": "iequals", "value": "Location" }
]
}
}
]
}
This table will contain one line per relationship in a view:
{
"class": "table",
"x": 10,
"y": 10,
"width": 870,
"height": 300,
"background": "200, 200, 200",
"foreground": "0, 0, 0",
"tooltip": "This table contains all the relationships present in the view",
"excelSheet": "relationships",
"excelFirstLine": 1,
"columns": [
{"name": "Class", "ExcelColumn": "A", "excelCellType": "String", "excelDefault": "zero", "width": 200, "class": "label" },
{"name": "Name", "ExcelColumn": "B", "excelCellType": "String", "excelDefault": "zero", "width": 200, "class": "text" },
{"name": "Describes", "ExcelColumn": "C", "excelCellType": "String", "excelDefault": "zero", "width": 400, "class": "combo", "values": ["the past", "the present", "the future"] }
],
"lines": [
{
"generate": true,
"cells": ["${class}", "${name}", "${property:describes}"],
"filter": {
"tests": [
{ "attribute": "${class}", "operation": "matches", "value": ".*Relationship" }
]
}
}
]
}