blob: c8a3c7c11eb9b51050ed50e23d4907741eb34315 [file] [log] [blame]
--- RCPTT testcase ---
Format-Version: 1.0
Context-Type: org.eclipse.rcptt.ctx.ecl
Element-Name: ECL_EditNode
Element-Type: context
Element-Version: 2.0
Id: _addnodeondiagram
Runtime-Version: 2.0.2.201511100828
Save-Time: 6/23/16 4:07 PM
------=_.ecl.context-718f04b4-ed39-33e3-af62-0995e4561998
Content-Type: text/ecl
Entry-Name: .ecl.context
// This function add a node on the given diagram.
proc "add-node-from-palette" [val name] [val x] [val y] [val defaultName] [val diagramName] [val rootName]{
get-editor "model.di" | get-diagram | get-edit-part -name $rootName
// Get element in palette.
with [get-palette | get-palette-entry $name] {
mouse-move 35 12 button1 -height 23 -width 251
mouse-press 35 12 button1 -height 23 -width 251
mouse-release 35 12 button1 524288 -height 23 -width 251
}
// Add the node in the given diagram.
with [get-diagram $diagramName ] {
mouse-move $x $y button1
mouse-press $x $y button1
mouse-release $x $y button1
}
// Make sure the desired node has been created.
get-editor "model.di" | get-diagram $diagramName | get-edit-part -name $rootName | get-edit-part -name $defaultName
| equals true
}
// This function remove a node on the given diagram.
proc "remove-node" [val nameNode] [val diagramName] [val rootName] {
with [get-editor "model.di" | get-diagram $diagramName] {
with [get-edit-part -name $rootName | get-edit-part -name $nameNode ] {
mouse-move 46 19 button3 -height 26 -width 140
mouse-press 46 19 button3 -height 26 -width 140
mouse-release 46 19 button3 2097152 -height 26 -width 140
}
get-menu "Delete Selected Element" | click
with [get-edit-part -name $rootName] {
mouse-move 180 307 -height 527 -width 751
mouse-hover 180 307 -height 527 -width 751
mouse-move 7 295 -height 527 -width 751
}
}
// Make sure the desired node has been removed.
get-editor "model.di" | get-diagram $diagramName | get-edit-part -name $rootName
| verify-error {get-edit-part -name $nameNode}
}
------=_.ecl.context-718f04b4-ed39-33e3-af62-0995e4561998--