Difference between revisions of "OtfOtlEditor"

From emotive
Jump to navigation Jump to search
Line 46: Line 46:
  
 
Below are the context menus and their descriptions according to their positions from top to bottom.
 
Below are the context menus and their descriptions according to their positions from top to bottom.
<!--
+
 
 
{|{{TableHeader}}
 
{|{{TableHeader}}
{{TableRowContextMenuHeader}}
+
|- style="background: gray; color: white; vertical-align:top;"
 +
| '''Context&nbsp;menu&nbsp;entry'''&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; || '''Keyboard&nbsp;shortcut'''&nbsp;&nbsp;&nbsp;&nbsp; || '''Description'''
 
|-{{TableRow1}}
 
|-{{TableRow1}}
|'''Cut''' || style="width:750px;" | Cuts the activity or the selected activities.
+
|'''Rename''' || '''(CTRL + R)''' || Renames the current declaration (allows update all references) which right is at the cursor (before, after or contains the cursor).
 
|-{{TableRow2}}
 
|-{{TableRow2}}
|'''Copy''' || style="width:750px;" | Copies the activity or the selected activities.
+
|'''Reformat document''' || '''(CTRL + N)''' || Deletes all the redundant spaces in each line (not deleting the empty lines).
 
|-{{TableRow1}}
 
|-{{TableRow1}}
|'''Delete''' || style="width:750px;" | Deletes the activity or the selected activities.
+
| '''Generate document new''' || '''(CTRL + SHIFT + N)''' || Reloads the OTL at the last valid OTL code.
 
|-{{TableRow2}}
 
|-{{TableRow2}}
|'''Paste''' || style="width:750px;" | Pastes the copied or cut activity (or selected activities) below the current activity.
+
| '''New local variable''' || '''(CTRL + L)''' || Opens dialog to create new local variable and input the new variable at the cursor.
 
|-{{TableRow1}}
 
|-{{TableRow1}}
|'''Add Comment''' || style="width:750px;" | Adds a new comment and links the comment to the current activity.
+
| '''Copy''' || '''(CTRL + C)''' || Copies all the highlighted text (1) or the current line{{TooltipIcon|the line where the cursor is.}}  (if no text is highlighted) (2).
 
|-{{TableRow2}}
 
|-{{TableRow2}}
|'''Surround With >> Group''' || style="width:750px;" | Creates a new Group activity to surround the current activity or the selected activities (i.e. the activities will be moved into the new Group activity).
+
| '''Cut''' || '''(CTRL + X)''' || Cuts all the highlighted text (1) or the current line{{TooltipIcon|the line where the cursor is.}} (if no text is highlighted) (2).
 
|-{{TableRow1}}
 
|-{{TableRow1}}
|'''Surround With >> Handler''' || style="width:750px;" | Creates a new Handler activity to surround the current activity or the selected activities (i.e. the activities will be moved into the Try-branch of new Handler activity).
+
|'''Paste''' || '''(CTRL + V)''' || Pastes the copied/cut highlighted text (1) at the cursor or the copied/cut line (2) in a new line above the current line{{TooltipIcon|the line where the cursor is.}}.
 
|-{{TableRow2}}
 
|-{{TableRow2}}
|'''Surround With >> MutexGroup''' || style="width:750px;" | Creates a new MutexGroup activity to surround the current activity or the selected activities (i.e. the activities will be moved into the new MutexGroup activity).
+
|'''Comment''' || '''(CTRL + K)''' || Comments all the lines with highlighted text or the current line{{TooltipIcon|the line where the cursor is.}} (if no text is highlighted).
 
|-{{TableRow1}}
 
|-{{TableRow1}}
|'''Extract Procedure''' || style="width:750px;" | Extracts the activity or the selected activities into a new procedure and creates a new ProcedureCall to call the new procedure.
+
| '''Collapse all outlines''' || '''(CTRL + SHIFT + E)''' || Collapses all the collapsable blocks.
 
|-{{TableRow2}}
 
|-{{TableRow2}}
|'''Disable/Enable''' || style="width:750px;" | Disables/Enables the activity or the selected activities. Note that the disabled activities will not be executed and all the errors and warning related to these activities will not be displayed except the check rule [[Core.Validation.CoreChk011|Core-Chk011]].  
+
| '''Expanse all outlines''' || '''(CTRL + E)''' || Expanses all the collapsable blocks.
 
|-{{TableRow1}}
 
|-{{TableRow1}}
|'''New Local Variable ...''' || style="width:750px;" | Adds a new local variable to the current procedure.
+
| '''Go to line''' || '''(CTRL + G)''' || Shows a dialog to input a particular number line to move view to.
 
|-{{TableRow2}}
 
|-{{TableRow2}}
|'''Remove/Add Realisation''' || style="width:750px;" | Removes/Adds realisation in the current activity. Note that you can only add realisation to some certain activities (EmptyBranch, EmptyParallel, EmptyHandler, Group, EmptyGroup, EmptyMutexGroup).
+
| '''Show line numbers''' || || Displays the line numbers (checked) or not (unchecked).
 
|-{{TableRow1}}
 
|-{{TableRow1}}
|'''Toogle Breakpoint''' || style="width:750px;" | Adds/Removes break point to/from the current activity.
+
| '''Display Procedure in designer'''{{TooltipIcon2|Only visible if the cursor is in the procedure area from procedure header to the procedure end bracket}} || '''(F7)''' || Deletes the current row/column.
 
|}
 
|}
-->
+
 
 
|}
 
|}

Revision as of 08:39, 27 December 2018

UNDER DEVELOPMENT...

Overview

For professional users it is much more efficient to create and edit OTX in a code editor, especially for big OTX projects. EMOTIVE has developed OTL - Open Test Language. OTL is a Java-like scripting language for the OTX. Designer and code editor synchronize continuously. This allows to seamlessly switch between the two ways of working. The code editor has powerful syntax highlighting and auto complete features.

To open an OTX document in the OTL editor, you can right click on the document node (or a procedure node in that document) and select the 'View code (OTL)' menu, or you can select the document node (or a procedure node in that document) and press 'F7' key.

...

The structure and features of the OTL code editor are described in the following sections.

OTL Editor Features

OtfOtlCodeEditor.png
OTL code editor

OTX VS OTL

The OTL has the similar structure of an OTX document. It has 3 main sections as follows: a document info section, a global element section and some procedure (local) sections.

Document information section

This section lies at the header of the OTL code above the namespace code block. It displays almost information of the document tag in the OTX code.

Global element section

This section lies within the namespace code block and above the procedure code blocks. It contains the Imports, Validities, Signatures and GlobalDeclarations sub-sections.

Procedure (local) section

This section lies within the namespace code block and under the global elements section. It contains the LocalDeclarations and the Flow sub-sections.

Line Numbers

With line numbers, you can trace your OTL code easily. Line numbers aren't added to your code; they're just for reference. To show or hide the line numbers, you can use the right click menu of the OTL editor and select the 'Show line numbers' menu. You can also switch the current view of the editor to a particular line number with the right click menu 'Go to line' or with the key shortcut 'CTRL + G'.

Collapsable Code Block

The OTL support users folding the code block to manage large amounts of code while viewing only those subsections in needed time. If a block is unfolded, the folding toggle box [-] indicates the beginning of the region while the line extending below the square box indicates the extent of the code region, the line ends with an edge '∟' which marks the end of the block. For folded blocks, the toggle box is shown as [+] with the [...].

To collapse (hide) a code block, you can click on the box [-] at the beginning of that block. To expand (show) a collapse block, you can click on the box [+] or double clicking on the [...] of that block. You can also collapse or expand all the code blocks by using the right click menu of the OTL editor or using the key shortcuts (Collapse All: 'CTRL + SHIFT + E' and Expand All: 'CTRL + E').

Context menus

Below are the context menus and their descriptions according to their positions from top to bottom.

Context menu entry                       Keyboard shortcut     Description
Rename (CTRL + R) Renames the current declaration (allows update all references) which right is at the cursor (before, after or contains the cursor).
Reformat document (CTRL + N) Deletes all the redundant spaces in each line (not deleting the empty lines).
Generate document new (CTRL + SHIFT + N) Reloads the OTL at the last valid OTL code.
New local variable (CTRL + L) Opens dialog to create new local variable and input the new variable at the cursor.
Copy (CTRL + C) Copies all the highlighted text (1) or the current lineTooltip.png (if no text is highlighted) (2).
Cut (CTRL + X) Cuts all the highlighted text (1) or the current lineTooltip.png (if no text is highlighted) (2).
Paste (CTRL + V) Pastes the copied/cut highlighted text (1) at the cursor or the copied/cut line (2) in a new line above the current lineTooltip.png.
Comment (CTRL + K) Comments all the lines with highlighted text or the current lineTooltip.png (if no text is highlighted).
Collapse all outlines (CTRL + SHIFT + E) Collapses all the collapsable blocks.
Expanse all outlines (CTRL + E) Expanses all the collapsable blocks.
Go to line (CTRL + G) Shows a dialog to input a particular number line to move view to.
Show line numbers Displays the line numbers (checked) or not (unchecked).
Display Procedure in designerExclamation.png (F7) Deletes the current row/column.