| --- RCPTT testcase --- |
| Format-Version: 1.0 |
| Context-Type: org.eclipse.rcptt.ctx.ecl |
| Element-Name: ECL_EditChild |
| Element-Type: context |
| Element-Version: 2.0 |
| Id: _addchildonparentnaode |
| 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 child to the parent node. |
| proc "add-child" [val parentName] [val childName] [val pathChildDefaultName] [val rootName] { |
| |
| // Get node's child in palette. |
| with [get-palette | get-palette-entry $childName] { |
| mouse-move 79 8 button1 -height 23 -width 223 |
| mouse-press 79 8 button1 -height 23 -width 223 |
| mouse-release 79 8 button1 524288 -height 23 -width 223 |
| } |
| |
| // Add the child to the parent node. |
| with [get-diagram -index 1 | get-edit-part -name $rootName | get-edit-part -name $parentName] { |
| mouse-move 51 13 button1 -height 30 -width 140 |
| mouse-press 51 13 button1 -height 30 -width 140 |
| mouse-release 51 13 button1 524288 -height 30 -width 140 |
| } |
| |
| // Make sure the desired child has been created. |
| get-view $modelExplorer | get-tree | get-item $rootName | get-item $pathChildDefaultName |
| | equals true |
| } |
| |
| |
| |
| // This function remove a child of the given parent node. |
| proc "remove-child" [val parentName] [val childName] [val diagramName] [val rootName] { |
| |
| //Get and delete the child to remove. |
| with [get-editor "model.di" | get-diagram $diagramName] { |
| with [get-edit-part -name $rootName] { |
| mouse-move 472 148 -height 320 -width 490 |
| with [get-edit-part -name $parentName | get-edit-part -text $childName | get-edit-part -text $childName] { |
| mouse-move 69 6 button3 -height 15 -width 130 |
| mouse-press 69 6 button3 -height 15 -width 130 |
| mouse-release 69 6 button3 2097152 -height 15 -width 130 |
| } |
| } |
| get-menu "Delete Selected Element" | click |
| } |
| |
| |
| |
| // Make sure the desired child has been removed. |
| get-editor "model.di" | get-diagram $diagramName | get-edit-part -name $rootName | get-edit-part -name $parentName |
| | verify-error {get-edit-part -text $childName} |
| } |
| ------=_.ecl.context-718f04b4-ed39-33e3-af62-0995e4561998-- |