Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ModelpatchGenerationHandler.xtend22
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.setup/Modelpatch.setup17
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/launch/RunAllTestSuite.launch1
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/META-INF/MANIFEST.MF3
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch application test.test5
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch generation cancel test.test7
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch generation test.test8
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch reverse application test.test5
8 files changed, 39 insertions, 29 deletions
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ModelpatchGenerationHandler.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ModelpatchGenerationHandler.xtend
index 86a0b97..4afb906 100644
--- a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ModelpatchGenerationHandler.xtend
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ModelpatchGenerationHandler.xtend
@@ -40,18 +40,28 @@ class ModelpatchGenerationHandler extends AbstractHandler {
var IStructuredSelection selection = null
try {
- selection = HandlerUtil.getActiveMenuSelection(event) as IStructuredSelection
- if(selection === null) {
- selection = HandlerUtil.getCurrentSelection(event) as IStructuredSelection
- }
+ val activeMenuSelection = HandlerUtil.getActiveMenuSelection(event)
+ if (activeMenuSelection instanceof IStructuredSelection) {
+ selection = activeMenuSelection
+ }
+ if (selection === null) {
+ val currentSelection = HandlerUtil.getCurrentSelection(event)
+ if (currentSelection instanceof IStructuredSelection) {
+ selection = currentSelection
+ }
+ }
} catch (Exception ex) {
- ex.printStackTrace
+ ex.printStackTrace
}
val part = HandlerUtil.getActiveEditorInput(event)
var EMFDiffNode diffNode = null
if (part instanceof EMFDiffMergeEditorInput) {
diffNode = part.compareResult
+ val editorSelection = part.viewer.selection
+ if(editorSelection instanceof IStructuredSelection){
+ selection = editorSelection
+ }
}
if (selection instanceof ComparisonSelection) {
@@ -62,7 +72,7 @@ class ModelpatchGenerationHandler extends AbstractHandler {
if (!diffs.empty) {
diffs.generatePatch(shell, workbench, selection)
}
- } else if (diffNode !== null){
+ } else if (selection !== null && diffNode !== null){
val comparison = diffNode.actualComparison
val differences = comparison.getDifferences(Role.REFERENCE) + comparison.getDifferences(Role.TARGET)
differences.generatePatch(shell, workbench, selection)
diff --git a/releng/org.eclipse.emf.diffmerge.patch.setup/Modelpatch.setup b/releng/org.eclipse.emf.diffmerge.patch.setup/Modelpatch.setup
index 0fd3583..6c2cc23 100644
--- a/releng/org.eclipse.emf.diffmerge.patch.setup/Modelpatch.setup
+++ b/releng/org.eclipse.emf.diffmerge.patch.setup/Modelpatch.setup
@@ -27,11 +27,8 @@
<requirement
name="org.eclipse.xtend.sdk.feature.group"/>
<requirement
- name="org.eclipse.viatra.query.sdk.feature.source.feature.group"/>
- <requirement
- name="org.eclipse.viatra.query.sdk.feature.feature.group"/>
- <requirement
- name="fr.obeo.releng.targetplatform-feature.feature.group"/>
+ name="org.eclipse.viatra.query.sdk.feature.feature.group"
+ versionRange="[1.2.0,2.0.0)"/>
<repository
url="${eclipse.repository}"/>
<repository
@@ -40,8 +37,6 @@
url="${xtext.repository}"/>
<repository
url="${orbit.repository}"/>
- <repository
- url="http://mbarbero.github.io/fr.obeo.releng.targetplatform/p2/"/>
<description>Install the tools needed in the IDE to work with the source code for ${scope.project.label}</description>
</setupTask>
<setupTask
@@ -118,9 +113,11 @@
<requirement
name="org.eclipse.equinox.executable.feature.group"/>
<requirement
- name="org.eclipse.viatra.query.runtime.feature.feature.group"/>
+ name="org.eclipse.viatra.query.runtime.feature.feature.group"
+ versionRange="[1.2.0,2.0.0)"/>
<requirement
- name="org.eclipse.viatra.transformation.runtime.emf.feature.feature.group"/>
+ name="org.eclipse.viatra.transformation.runtime.emf.feature.feature.group"
+ versionRange="[1.2.0,2.0.0)"/>
<requirement
name="org.eclipse.sdk.feature.group"/>
<requirement
@@ -260,7 +257,7 @@
<setupTask
xsi:type="setup:VariableTask"
name="viatra.repository"
- value="http://download.eclipse.org/viatra/updates/integration">
+ value="http://download.eclipse.org/viatra/updates/release/1.7.2">
<description>Patterns</description>
</setupTask>
<setupTask
diff --git a/tests/org.eclipse.emf.diffmerge.patch.tests.all/launch/RunAllTestSuite.launch b/tests/org.eclipse.emf.diffmerge.patch.tests.all/launch/RunAllTestSuite.launch
index fdf89ba..62f3563 100644
--- a/tests/org.eclipse.emf.diffmerge.patch.tests.all/launch/RunAllTestSuite.launch
+++ b/tests/org.eclipse.emf.diffmerge.patch.tests.all/launch/RunAllTestSuite.launch
@@ -17,7 +17,6 @@
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
diff --git a/tests/org.eclipse.emf.diffmerge.patch.tests.performance/META-INF/MANIFEST.MF b/tests/org.eclipse.emf.diffmerge.patch.tests.performance/META-INF/MANIFEST.MF
index cf28c43..2a0987d 100644
--- a/tests/org.eclipse.emf.diffmerge.patch.tests.performance/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.emf.diffmerge.patch.tests.performance/META-INF/MANIFEST.MF
@@ -21,5 +21,6 @@ Require-Bundle: org.junit;bundle-version="4.12.0",
org.eclipse.viatra.query.runtime;bundle-version="[1.4.0,2.0.0)",
org.eclipse.viatra.transformation.runtime.emf;bundle-version="[1.4.0,2.0.0)",
org.eclipse.emf.diffmerge.patch.persistence.json;bundle-version="[0.1.0,0.2.0)",
- org.eclipse.viatra.query.runtime.base.itc;bundle-version="[1.4.0,2.0.0)"
+ org.eclipse.viatra.query.runtime.base.itc;bundle-version="[1.4.0,2.0.0)",
+ org.eclipse.emf.edit;bundle-version="2.9.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
diff --git a/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch application test.test b/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch application test.test
index ff1641d..dd78c68 100644
--- a/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch application test.test
+++ b/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch application test.test
@@ -6,8 +6,8 @@ Element-Type: testcase
Element-Version: 3.0
External-Reference:
Id: _QsyGkNS0EeWpt76DqXjygg
-Runtime-Version: 2.2.0.201611022324
-Save-Time: 1/18/17 5:22 PM
+Runtime-Version: 2.2.0.201706152316
+Save-Time: 9/2/18 1:59 PM
Testcase-Type: ecl
------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac
@@ -36,7 +36,6 @@ with [get-window "Modelpatch Application"] {
get-tree | select "Cyber Physical System testModel6504822858552 (10)"
get-button "Copy to the right" | click
get-window "Merge Operation" | get-button OK | click
- get-window "Merge Operation" | get-button OK | click
get-button Finish | click
}
get-button "Save (M1+S)" | click
diff --git a/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch generation cancel test.test b/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch generation cancel test.test
index 41c7855..c426672 100644
--- a/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch generation cancel test.test
+++ b/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch generation cancel test.test
@@ -6,8 +6,8 @@ Element-Type: testcase
Element-Version: 3.0
External-Reference:
Id: _WwsRINSxEeWpt76DqXjygg
-Runtime-Version: 2.2.0.201611022324
-Save-Time: 1/18/17 2:51 PM
+Runtime-Version: 2.2.0.201706152316
+Save-Time: 9/2/18 2:08 PM
Testcase-Type: ecl
------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac
@@ -19,10 +19,13 @@ with [get-view "Package Explorer" | get-tree] {
get-menu "Compare With/Each Other as models" | click
}
get-window "EMF Diff/Merge" | get-button Finish | click
+get-editor "Compare ('demo_modified' - 'demo_original')" | get-tree
+ | select "Cyber Physical System testModel6504822858552 (10)"
get-menu -path "Edit/Generate modelpatch" | click
get-window "New File" | get-button Cancel | click
get-window "Model Patch Generation Information" | get-label "No file has been selected!" | get-property caption
| equals "No file has been selected!" | verify-true
get-window "Model Patch Generation Information" | get-button OK | click
get-editor "Compare ('demo_modified' - 'demo_original')" | close
+
------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac--
diff --git a/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch generation test.test b/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch generation test.test
index bee4d8b..fc7b5c0 100644
--- a/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch generation test.test
+++ b/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch generation test.test
@@ -6,8 +6,8 @@ Element-Type: testcase
Element-Version: 3.0
External-Reference:
Id: _Stt9MNSsEeWpt76DqXjygg
-Runtime-Version: 2.2.0.201611022324
-Save-Time: 1/18/17 2:50 PM
+Runtime-Version: 2.2.0.201706152316
+Save-Time: 9/2/18 2:24 PM
Testcase-Type: ecl
------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac
@@ -19,13 +19,15 @@ with [get-view "Package Explorer" | get-tree] {
get-menu "Compare With/Each Other as models" | click
}
get-window "EMF Diff/Merge" | get-button Finish | click
+get-editor "Compare ('demo_modified' - 'demo_original')" | get-tree
+ | select "Cyber Physical System testModel6504822858552 (10)"
get-menu -path "Edit/Generate modelpatch" | click
with [get-window "New File"] {
get-tree | select "org.eclipse.emf.diffmerge.patch.examples.cps"
get-editbox -after [get-label "File name:"] | set-text "generated2.modelpatch"
get-button Finish | click
}
-get-editor "ModelPatch: generated2.modelpatch" | get-tree | get-property itemCount | equals 14 | verify-true
+get-editor "ModelPatch: generated2.modelpatch" | get-tree | get-property itemCount | equals 13 | verify-true
get-editor "ModelPatch: generated2.modelpatch" | close
get-editor "Compare ('demo_modified' - 'demo_original')" | close
diff --git a/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch reverse application test.test b/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch reverse application test.test
index a165bba..689160e 100644
--- a/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch reverse application test.test
+++ b/tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch reverse application test.test
@@ -6,8 +6,8 @@ Element-Type: testcase
Element-Version: 3.0
External-Reference:
Id: _VrhxINS3EeWpt76DqXjygg
-Runtime-Version: 2.2.0.201611022324
-Save-Time: 1/18/17 5:13 PM
+Runtime-Version: 2.2.0.201706152316
+Save-Time: 9/2/18 1:59 PM
Testcase-Type: ecl
------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac
@@ -37,7 +37,6 @@ with [get-window "Modelpatch Application"] {
get-tree | select "Cyber Physical System testModel6504822858552 (10)"
get-button "Copy to the right" | click
get-window "Merge Operation" | get-button OK | click
- get-window "Merge Operation" | get-button OK | click
get-button Finish | click
}
get-button "Save (M1+S)" | click

Back to the top