| --- RCPTT testcase --- |
| Format-Version: 1.0 |
| Context-Type: org.eclipse.rcptt.ctx.ecl |
| Element-Name: ECL_Open |
| Element-Type: context |
| Element-Version: 2.0 |
| Id: _open |
| Runtime-Version: 2.2.0.201611022324 |
| Save-Time: 11/17/16 5:12 PM |
| |
| ------=_.ecl.context-718f04b4-ed39-33e3-af62-0995e4561998 |
| Content-Type: text/ecl |
| Entry-Name: .ecl.context |
| |
| /** This function open the given model and the given diagram<br><br> |
| <b>@param project</b> Regular expression for matching the project (may use exact name)<br> |
| <b>@param model</b> Path to the model relative to the project root. Regular expression can be used only on single item names.<br> |
| <b>@param rootName</b> Path relative to the model root. Must include root element name, regular expression can be used only on single element names.<br> |
| <b>@param diagramName</b> Regular expression for matching the diagram name in the given path |
| */ |
| proc "open" [val project] [val model] [val rootName] [val diagramName] { |
| open-file -project $project -file $model |
| try -command { |
| open-diagram -rootName $rootName -diagramName $diagramName |
| } -catch { |
| log [concat "Could not open diagram: " $diagramName] |
| } |
| } |
| |
| /** This function open the given file using the path relative to this project. <br><br> |
| <b>@param project</b> Regular expression for matching the project (may use exact name)<br> |
| <b>@param path</b> Path relative to the project root. Must end in '/' if not in root, regular expression can be used only on single item names.<br> |
| <b>@param file</b> Regular expression for matching the file name in the given path |
| */ |
| proc "open-file" [val project] [val path ""] [val file] |
| { |
| try -command { |
| get-view $projectExplorer | get-tree | select [concat $project "/" $path $file] | double-click |
| } -catch { |
| // Add regular expression (problem with EGit). |
| try { |
| get-view $projectExplorer | get-tree | select [concat ".*" $project ".*" "/" $path $file] | double-click |
| } -catch { |
| log [concat "Could not open file: " $project $path $file ", no such file!"] |
| emit "false" |
| } |
| } |
| emit "true" |
| } |
| |
| |
| /** This function open the given diagram from the model explorer view. <br><br> |
| <b>@param rootName</b> Path relative to the model root. Must include root element name, regular expression can be used only on single element names.<br> |
| <b>@param diagramName</b> Regular expression for matching the diagram name in the given path |
| */ |
| proc "open-diagram" [val rootName] [val diagramName] |
| { |
| try { |
| get-view $modelExplorer | get-tree | select [concat $rootName "/" ".*" $diagramName] | double-click |
| } -catch { |
| log [concat "Could not open diagram: " $diagramName] |
| emit "false" |
| } |
| emit "true" |
| } |
| ------=_.ecl.context-718f04b4-ed39-33e3-af62-0995e4561998-- |