-
Notifications
You must be signed in to change notification settings - Fork 1
Config File 2 Forms
Configuration files contain JSON objects (which begin and end with curly braces) that contain customizable properties for the forms (case insensitive). There are two parameters that must be entered for each form:
- version [integer]: must be 2
- org.archicontribs.form [object]: contains the form to create
Each form can be further customized using the following properties (case insensitive):
- Name [string]: name of the form. This property is mandatory and can include variables.
- width [integer]: width (in pixels) of the form window (default: 850px)
- height [integer]: height (in pixels) of the form window (default: 600px)
- background [string]: color of the form's display window background in RGB comma separated format (default: "240, 240, 240")
- spacing [integer]: space (in pixels) between the form's display window border and the graphical objects in the form window (default: 4px)
- buttonWidth [integer]: width of the "Ok", "Cancel", and "Export" buttons (default: 90px) in the form display window
- buttonHeight [integer]: height of the "Ok", "Cancel", and "Export" buttons (default: 25px) in the form display window
- buttonOk [string]: text of the "Ok" button (default: "Ok")
- buttonCancel [string]: text of the "Cancel" button (default: "Cancel")
- buttonExport [string]: text of the "Export" button (default: "Export to Excel")
-
refers [string]: indicates which component the form refers to (default: "selected"):
- selected : the form refers to any selected object in the view. In this case, the number of menu entries is limited to 5 per form.
- view: the form refers to the view itself. In this case, only one menu entry is shown per form even if several objects are selected in the view.
- model: the form refers to the model. In this case, only one menu entry is shown per form even if several objects are selected in the view.
- filter [array]: allows you to filter the objects a form is applied to (please refer to Filters for more details)
- whenEmpty [string]: the default behaviour when the plugin sets a variable to an empty value (please refer to Variables for more details)
- tabs [array]: the list of the tabs to create in the form display window. At least one tab must be created (please refer to Tabs for more details)
Please note that forms are always applied to an Archi component (the whole model, a view, an element, or a relationship). By default, all variables used in a form will refer to the component you choose to run the form on (please refer to Variables for more details)
The following file creates two empty forms with the same name. The first one will apply to the view where the right-click took place, and the second one will apply to the selected objects in the view (if there are any):
{
"version": 2,
"org.archicontribs.form": {
"name": "Form test for ${class) \"${name}\"",
"width": 900,
"height": 400,
"spacing": 4,
"background": "250, 250, 250",
"refers": "view",
"whenEmpty": "ignore",
"tabs": []
}
}