| --- RCPTT testcase --- |
| Format-Version: 1.0 |
| Context-Type: org.eclipse.rcptt.ctx.ecl |
| Element-Name: ECL_AddRelation |
| Element-Type: context |
| Element-Version: 2.0 |
| Id: _addrelationbetweentwonodes |
| Runtime-Version: 2.0.2.201511100828 |
| Save-Time: 6/23/16 4:06 PM |
| |
| ------=_.ecl.context-718f04b4-ed39-33e3-af62-0995e4561998 |
| Content-Type: text/ecl |
| Entry-Name: .ecl.context |
| |
| // This function add a relation between two given nodes. |
| proc "add-relation" [val relation] [val element1] [val element2] [val diagramName] [val pathRelationDefaultName] [val rootName] { |
| |
| // Get the relation in the palette with relation's label. |
| with [get-palette | get-palette-entry $relation] { |
| mouse-move 76 6 button1 -height 23 -width 223 |
| mouse-press 76 6 button1 -height 23 -width 223 |
| mouse-release 76 6 button1 524288 -height 23 -width 223 |
| } |
| |
| // Get two elements to create the relation. |
| with [get-diagram $diagramName | get-edit-part -name $rootName] { |
| with [get-edit-part -name $element1 ] { |
| mouse-move 12 27 button1 -height 50 -width 30 |
| mouse-press 12 27 button1 -height 50 -width 30 |
| mouse-release 12 27 button1 524288 -height 50 -width 30 |
| } |
| with [get-edit-part -name $element2] { |
| mouse-move 50 13 button1 -height 26 -width 140 |
| mouse-press 50 13 button1 -height 26 -width 140 |
| } |
| } |
| |
| with [get-diagram $diagramName ] { |
| with [get-edit-part -name $rootName | get-edit-part -name $element2] { |
| get-edit-part -text $element2 | mouse-release 50 13 button1 524288 -height 26 -width 140 |
| } |
| } |
| |
| // Make sure the desired relation has been created. |
| get-view $modelExplorer | get-tree | get-item $rootName | get-item $pathRelationDefaultName |
| | equals true |
| } |
| ------=_.ecl.context-718f04b4-ed39-33e3-af62-0995e4561998-- |