Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbel Hegedus2017-01-26 05:34:19 -0500
committerAbel Hegedus2017-02-01 08:44:49 -0500
commitb860bb766c0374ec1c38cf4ab93c712f05d42504 (patch)
tree5a59f87d7c5f260367b4c5f69c66c2b1709f135e
parent9c60b8e70242913d99f07751669617224e8a3b89 (diff)
downloadorg.eclipse.emf.diffmerge.patch-b860bb766c0374ec1c38cf4ab93c712f05d42504.tar.gz
org.eclipse.emf.diffmerge.patch-b860bb766c0374ec1c38cf4ab93c712f05d42504.tar.xz
org.eclipse.emf.diffmerge.patch-b860bb766c0374ec1c38cf4ab93c712f05d42504.zip
[510580] Initial Model Patch Contribution
Change-Id: I6706ea1c3f9785aa0622162ea4f74769d652a791 Signed-off-by: Abel Hegedus <abel.hegedus@incquerylabs.com> Signed-off-by: Tamas Borbas <borbastomi@gmail.com> Signed-off-by: Balazs Grill <balazs.grill@incquerylabs.com> Signed-off-by: Daniel Segesdi <daniel.segesdi@incquerylabs.com> Signed-off-by: Peter Lunk <lunk.peter@incquerylabs.com>
-rw-r--r--.gitignore79
-rw-r--r--.project11
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples.cps/.project11
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples.cps/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples.cps/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples.cps/demo_corrected.cyberphysicalsystem59
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples.cps/demo_modified.cyberphysicalsystem133
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples.cps/demo_original.cyberphysicalsystem60
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples.cps/generated.-jackson.modelpatch237
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples.cps/generated.modelpatch219
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples.cps/validation-jackson.modelpatch55
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples.cps/validation.modelpatch66
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/.classpath6
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/.project28
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/META-INF/MANIFEST.MF9
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/about.html21
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/build.properties17
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/contents/.gitignore1
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/contents/org.eclipse.emf.diffmerge.patch.examples.cps.zipbin0 -> 4127 bytes
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/icons/genproject.gifbin0 -> 384 bytes
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/plugin.properties9
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/plugin.xml46
-rw-r--r--examples/org.eclipse.emf.diffmerge.patch.examples/pom.xml28
-rw-r--r--examples/pom.xml22
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature.dependencies/.project17
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature.dependencies/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature.dependencies/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature.dependencies/build.properties13
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature.dependencies/epl-v10.html328
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature.dependencies/feature.xml212
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature.dependencies/license.html108
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature.dependencies/pom.xml40
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature/.project17
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature/build.properties13
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature/epl-v10.html328
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature/feature.xml98
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature/license.html108
-rw-r--r--features/org.eclipse.emf.diffmerge.patch.feature/pom.xml40
-rw-r--r--features/pom.xml32
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.classpath7
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.project34
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.persistence.json/META-INF/MANIFEST.MF12
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.persistence.json/about.html21
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.persistence.json/build.properties16
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.persistence.json/plugin.properties9
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.persistence.json/pom.xml27
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.persistence.json/src/org/eclipse/emf/diffmerge/patch/serializer/gson/GsonModelPatchSerializer.java109
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.persistence.json/src/org/eclipse/emf/diffmerge/patch/serializer/gson/typeadapters/AbstractSubclassAdapter.java63
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/.classpath8
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/.project34
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/META-INF/MANIFEST.MF22
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/about.html21
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/build.properties17
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/plugin.properties9
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/pom.xml54
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/EMFModelPatchApplier.xtend39
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/EMFModelPatchMetadata.xtend25
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/EMFPatchApplication.xtend257
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/ModelPatchRecorder.xtend458
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/BaseIndexEObjectLocator.xtend39
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/EMFIdentifierProvider.java89
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/EObjectIdentifierProvider.java19
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/EObjectLocator.java22
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/IdentifiedEMFObjectLocator.java134
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/TreeIteratorEObjectLocator.xtend37
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/AbstractEMFModleAccess.xtend104
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/EMFModelAccess.xtend46
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/ModelAccessProvider.xtend49
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/ModelAccessTypes.java16
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/SimpleReflectiveEMFModelAccess.xtend61
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/ViatraModelAccess.xtend83
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.runtime/xtend-gen/.gitignore2
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/.classpath8
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/.project34
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/META-INF/MANIFEST.MF31
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/about.html21
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/build.properties19
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/icons/apply.pngbin0 -> 14195 bytes
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/icons/apply_16.pngbin0 -> 579 bytes
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/icons/generate.pngbin0 -> 13242 bytes
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/icons/generate_16.pngbin0 -> 405 bytes
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/icons/patch.pngbin0 -> 457 bytes
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/icons/patch_16.pngbin0 -> 528 bytes
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/icons/reverse.pngbin0 -> 13859 bytes
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/icons/reverse_16.pngbin0 -> 571 bytes
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/plugin.properties9
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/plugin.xml128
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/pom.xml54
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/Activator.java58
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/dialogs/ModelpatchEntryFilterCreationDialog.java273
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/dialogs/ModelpatchViewerDialog.java130
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/dialogs/PluginID.java21
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/editors/ModelPatchEditorPart.java263
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ComparisonSelectionUtil.xtend163
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ModelpatchApplicationHandler.xtend54
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ModelpatchGenerationHandler.xtend95
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/preferences/ModelPatchPreferencePage.java47
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/preferences/ModelPatchPreferenceProvider.java33
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/DefaultEntryLabelProvider.xtend52
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/DescriptiveEntryLabelProvider.xtend77
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/DialogFactory.xtend174
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/EntryPropertyWrapper.java33
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/IEntryLabelProvider.java23
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/IdentifiableWrapper.java16
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/IdentifiableWrapperFactory.java27
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchContentProvider.xtend53
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchEntryFilterContentProvider.xtend37
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchEntryFilterLabelProvider.xtend44
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchEntryHelper.xtend42
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchLabelProvider.xtend64
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelpatchApplicationDTO.xtend215
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/SerializationTypes.java17
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/SerializerProvider.xtend31
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/ModelpatchApplicationWizard.xtend89
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchEDMWizardPage.java99
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchFilteringWizardPage.java244
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchLoadingPatchWizardPage.java118
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchResultWizardPage.java223
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/wb/swt/SWTResourceManager.java447
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch.ui/xtend-gen/.gitignore2
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/.classpath8
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/.project34
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/META-INF/MANIFEST.MF14
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/about.html21
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/build.properties17
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/plugin.properties9
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/pom.xml54
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/AbstractModelPatchEntry.java54
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/AttributeEntry.java52
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/ElementEntry.java53
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/ReferenceEntry.java53
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/StructuralFeatureEntry.java54
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/BaseModelPatchMetadata.java61
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ChangeDirection.java16
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ComplexMPEFilterType.java15
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/EntryType.java17
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/IModelPatchEntryFilter.java15
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/Identifiable.java58
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatch.java36
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchBuilder.java56
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchDiagnosticElement.xtend22
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchEntry.java21
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchEntryBuilder.java134
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchEntryProperty.java15
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchException.java31
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchFilterApplier.xtend45
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchMetadata.java23
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchReverser.xtend81
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/PatchApplication.xtend16
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/PatchApplicationDiagnostic.java30
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/ComplexEntryFilter.xtend42
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/EntryDirectionFilter.xtend33
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/EntryPropertyFilter.xtend67
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/EntryTypeFilter.xtend34
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/serializer/IModelPatchSerializer.java52
-rw-r--r--plugins/org.eclipse.emf.diffmerge.patch/xtend-gen/.gitignore2
-rw-r--r--plugins/pom.xml25
-rw-r--r--pom.xml28
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.parent/.project11
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.parent/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.parent/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.parent/header.epl.txt4
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.parent/pom.xml219
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.product/.project11
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.product/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.product/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.product/modelpatch_rcp.product128
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.product/pom.xml60
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.setup/.project11
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.setup/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.setup/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.setup/Modelpatch.setup451
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.target/.gitignore1
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.target/.project11
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.target/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.target/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.target/org.eclipse.emf.diffmerge.patch.target.target34
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.target/org.eclipse.emf.diffmerge.patch.target.tpd29
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.target/pom.xml25
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.update/.project11
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.update/category.xml7
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.update/packaging-p2composite.ant95
-rw-r--r--releng/org.eclipse.emf.diffmerge.patch.update/pom.xml224
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/.classpath8
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/.project34
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/META-INF/MANIFEST.MF20
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/about.html21
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/build.properties17
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/launch/RunAllTestSuite.launch29
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/plugin.properties9
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/results/.gitignore2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/src/org/eclipse/emf/diffmerge/patch/tests/all/RunAllTestSuite.xtend27
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.all/xtend-gen/.gitignore2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/.classpath8
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/.project34
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/META-INF/MANIFEST.MF26
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/about.html21
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/build.properties17
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/.gitignore2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/ClockRadio.melodymodeller2661
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/clockRadio-attributeSetting.modelpatch59
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/clockRadio-combinedPatch.modelpatch2335
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/clockRadio-logicalArchRemove-transition.modelpatch126
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/clockRadio-physicalArch-transition.modelpatch2170
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/demo-patch-generated.modelpatch219
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/demo-patch-jackson.modelpatch63
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/demo-patch.modelpatch78
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/demo2-patch.modelpatch914
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/demo2_modified.cyberphysicalsystem166
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/demo2_original.cyberphysicalsystem137
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/demo_modified.cyberphysicalsystem133
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/demo_original.cyberphysicalsystem60
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/demo_withExtraContainmentTree.cyberphysicalsystem139
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/demo_withExtraContainmentTreeAndReferenceFromOut.cyberphysicalsystem140
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/demo_withExtraContainmentTreeAndReferenceToOut.cyberphysicalsystem140
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/demo_withModifiedRefWhichHasEOpposite.cyberphysicalsystem132
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/model/extraContInRef-patch.modelpatch77
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/plugin.properties9
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/pom.xml58
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/results/.gitignore2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/src/org/eclipse/emf/diffmerge/patch/tests/emf/CPSModelPatchApplierTest.xtend170
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/src/org/eclipse/emf/diffmerge/patch/tests/emf/CPSModelPatchTest.xtend40
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/src/org/eclipse/emf/diffmerge/patch/tests/emf/EMFDiffMergeTest.xtend216
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/src/org/eclipse/emf/diffmerge/patch/tests/emf/EMFModelAccessTest.xtend562
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/src/org/eclipse/emf/diffmerge/patch/tests/emf/EMFModelPatchMetadataTest.xtend40
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/src/org/eclipse/emf/diffmerge/patch/tests/emf/ModelPatchApplierSmokeTests.xtend145
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/src/org/eclipse/emf/diffmerge/patch/tests/emf/ModelPatchEmfTestSuite.xtend30
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/src/org/eclipse/emf/diffmerge/patch/tests/emf/ModelPatchExporterTest.xtend146
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/src/org/eclipse/emf/diffmerge/patch/tests/emf/ModelPatchRecorderTest.xtend397
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/src/org/eclipse/emf/diffmerge/patch/tests/emf/ModelPatchScalerTest.java123
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.emf/xtend-gen/.gitignore2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/.classpath8
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/.project34
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/META-INF/MANIFEST.MF24
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/about.html21
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/build.properties17
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/plugin.properties9
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/pom.xml50
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/resources/.gitignore5
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/src/org/eclipse/emf/diffmerge/patch/tests/performance/CpsModelLoader.java330
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/src/org/eclipse/emf/diffmerge/patch/tests/performance/ModelPatchPerformanceTests.xtend202
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.performance/xtend-gen/.gitignore2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.persistence.json/.classpath8
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.persistence.json/.project34
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.persistence.json/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.persistence.json/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.persistence.json/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.persistence.json/META-INF/MANIFEST.MF12
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.persistence.json/about.html21
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.persistence.json/build.properties17
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.persistence.json/plugin.properties9
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.persistence.json/pom.xml50
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.persistence.json/src/org/eclipse/emf/diffmerge/patch/tests/persistence/json/ModelPatchPersistenceJsonTest.java115
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.persistence.json/src/org/eclipse/emf/diffmerge/patch/tests/persistence/json/ModelPatchPersistenceJsonTestSuite.xtend21
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.persistence.json/xtend-gen/.gitignore2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/.project17
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/Modelpatch application and reverse application test suite.suite20
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/Modelpatch application extra test suite.suite18
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/Modelpatch generation test suite.suite18
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/Modelpatch test suite.suite19
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/Modelpatch workbench context.ctx21
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/Modelpatch workspace context.ctx134
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/Start EMF Diff_Merge.test41
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/pom.xml77
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/rcptt.properties15
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch application (direct) cancel test.test39
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch application (direct) test.test48
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch application filter test.test54
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch application test.test54
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch bad patch application test.test62
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch generation cancel test.test28
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch generation file permission problem test.test29
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch generation test.test33
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch reverse application (direct) test.test47
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests.ui/tests/Modelpatch reverse application test.test55
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/.classpath8
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/.project34
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/META-INF/MANIFEST.MF11
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/about.html21
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/build.properties17
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/plugin.properties9
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/pom.xml50
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/src/org/eclipse/emf/diffmerge/patch/tests/BasicReverseModelPatchTests.xtend109
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/src/org/eclipse/emf/diffmerge/patch/tests/ComplexReverseModelPatchTest.xtend177
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/src/org/eclipse/emf/diffmerge/patch/tests/ModelPatchTestSuite.xtend22
-rw-r--r--tests/org.eclipse.emf.diffmerge.patch.tests/xtend-gen/.gitignore2
-rw-r--r--tests/pom.xml35
318 files changed, 25082 insertions, 53 deletions
diff --git a/.gitignore b/.gitignore
index 2c7b5cf..326d6b9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,78 +1,51 @@
-########
-## EDM
-########
-testWk/
-wintest/
-
-
-#################
## Eclipse
-#################
*.pydevproject
.metadata
+plugin.xml_gen
bin/
+target/
tmp/
-*.tmp
-*.bak
-*.swp
-*~.nib
-#local.properties
-#.classpath
-#.settings/
-.loadpath
-
-# External tool builders
-.externalToolBuilders/
-
-# Locally stored "Eclipse launch configurations"
-#*.launch
-
-# CDT-specific
-.cproject
-
-# PDT-specific
-.buildpath
-
-
-########
-## Sonar
-########
+MANIFEST.MF_gen
+.metadata
+runtimeInfo
+workspace
+*._trace
+deps/
+diagrams/*
+.idea
+log/
+catalog-v*.xml*.tar.gz
+*.zip
+
+### M2E
+org.eclipse.m2e.core.prefs
+
+### Sonar
org.sonar.ide.eclipse.core.prefs
-
-#########
## KDiff3
-#########
*.orig
-
-#############
-## Clear Case
-#############
-*.mkelem
-*.contrib
-*.keep
+## R
+.Rhistory
+.RData
+.Rproj.user
-##########
## Windows
-##########
-# Windows image file caches
+### Windows image file caches
Thumbs.db
ehthumbs.db
-# Folder config file
+### Folder config file
Desktop.ini
-# Recycle Bin used on file shares
+### Recycle Bin used on file shares
$RECYCLE.BIN/
-
-#######
-# Linux
-#######
+## Linux
.DS_Store
.DS_Store?
._*
diff --git a/.project b/.project
new file mode 100644
index 0000000..5adf43b
--- /dev/null
+++ b/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.patch.root</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples.cps/.project b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/.project
new file mode 100644
index 0000000..a4203cd
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.patch.examples.cps</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples.cps/.settings/org.eclipse.core.resources.prefs b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples.cps/.settings/org.eclipse.core.runtime.prefs b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples.cps/demo_corrected.cyberphysicalsystem b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/demo_corrected.cyberphysicalsystem
new file mode 100644
index 0000000..5c3581a
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/demo_corrected.cyberphysicalsystem
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+<cps:CyberPhysicalSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:cps="http://org.eclipse.viatra/model/cps" identifier="testModel6504822858552">
+ <appTypes identifier="simple.cps.app.FirstAppClass0">
+ <instances identifier="simple.cps.app.FirstAppClass0.inst0" allocatedTo="simple.cps.host.SecondHostClass0.inst1"/>
+ <behavior identifier="simple.cps.app.FirstAppClass0.sm0" initial="simple.cps.app.FirstAppClass0.sm0.s0">
+ <states identifier="simple.cps.app.FirstAppClass0.sm0.s0">
+ <outgoingTransitions identifier="simple.cps.app.FirstAppClass0.sm0.s0.t0" targetState="simple.cps.app.FirstAppClass0.sm0.s3" action="waitForSignal(6)"/>
+ <outgoingTransitions identifier="simple.cps.app.FirstAppClass0.sm0.s0.t3" targetState="simple.cps.app.FirstAppClass0.sm0.s4" action="waitForSignal(3)"/>
+ </states>
+ <states identifier="simple.cps.app.FirstAppClass0.sm0.s1"/>
+ <states identifier="simple.cps.app.FirstAppClass0.sm0.s2">
+ <outgoingTransitions identifier="simple.cps.app.FirstAppClass0.sm0.s2.t1" targetState="simple.cps.app.FirstAppClass0.sm0.s1" action="waitForSignal(7)"/>
+ </states>
+ <states identifier="simple.cps.app.FirstAppClass0.sm0.s3">
+ <outgoingTransitions identifier="simple.cps.app.FirstAppClass0.sm0.s3.t2" targetState="simple.cps.app.FirstAppClass0.sm0.s2" action="waitForSignal(7)"/>
+ </states>
+ <states identifier="simple.cps.app.FirstAppClass0.sm0.s4"/>
+ </behavior>
+ </appTypes>
+ <appTypes identifier="simple.cps.app.SecondAppClass0">
+ <instances identifier="simple.cps.app.SecondAppClass0.inst0" allocatedTo="simple.cps.host.SecondHostClass0.inst2"/>
+ <behavior identifier="simple.cps.app.SecondAppClass0.sm0" initial="simple.cps.app.SecondAppClass0.sm0.s0">
+ <states identifier="simple.cps.app.SecondAppClass0.sm0.s0">
+ <outgoingTransitions identifier="simple.cps.app.SecondAppClass0.sm0.s0.t1" targetState="simple.cps.app.SecondAppClass0.sm0.s2" action="waitForSignal(7)"/>
+ </states>
+ <states identifier="simple.cps.app.SecondAppClass0.sm0.s1">
+ <outgoingTransitions identifier="simple.cps.app.SecondAppClass0.sm0.s1.t4" targetState="simple.cps.app.SecondAppClass0.sm0.s2"/>
+ </states>
+ <states identifier="simple.cps.app.SecondAppClass0.sm0.s2">
+ <outgoingTransitions identifier="simple.cps.app.SecondAppClass0.sm0.s2.t0" targetState="simple.cps.app.SecondAppClass0.sm0.s0"/>
+ <outgoingTransitions identifier="simple.cps.app.SecondAppClass0.sm0.s2.t3" targetState="simple.cps.app.SecondAppClass0.sm0.s1"/>
+ </states>
+ </behavior>
+ </appTypes>
+ <hostTypes identifier="simple.cps.host.FirstHostClass0">
+ <instances identifier="simple.cps.host.FirstHostClass0.inst0" nodeIp="simple.cps.host.FirstHostClass0.inst0"/>
+ <instances identifier="simple.cps.host.FirstHostClass0.inst1" nodeIp="simple.cps.host.FirstHostClass0.inst1"/>
+ <instances identifier="simple.cps.host.FirstHostClass0.inst2" nodeIp="simple.cps.host.FirstHostClass0.inst2"/>
+ <instances identifier="simple.cps.host.FirstHostClass0.inst3" nodeIp="simple.cps.host.FirstHostClass0.inst3"/>
+ <instances identifier="simple.cps.host.FirstHostClass0.inst4" nodeIp="simple.cps.host.FirstHostClass0.inst4"/>
+ </hostTypes>
+ <hostTypes identifier="simple.cps.host.SecondHostClass0">
+ <instances identifier="simple.cps.host.SecondHostClass0.inst0" nodeIp="simple.cps.host.SecondHostClass0.inst0" communicateWith="simple.cps.host.FirstHostClass0.inst3 simple.cps.host.FirstHostClass0.inst1 simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst0 simple.cps.host.FirstHostClass0.inst4"/>
+ <instances identifier="simple.cps.host.SecondHostClass0.inst1" nodeIp="simple.cps.host.SecondHostClass0.inst1" applications="simple.cps.app.FirstAppClass0.inst0" communicateWith="simple.cps.host.FirstHostClass0.inst4 simple.cps.host.FirstHostClass0.inst1 simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst0 simple.cps.host.FirstHostClass0.inst3"/>
+ <instances identifier="simple.cps.host.SecondHostClass0.inst2" nodeIp="simple.cps.host.SecondHostClass0.inst2" applications="simple.cps.app.SecondAppClass0.inst0" communicateWith="simple.cps.host.FirstHostClass0.inst3 simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst0 simple.cps.host.FirstHostClass0.inst4 simple.cps.host.FirstHostClass0.inst1"/>
+ <instances identifier="simple.cps.host.SecondHostClass0.inst3" nodeIp="simple.cps.host.SecondHostClass0.inst3" communicateWith="simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst1 simple.cps.host.FirstHostClass0.inst0 simple.cps.host.FirstHostClass0.inst4 simple.cps.host.FirstHostClass0.inst3"/>
+ <instances identifier="simple.cps.host.SecondHostClass0.inst4" nodeIp="simple.cps.host.SecondHostClass0.inst4" communicateWith="simple.cps.host.FirstHostClass0.inst3 simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst1 simple.cps.host.FirstHostClass0.inst4 simple.cps.host.FirstHostClass0.inst0"/>
+ </hostTypes>
+</cps:CyberPhysicalSystem>
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples.cps/demo_modified.cyberphysicalsystem b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/demo_modified.cyberphysicalsystem
new file mode 100644
index 0000000..acc8a9a
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/demo_modified.cyberphysicalsystem
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+<cps:CyberPhysicalSystem
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:cps="http://org.eclipse.viatra/model/cps"
+ identifier="testModel6504822858552">
+ <appTypes
+ identifier="simple.cps.app.FirstAppClass0">
+ <instances
+ identifier="simple.cps.app.FirstAppClass0.inst0"
+ state="Stopped"
+ allocatedTo="simple.cps.host.SecondHostClass0.inst0"/>
+ <behavior
+ identifier="simple.cps.app.FirstAppClass0.sm0"
+ initial="simple.cps.app.FirstAppClass0.sm0.s0">
+ <states
+ identifier="simple.cps.app.FirstAppClass0.sm0.s0">
+ <outgoingTransitions
+ identifier="simple.cps.app.FirstAppClass0.sm0.s0.t0"
+ targetState="simple.cps.app.FirstAppClass0.sm0.s3"
+ action="waitForSignal(6)"/>
+ <outgoingTransitions
+ identifier="simple.cps.app.FirstAppClass0.sm0.s0.t3"
+ targetState="simple.cps.app.FirstAppClass0.sm0.s4"
+ action="waitForSignal(3)"/>
+ </states>
+ <states
+ identifier="simple.cps.app.FirstAppClass0.sm0.s1"/>
+ <states
+ identifier="simple.cps.app.FirstAppClass0.sm0.s2">
+ <outgoingTransitions
+ identifier="simple.cps.app.FirstAppClass0.sm0.s2.t1"
+ targetState="simple.cps.app.FirstAppClass0.sm0.s1"
+ action="waitForSignal(7)"/>
+ </states>
+ <states
+ identifier="simple.cps.app.FirstAppClass0.sm0.s3">
+ <outgoingTransitions
+ identifier="simple.cps.app.FirstAppClass0.sm0.s3.t2"
+ targetState="simple.cps.app.FirstAppClass0.sm0.s2"
+ action="waitForSignal(7)"/>
+ </states>
+ <states
+ identifier="simple.cps.app.FirstAppClass0.sm0.s4"/>
+ </behavior>
+ </appTypes>
+ <appTypes
+ identifier="simple.cps.app.SecondAppClass0">
+ <instances
+ identifier="simple.cps.app.SecondAppClass0.inst0"
+ allocatedTo="simple.cps.host.SecondHostClass0.inst2"/>
+ <behavior
+ identifier="simple.cps.app.SecondAppClass0.sm0"
+ initial="simple.cps.app.SecondAppClass0.sm0.s0">
+ <states
+ identifier="simple.cps.app.SecondAppClass0.sm0.s0">
+ <outgoingTransitions
+ identifier="simple.cps.app.SecondAppClass0.sm0.s0.t1"
+ targetState="simple.cps.app.SecondAppClass0.sm0.s2"
+ action="waitForSignal(7)"/>
+ <outgoingTransitions
+ identifier="simple.cps.app.SecondAppClass0.sm0.s0.t2"
+ targetState="simple.cps.app.SecondAppClass0.sm0.s1"
+ action="waitForSignal(7)"/>
+ </states>
+ <states
+ identifier="simple.cps.app.SecondAppClass0.sm0.s1">
+ <outgoingTransitions
+ identifier="simple.cps.app.SecondAppClass0.sm0.s1.t4"
+ targetState="simple.cps.app.SecondAppClass0.sm0.s2"/>
+ </states>
+ <states
+ identifier="simple.cps.app.SecondAppClass0.sm0.s2">
+ <outgoingTransitions
+ identifier="simple.cps.app.SecondAppClass0.sm0.s2.t0"
+ targetState="simple.cps.app.SecondAppClass0.sm0.s0"/>
+ <outgoingTransitions
+ identifier="simple.cps.app.SecondAppClass0.sm0.s2.t3"
+ targetState="simple.cps.app.SecondAppClass0.sm0.s1"/>
+ </states>
+ </behavior>
+ </appTypes>
+ <hostTypes
+ identifier="simple.cps.host.FirstHostClass0">
+ <instances
+ identifier="simple.cps.host.FirstHostClass0.inst1"
+ nodeIp="simple.cps.host.FirstHostClass0.inst1"/>
+ <instances
+ identifier="simple.cps.host.FirstHostClass0.inst2"
+ nodeIp="simple.cps.host.FirstHostClass0.inst2"/>
+ <instances
+ identifier="simple.cps.host.FirstHostClass0.inst3"
+ nodeIp="simple.cps.host.FirstHostClass0.inst3"/>
+ <instances
+ identifier="simple.cps.host.FirstHostClass0.inst4"
+ nodeIp="simple.cps.host.FirstHostClass0.inst4"/>
+ </hostTypes>
+ <hostTypes
+ identifier="simple.cps.host.SecondHostClass0">
+ <instances
+ identifier="simple.cps.host.SecondHostClass0.inst0"
+ nodeIp="simple.cps.host.SecondHostClass0.inst0"
+ applications="simple.cps.app.FirstAppClass0.inst0"
+ communicateWith="simple.cps.host.FirstHostClass0.inst3 simple.cps.host.FirstHostClass0.inst1 simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst4"/>
+ <instances
+ identifier="simple.cps.host.SecondHostClass0.inst1"
+ nodeIp="simple.cps.host.SecondHostClass0.inst1"
+ communicateWith="simple.cps.host.FirstHostClass0.inst4 simple.cps.host.FirstHostClass0.inst1 simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst3"/>
+ <instances
+ identifier="simple.cps.host.SecondHostClass0.inst2"
+ nodeIp="simple.cps.host.SecondHostClass0.inst2"
+ applications="simple.cps.app.SecondAppClass0.inst0"
+ communicateWith="simple.cps.host.FirstHostClass0.inst3 simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst4 simple.cps.host.FirstHostClass0.inst1"/>
+ <instances
+ identifier="simple.cps.host.SecondHostClass0.inst3"
+ nodeIp="simple.cps.host.SecondHostClass0.inst3"
+ communicateWith="simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst1 simple.cps.host.FirstHostClass0.inst4 simple.cps.host.FirstHostClass0.inst3"/>
+ <instances
+ identifier="simple.cps.host.SecondHostClass0.inst4"
+ nodeIp="simple.cps.host.SecondHostClass0.inst4"
+ communicateWith="simple.cps.host.FirstHostClass0.inst3 simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst1 simple.cps.host.FirstHostClass0.inst4"/>
+ </hostTypes>
+</cps:CyberPhysicalSystem>
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples.cps/demo_original.cyberphysicalsystem b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/demo_original.cyberphysicalsystem
new file mode 100644
index 0000000..9650842
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/demo_original.cyberphysicalsystem
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+<cps:CyberPhysicalSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:cps="http://org.eclipse.viatra/model/cps" identifier="testModel6504822858552">
+ <appTypes identifier="simple.cps.app.FirstAppClass0">
+ <instances identifier="simple.cps.app.FirstAppClass0.inst0" allocatedTo="simple.cps.host.SecondHostClass0.inst1"/>
+ <behavior identifier="simple.cps.app.FirstAppClass0.sm0" initial="simple.cps.app.FirstAppClass0.sm0.s0">
+ <states identifier="simple.cps.app.FirstAppClass0.sm0.s0">
+ <outgoingTransitions identifier="simple.cps.app.FirstAppClass0.sm0.s0.t0" targetState="simple.cps.app.FirstAppClass0.sm0.s3" action="waitForSignal(6)"/>
+ <outgoingTransitions identifier="simple.cps.app.FirstAppClass0.sm0.s0.t3" targetState="simple.cps.app.FirstAppClass0.sm0.s4" action="waitForSignal(3)"/>
+ </states>
+ <states identifier="simple.cps.app.FirstAppClass0.sm0.s1"/>
+ <states identifier="simple.cps.app.FirstAppClass0.sm0.s2">
+ <outgoingTransitions identifier="simple.cps.app.FirstAppClass0.sm0.s2.t1" targetState="simple.cps.app.FirstAppClass0.sm0.s1" action="waitForSignal(7)"/>
+ </states>
+ <states identifier="simple.cps.app.FirstAppClass0.sm0.s3">
+ <outgoingTransitions identifier="simple.cps.app.FirstAppClass0.sm0.s3.t2" targetState="simple.cps.app.FirstAppClass0.sm0.s2" action="waitForSignal(7)"/>
+ </states>
+ <states identifier="simple.cps.app.FirstAppClass0.sm0.s4"/>
+ </behavior>
+ </appTypes>
+ <appTypes identifier="simple.cps.app.SecondAppClass0">
+ <instances identifier="simple.cps.app.SecondAppClass0.inst0" allocatedTo="simple.cps.host.SecondHostClass0.inst2"/>
+ <behavior identifier="simple.cps.app.SecondAppClass0.sm0" initial="simple.cps.app.SecondAppClass0.sm0.s0">
+ <states identifier="simple.cps.app.SecondAppClass0.sm0.s0">
+ <outgoingTransitions identifier="simple.cps.app.SecondAppClass0.sm0.s0.t1" targetState="simple.cps.app.SecondAppClass0.sm0.s2" action="waitForSignal(7)"/>
+ <outgoingTransitions identifier="simple.cps.app.SecondAppClass0.sm0.s0.t2" targetState="simple.cps.app.SecondAppClass0.sm0.s1" action="waitForSignal(7)"/>
+ </states>
+ <states identifier="simple.cps.app.SecondAppClass0.sm0.s1">
+ <outgoingTransitions identifier="simple.cps.app.SecondAppClass0.sm0.s1.t4" targetState="simple.cps.app.SecondAppClass0.sm0.s2"/>
+ </states>
+ <states identifier="simple.cps.app.SecondAppClass0.sm0.s2">
+ <outgoingTransitions identifier="simple.cps.app.SecondAppClass0.sm0.s2.t0" targetState="simple.cps.app.SecondAppClass0.sm0.s0"/>
+ <outgoingTransitions identifier="simple.cps.app.SecondAppClass0.sm0.s2.t3" targetState="simple.cps.app.SecondAppClass0.sm0.s1"/>
+ </states>
+ </behavior>
+ </appTypes>
+ <hostTypes identifier="simple.cps.host.FirstHostClass0">
+ <instances identifier="simple.cps.host.FirstHostClass0.inst0" nodeIp="simple.cps.host.FirstHostClass0.inst0"/>
+ <instances identifier="simple.cps.host.FirstHostClass0.inst1" nodeIp="simple.cps.host.FirstHostClass0.inst1"/>
+ <instances identifier="simple.cps.host.FirstHostClass0.inst2" nodeIp="simple.cps.host.FirstHostClass0.inst2"/>
+ <instances identifier="simple.cps.host.FirstHostClass0.inst3" nodeIp="simple.cps.host.FirstHostClass0.inst3"/>
+ <instances identifier="simple.cps.host.FirstHostClass0.inst4" nodeIp="simple.cps.host.FirstHostClass0.inst4"/>
+ </hostTypes>
+ <hostTypes identifier="simple.cps.host.SecondHostClass0">
+ <instances identifier="simple.cps.host.SecondHostClass0.inst0" nodeIp="simple.cps.host.SecondHostClass0.inst0" communicateWith="simple.cps.host.FirstHostClass0.inst3 simple.cps.host.FirstHostClass0.inst1 simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst0 simple.cps.host.FirstHostClass0.inst4"/>
+ <instances identifier="simple.cps.host.SecondHostClass0.inst1" nodeIp="simple.cps.host.SecondHostClass0.inst1" applications="simple.cps.app.FirstAppClass0.inst0" communicateWith="simple.cps.host.FirstHostClass0.inst4 simple.cps.host.FirstHostClass0.inst1 simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst0 simple.cps.host.FirstHostClass0.inst3"/>
+ <instances identifier="simple.cps.host.SecondHostClass0.inst2" nodeIp="simple.cps.host.SecondHostClass0.inst2" applications="simple.cps.app.SecondAppClass0.inst0" communicateWith="simple.cps.host.FirstHostClass0.inst3 simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst0 simple.cps.host.FirstHostClass0.inst4 simple.cps.host.FirstHostClass0.inst1"/>
+ <instances identifier="simple.cps.host.SecondHostClass0.inst3" nodeIp="simple.cps.host.SecondHostClass0.inst3" communicateWith="simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst1 simple.cps.host.FirstHostClass0.inst0 simple.cps.host.FirstHostClass0.inst4 simple.cps.host.FirstHostClass0.inst3"/>
+ <instances identifier="simple.cps.host.SecondHostClass0.inst4" nodeIp="simple.cps.host.SecondHostClass0.inst4" communicateWith="simple.cps.host.FirstHostClass0.inst3 simple.cps.host.FirstHostClass0.inst2 simple.cps.host.FirstHostClass0.inst1 simple.cps.host.FirstHostClass0.inst4 simple.cps.host.FirstHostClass0.inst0"/>
+ </hostTypes>
+</cps:CyberPhysicalSystem>
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples.cps/generated.-jackson.modelpatch b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/generated.-jackson.modelpatch
new file mode 100644
index 0000000..87e6446
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/generated.-jackson.modelpatch
@@ -0,0 +1,237 @@
+{
+ "ModelPatch" : {
+ "Metadata" : {
+ "ModelPatchMetadata" : {
+ "Author" : null,
+ "CreatedAt" : "2016-03-29T13:05:04.263",
+ "Description" : null,
+ "Input" : null
+ }
+ },
+ "Entries" : [ {
+ "AttributeEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.host.FirstHostClass0.inst0",
+ "Description" : null
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#HostInstance.nodeIp",
+ "Description" : null
+ },
+ "Index" : null,
+ "Value" : "simple.cps.host.FirstHostClass0.inst0"
+ }
+ }, {
+ "AttributeEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.app.FirstAppClass0.inst0",
+ "Description" : null
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#ApplicationInstance.state",
+ "Description" : null
+ },
+ "Index" : null,
+ "Value" : "Running"
+ }
+ }, {
+ "ReferenceEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.app.FirstAppClass0.inst0",
+ "Description" : null
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#ApplicationInstance.allocatedTo",
+ "Description" : null
+ },
+ "Index" : null,
+ "Target" : {
+ "Identifier" : "simple.cps.host.SecondHostClass0.inst1",
+ "Description" : null
+ }
+ }
+ }, {
+ "ReferenceEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.host.SecondHostClass0.inst0",
+ "Description" : null
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#HostInstance.communicateWith",
+ "Description" : null
+ },
+ "Index" : 3,
+ "Target" : {
+ "Identifier" : "simple.cps.host.FirstHostClass0.inst0",
+ "Description" : null
+ }
+ }
+ }, {
+ "ReferenceEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.host.SecondHostClass0.inst1",
+ "Description" : null
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#HostInstance.applications",
+ "Description" : null
+ },
+ "Index" : 0,
+ "Target" : {
+ "Identifier" : "simple.cps.app.FirstAppClass0.inst0",
+ "Description" : null
+ }
+ }
+ }, {
+ "ReferenceEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.host.SecondHostClass0.inst1",
+ "Description" : null
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#HostInstance.communicateWith",
+ "Description" : null
+ },
+ "Index" : 3,
+ "Target" : {
+ "Identifier" : "simple.cps.host.FirstHostClass0.inst0",
+ "Description" : null
+ }
+ }
+ }, {
+ "ReferenceEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.host.SecondHostClass0.inst2",
+ "Description" : null
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#HostInstance.communicateWith",
+ "Description" : null
+ },
+ "Index" : 2,
+ "Target" : {
+ "Identifier" : "simple.cps.host.FirstHostClass0.inst0",
+ "Description" : null
+ }
+ }
+ }, {
+ "ReferenceEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.host.SecondHostClass0.inst3",
+ "Description" : null
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#HostInstance.communicateWith",
+ "Description" : null
+ },
+ "Index" : 2,
+ "Target" : {
+ "Identifier" : "simple.cps.host.FirstHostClass0.inst0",
+ "Description" : null
+ }
+ }
+ }, {
+ "ReferenceEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.host.SecondHostClass0.inst4",
+ "Description" : null
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#HostInstance.communicateWith",
+ "Description" : null
+ },
+ "Index" : 4,
+ "Target" : {
+ "Identifier" : "simple.cps.host.FirstHostClass0.inst0",
+ "Description" : null
+ }
+ }
+ }, {
+ "ReferenceEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.host.FirstHostClass0",
+ "Description" : null
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#HostType.instances",
+ "Description" : null
+ },
+ "Index" : 0,
+ "Target" : {
+ "Identifier" : "simple.cps.host.FirstHostClass0.inst0",
+ "Description" : null
+ }
+ }
+ }, {
+ "ElementEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.host.FirstHostClass0.inst0",
+ "Description" : null
+ },
+ "ElementType" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#HostInstance",
+ "Description" : null
+ }
+ }
+ }, {
+ "ReferenceEntry" : {
+ "ChangeType" : "ADD",
+ "Context" : {
+ "Identifier" : "simple.cps.app.FirstAppClass0.inst0",
+ "Description" : null
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#ApplicationInstance.allocatedTo",
+ "Description" : null
+ },
+ "Index" : null,
+ "Target" : {
+ "Identifier" : "simple.cps.host.SecondHostClass0.inst0",
+ "Description" : null
+ }
+ }
+ }, {
+ "ReferenceEntry" : {
+ "ChangeType" : "ADD",
+ "Context" : {
+ "Identifier" : "simple.cps.host.SecondHostClass0.inst0",
+ "Description" : null
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#HostInstance.applications",
+ "Description" : null
+ },
+ "Index" : 0,
+ "Target" : {
+ "Identifier" : "simple.cps.app.FirstAppClass0.inst0",
+ "Description" : null
+ }
+ }
+ }, {
+ "AttributeEntry" : {
+ "ChangeType" : "ADD",
+ "Context" : {
+ "Identifier" : "simple.cps.app.FirstAppClass0.inst0",
+ "Description" : null
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#ApplicationInstance.state",
+ "Description" : null
+ },
+ "Index" : null,
+ "Value" : "Stopped"
+ }
+ } ]
+ }
+} \ No newline at end of file
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples.cps/generated.modelpatch b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/generated.modelpatch
new file mode 100644
index 0000000..3175391
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/generated.modelpatch
@@ -0,0 +1,219 @@
+{
+ "metadata": {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.api.BaseModelPatchMetadata",
+ "INSTANCE": {
+ "createdAt": "Wed Jan 25 10:27:18 CET 2017"
+ }
+ },
+ "entries": [
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.AttributeEntry",
+ "INSTANCE": {
+ "value": "simple.cps.host.FirstHostClass0.inst0",
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#HostInstance.nodeIp"
+ },
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.host.FirstHostClass0.inst0"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.AttributeEntry",
+ "INSTANCE": {
+ "value": "Running",
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#ApplicationInstance.state"
+ },
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.app.FirstAppClass0.inst0"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ReferenceEntry",
+ "INSTANCE": {
+ "target": {
+ "identifier": "simple.cps.host.SecondHostClass0.inst1"
+ },
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#ApplicationInstance.allocatedTo"
+ },
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.app.FirstAppClass0.inst0"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ReferenceEntry",
+ "INSTANCE": {
+ "target": {
+ "identifier": "simple.cps.host.FirstHostClass0.inst0"
+ },
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#HostInstance.communicateWith"
+ },
+ "index": 3,
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.host.SecondHostClass0.inst0"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ReferenceEntry",
+ "INSTANCE": {
+ "target": {
+ "identifier": "simple.cps.app.FirstAppClass0.inst0"
+ },
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#HostInstance.applications"
+ },
+ "index": 0,
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.host.SecondHostClass0.inst1"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ReferenceEntry",
+ "INSTANCE": {
+ "target": {
+ "identifier": "simple.cps.host.FirstHostClass0.inst0"
+ },
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#HostInstance.communicateWith"
+ },
+ "index": 3,
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.host.SecondHostClass0.inst1"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ReferenceEntry",
+ "INSTANCE": {
+ "target": {
+ "identifier": "simple.cps.host.FirstHostClass0.inst0"
+ },
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#HostInstance.communicateWith"
+ },
+ "index": 2,
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.host.SecondHostClass0.inst2"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ReferenceEntry",
+ "INSTANCE": {
+ "target": {
+ "identifier": "simple.cps.host.FirstHostClass0.inst0"
+ },
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#HostInstance.communicateWith"
+ },
+ "index": 2,
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.host.SecondHostClass0.inst3"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ReferenceEntry",
+ "INSTANCE": {
+ "target": {
+ "identifier": "simple.cps.host.FirstHostClass0.inst0"
+ },
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#HostInstance.communicateWith"
+ },
+ "index": 4,
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.host.SecondHostClass0.inst4"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ReferenceEntry",
+ "INSTANCE": {
+ "target": {
+ "identifier": "simple.cps.host.FirstHostClass0.inst0"
+ },
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#HostType.instances"
+ },
+ "index": 0,
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.host.FirstHostClass0"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ElementEntry",
+ "INSTANCE": {
+ "type": {
+ "identifier": "http://org.eclipse.viatra/model/cps#HostInstance"
+ },
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.host.FirstHostClass0.inst0"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ReferenceEntry",
+ "INSTANCE": {
+ "target": {
+ "identifier": "simple.cps.host.SecondHostClass0.inst0"
+ },
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#ApplicationInstance.allocatedTo"
+ },
+ "direction": "ADD",
+ "context": {
+ "identifier": "simple.cps.app.FirstAppClass0.inst0"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ReferenceEntry",
+ "INSTANCE": {
+ "target": {
+ "identifier": "simple.cps.app.FirstAppClass0.inst0"
+ },
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#HostInstance.applications"
+ },
+ "index": 0,
+ "direction": "ADD",
+ "context": {
+ "identifier": "simple.cps.host.SecondHostClass0.inst0"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.AttributeEntry",
+ "INSTANCE": {
+ "value": "Stopped",
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#ApplicationInstance.state"
+ },
+ "direction": "ADD",
+ "context": {
+ "identifier": "simple.cps.app.FirstAppClass0.inst0"
+ }
+ }
+ }
+ ]
+} \ No newline at end of file
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples.cps/validation-jackson.modelpatch b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/validation-jackson.modelpatch
new file mode 100644
index 0000000..d8a691c
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/validation-jackson.modelpatch
@@ -0,0 +1,55 @@
+{
+ "ModelPatch" : {
+ "Entries" : [ {
+ "AttributeEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.app.SecondAppClass0.sm0.s0.t2"
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#Transition.action"
+ },
+ "Index" : null,
+ "Value" : "waitForSignal(7)"
+ }
+ }, {
+ "ReferenceEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.app.SecondAppClass0.sm0.s0.t2"
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#Transition.targetState"
+ },
+ "Index" : null,
+ "Target" : {
+ "Identifier" : "simple.cps.app.SecondAppClass0.sm0.s1"
+ }
+ }
+ }, {
+ "ReferenceEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.app.SecondAppClass0.sm0.s0"
+ },
+ "Feature" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#State.outgoingTransitions"
+ },
+ "Index" : 1,
+ "Target" : {
+ "Identifier" : "simple.cps.app.SecondAppClass0.sm0.s0.t2"
+ }
+ }
+ }, {
+ "ElementEntry" : {
+ "ChangeType" : "REMOVE",
+ "Context" : {
+ "Identifier" : "simple.cps.app.SecondAppClass0.sm0.s0.t2"
+ },
+ "ElementType" : {
+ "Identifier" : "http://org.eclipse.viatra/model/cps#Transition"
+ }
+ }
+ } ]
+ }
+} \ No newline at end of file
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples.cps/validation.modelpatch b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/validation.modelpatch
new file mode 100644
index 0000000..7887e8e
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples.cps/validation.modelpatch
@@ -0,0 +1,66 @@
+{
+ "metadata": {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.api.BaseModelPatchMetadata",
+ "INSTANCE": {
+ "createdAt": "Wed Jan 25 10:31:54 CET 2017"
+ }
+ },
+ "entries": [
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.AttributeEntry",
+ "INSTANCE": {
+ "value": "waitForSignal(7)",
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#Transition.action"
+ },
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.app.SecondAppClass0.sm0.s0.t2"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ReferenceEntry",
+ "INSTANCE": {
+ "target": {
+ "identifier": "simple.cps.app.SecondAppClass0.sm0.s1"
+ },
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#Transition.targetState"
+ },
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.app.SecondAppClass0.sm0.s0.t2"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ReferenceEntry",
+ "INSTANCE": {
+ "target": {
+ "identifier": "simple.cps.app.SecondAppClass0.sm0.s0.t2"
+ },
+ "feature": {
+ "identifier": "http://org.eclipse.viatra/model/cps#State.outgoingTransitions"
+ },
+ "index": 1,
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.app.SecondAppClass0.sm0.s0"
+ }
+ }
+ },
+ {
+ "CLASSNAME": "org.eclipse.emf.diffmerge.patch.ElementEntry",
+ "INSTANCE": {
+ "type": {
+ "identifier": "http://org.eclipse.viatra/model/cps#Transition"
+ },
+ "direction": "REMOVE",
+ "context": {
+ "identifier": "simple.cps.app.SecondAppClass0.sm0.s0.t2"
+ }
+ }
+ }
+ ]
+} \ No newline at end of file
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/.classpath b/examples/org.eclipse.emf.diffmerge.patch.examples/.classpath
new file mode 100644
index 0000000..2f1a48a
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/.classpath
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/.project b/examples/org.eclipse.emf.diffmerge.patch.examples/.project
new file mode 100644
index 0000000..e3fc55a
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.patch.examples</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/.settings/org.eclipse.core.resources.prefs b/examples/org.eclipse.emf.diffmerge.patch.examples/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/.settings/org.eclipse.core.runtime.prefs b/examples/org.eclipse.emf.diffmerge.patch.examples/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.emf.diffmerge.patch.examples/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..f42de36
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/META-INF/MANIFEST.MF b/examples/org.eclipse.emf.diffmerge.patch.examples/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..69d9ff3
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.diffmerge.patch.examples;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.emf.common.ui;bundle-version="2.10.0"
+Bundle-Vendor: %providerName
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/about.html b/examples/org.eclipse.emf.diffmerge.patch.examples/about.html
new file mode 100644
index 0000000..d8e1984
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/about.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/build.properties b/examples/org.eclipse.emf.diffmerge.patch.examples/build.properties
new file mode 100644
index 0000000..49e6d48
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/build.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2016-2017 Thales Global Services S.A.S.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Abel Hegedus, Tamas Borbas, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+###############################################################################
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ contents/,\
+ icons/,\
+ about.html
+src.includes = about.html
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/contents/.gitignore b/examples/org.eclipse.emf.diffmerge.patch.examples/contents/.gitignore
new file mode 100644
index 0000000..f9be8df
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/contents/.gitignore
@@ -0,0 +1 @@
+!*
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/contents/org.eclipse.emf.diffmerge.patch.examples.cps.zip b/examples/org.eclipse.emf.diffmerge.patch.examples/contents/org.eclipse.emf.diffmerge.patch.examples.cps.zip
new file mode 100644
index 0000000..395968f
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/contents/org.eclipse.emf.diffmerge.patch.examples.cps.zip
Binary files differ
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/icons/genproject.gif b/examples/org.eclipse.emf.diffmerge.patch.examples/icons/genproject.gif
new file mode 100644
index 0000000..3e8e1c2
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/icons/genproject.gif
Binary files differ
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/plugin.properties b/examples/org.eclipse.emf.diffmerge.patch.examples/plugin.properties
new file mode 100644
index 0000000..adbfe70
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/plugin.properties
@@ -0,0 +1,9 @@
+###############################################################################
+# Copyright (c) 2016-2017 Thales Global Services S.A.S.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+pluginName = Model Patch Examples Plug-In (Incubation)
+providerName = Eclipse Modeling Project
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/plugin.xml b/examples/org.eclipse.emf.diffmerge.patch.examples/plugin.xml
new file mode 100644
index 0000000..cb0bcc8
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/plugin.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+
+<plugin>
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
+ id="org.eclipse.emf.diffmerge.patch.ui.examples"
+ name="Modelpatch examples"
+ parentCategory="org.eclipse.ui.Examples">
+ </category>
+ </extension>
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <wizard
+ category="org.eclipse.ui.Examples/org.eclipse.emf.diffmerge.patch.ui.examples"
+ class="org.eclipse.emf.common.ui.wizard.ExampleInstallerWizard"
+ icon="icons/genproject.gif"
+ id="org.eclipse.emf.diffmerge.patch.examples.CPSExample"
+ name="CPS Example"
+ project="true">
+ </wizard>
+ </extension>
+ <extension
+ point="org.eclipse.emf.common.ui.examples">
+ <example
+ pageImage="icons/genproject.gif"
+ wizardID="org.eclipse.emf.diffmerge.patch.examples.CPSExample">
+ <projectDescriptor
+ contentURI="contents/org.eclipse.emf.diffmerge.patch.examples.cps.zip"
+ name="org.eclipse.emf.diffmerge.patch.examples.cps">
+ </projectDescriptor>
+ </example>
+ </extension>
+
+</plugin>
diff --git a/examples/org.eclipse.emf.diffmerge.patch.examples/pom.xml b/examples/org.eclipse.emf.diffmerge.patch.examples/pom.xml
new file mode 100644
index 0000000..94169dd
--- /dev/null
+++ b/examples/org.eclipse.emf.diffmerge.patch.examples/pom.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.examples.parent</artifactId>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.examples</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <version>0.1.0-SNAPSHOT</version>
+ <properties>
+ <rootPath>${basedir}/../</rootPath>
+ </properties>
+</project>
diff --git a/examples/pom.xml b/examples/pom.xml
new file mode 100644
index 0000000..97a94fe
--- /dev/null
+++ b/examples/pom.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.parent</artifactId>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ <relativePath>../releng/org.eclipse.emf.diffmerge.patch.parent</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <artifactId>org.eclipse.emf.diffmerge.patch.examples.parent</artifactId>
+ <name>Model Patcher Examples</name>
+ <version>0.1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>org.eclipse.emf.diffmerge.patch.examples</module>
+ </modules>
+
+</project> \ No newline at end of file
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/.project b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/.project
new file mode 100644
index 0000000..8e0440e
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.patch.feature.dependencies</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/.settings/org.eclipse.core.resources.prefs b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/.settings/org.eclipse.core.runtime.prefs b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/build.properties b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/build.properties
new file mode 100644
index 0000000..79c21b1
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/build.properties
@@ -0,0 +1,13 @@
+###############################################################################
+# Copyright (c) 2016-2017 Thales Global Services S.A.S.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Abel Hegedus, Tamas Borbas, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+###############################################################################
+bin.includes = feature.xml,\
+ epl-v10.html,\
+ license.html
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/epl-v10.html b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/epl-v10.html
new file mode 100644
index 0000000..ed4b196
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/epl-v10.html
@@ -0,0 +1,328 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 9">
+<meta name=Originator content="Microsoft Word 9">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor (&quot;Commercial
+Contributor&quot;) hereby agrees to defend and indemnify every other
+Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
+costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
+
+</div>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/feature.xml b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/feature.xml
new file mode 100644
index 0000000..ab206c1
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/feature.xml
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+<feature
+ id="org.eclipse.emf.diffmerge.patch.feature.dependencies"
+ label="Model Patch Feature Dependencies"
+ version="0.1.0.qualifier"
+ provider-name="Eclipse Modeling Project"
+ license-feature="org.eclipse.license"
+ license-feature-version="0.0.0">
+
+ <description>
+ EMF Diff/Merge Model Patch dependencies feature (only used for RCPTT product)
+ </description>
+
+ <copyright url="http://www.eclipse.org/legal/epl-v10.html">
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+ <includes
+ id="org.eclipse.emf"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.emf.ecore"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.emf.ecore.edit"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.emf.edit"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.gmf"
+ version="0.0.0"/>
+
+ <requires>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.viatra.examples.cps.model" version="0.1.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.viatra.examples.cps.deployment" version="0.1.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.xtext.xbase.lib" version="2.9.0" match="compatible"/>
+ <import plugin="org.eclipse.xtend.lib.macro" version="2.9.0" match="compatible"/>
+ <import plugin="org.eclipse.emf.common" version="2.11.0" match="compatible"/>
+ <import plugin="org.eclipse.emf.ecore" version="2.11.0" match="compatible"/>
+ <import plugin="org.eclipse.emf.edit" version="2.11.0" match="compatible"/>
+ <import plugin="org.eclipse.compare"/>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.emf.ecore.xmi"/>
+ <import plugin="org.eclipse.emf.edit.ui"/>
+ <import plugin="org.eclipse.emf.workspace"/>
+ <import plugin="org.eclipse.ui.workbench"/>
+ <import plugin="org.eclipse.jface"/>
+ <import plugin="org.eclipse.core.runtime" version="3.5.0" match="compatible"/>
+ <import plugin="org.eclipse.emf.ecore" version="2.5.0" match="compatible"/>
+ <import plugin="com.google.guava" version="10.0.1"/>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.ui.ide"/>
+ </requires>
+
+ <plugin
+ id="com.google.guava"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.viatra.examples.cps.model"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.xtend.lib"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.emf.ecore"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.swt"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.emf.edit"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.emf.ecore.edit"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.emf.diffmerge.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.gmf.runtime.notation"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.gmf"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.xtend.lib.macro"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.xtext.xbase.lib"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.viatra.examples.cps.model.edit"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.viatra.examples.cps.model.editor"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.concurrent"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="com.google.gson"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.apache.log4j"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.emf.diffmerge"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.viatra.transformation.runtime.emf"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/license.html b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/license.html
new file mode 100644
index 0000000..f19c483
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/license.html
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>February 1, 2011</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/pom.xml b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/pom.xml
new file mode 100644
index 0000000..ea92dd5
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature.dependencies/pom.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.features</artifactId>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.feature.dependencies</artifactId>
+ <packaging>eclipse-feature</packaging>
+ <version>0.1.0-SNAPSHOT</version>
+ <properties>
+ <rootPath>${basedir}/../</rootPath>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-repository-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <includeAllDependencies>true</includeAllDependencies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature/.project b/features/org.eclipse.emf.diffmerge.patch.feature/.project
new file mode 100644
index 0000000..0c535cf
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.patch.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature/.settings/org.eclipse.core.resources.prefs b/features/org.eclipse.emf.diffmerge.patch.feature/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature/.settings/org.eclipse.core.runtime.prefs b/features/org.eclipse.emf.diffmerge.patch.feature/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature/build.properties b/features/org.eclipse.emf.diffmerge.patch.feature/build.properties
new file mode 100644
index 0000000..6bdfa57
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature/build.properties
@@ -0,0 +1,13 @@
+###############################################################################
+# Copyright (c) 2016-2017 Thales Global Services S.A.S.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Abel Hegedus, Tamas Borbas, Balazs Grill, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+###############################################################################
+bin.includes = feature.xml,\
+ epl-v10.html,\
+ license.html
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature/epl-v10.html b/features/org.eclipse.emf.diffmerge.patch.feature/epl-v10.html
new file mode 100644
index 0000000..ed4b196
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature/epl-v10.html
@@ -0,0 +1,328 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 9">
+<meta name=Originator content="Microsoft Word 9">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor (&quot;Commercial
+Contributor&quot;) hereby agrees to defend and indemnify every other
+Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
+costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
+
+</div>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature/feature.xml b/features/org.eclipse.emf.diffmerge.patch.feature/feature.xml
new file mode 100644
index 0000000..563b9d2
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature/feature.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Balazs Grill, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+<feature
+ id="org.eclipse.emf.diffmerge.patch.feature"
+ label="Model Patch Feature"
+ version="0.1.0.qualifier"
+ provider-name="Eclipse Modeling Project"
+ license-feature="org.eclipse.license"
+ license-feature-version="0.0.0">
+
+ <description>
+ EMF Diff/Merge Model Patch feature
+ </description>
+
+ <copyright url="http://www.eclipse.org/legal/epl-v10.html">
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+ <requires>
+ <import plugin="com.google.guava" version="15.0.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.xtend.lib"/>
+ <import plugin="com.google.gson" version="2.2.4" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.emf.ecore" version="2.10.2" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.emf.diffmerge" version="0.5.1" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.emf.ecore.change" version="2.11.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.viatra.query.runtime.base" version="1.2.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.viatra.query.runtime" version="1.2.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.emf.edit" version="2.11.1" match="greaterOrEqual"/>
+ <import plugin="org.apache.log4j" version="1.2.15" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.emf.common.ui" version="2.10.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.emf.common" version="2.11.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.core.databinding.observable"/>
+ <import plugin="org.eclipse.ui.ide" version="3.11.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.swt"/>
+ <import plugin="org.eclipse.jface"/>
+ <import plugin="org.eclipse.core.databinding"/>
+ <import plugin="org.eclipse.core.databinding.beans"/>
+ <import plugin="org.eclipse.core.databinding.property"/>
+ <import plugin="org.eclipse.jface.databinding"/>
+ <import plugin="com.ibm.icu"/>
+ <import plugin="org.eclipse.emf.diffmerge.ui" version="0.5.1" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.viatra.transformation.runtime.emf"/>
+ <import plugin="org.eclipse.emf" version="2.10"/>
+ <import plugin="org.eclipse.viatra.query.runtime.base.itc"/>
+ <import plugin="org.eclipse.viatra.query.runtime.rete"/>
+ <import plugin="org.eclipse.viatra.query.runtime.rete.recipes"/>
+ <import plugin="org.eclipse.viatra.query.runtime.matchers"/>
+ <import plugin="org.eclipse.viatra.transformation.evm"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.emf.diffmerge.patch"
+ download-size="0"
+ install-size="0"
+ version="0.1.0.qualifier"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.emf.diffmerge.patch.runtime"
+ download-size="0"
+ install-size="0"
+ version="0.1.0.qualifier"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.emf.diffmerge.patch.examples"
+ download-size="0"
+ install-size="0"
+ version="0.1.0.qualifier"/>
+
+ <plugin
+ id="org.eclipse.emf.diffmerge.patch.ui"
+ download-size="0"
+ install-size="0"
+ version="0.1.0.qualifier"
+ unpack="false"/>
+
+</feature>
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature/license.html b/features/org.eclipse.emf.diffmerge.patch.feature/license.html
new file mode 100644
index 0000000..f19c483
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature/license.html
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>February 1, 2011</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>
diff --git a/features/org.eclipse.emf.diffmerge.patch.feature/pom.xml b/features/org.eclipse.emf.diffmerge.patch.feature/pom.xml
new file mode 100644
index 0000000..464009d
--- /dev/null
+++ b/features/org.eclipse.emf.diffmerge.patch.feature/pom.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Balazs Grill, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.features</artifactId>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.feature</artifactId>
+ <packaging>eclipse-feature</packaging>
+ <version>0.1.0-SNAPSHOT</version>
+ <properties>
+ <rootPath>${basedir}/../</rootPath>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-repository-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <includeAllDependencies>true</includeAllDependencies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/features/pom.xml b/features/pom.xml
new file mode 100644
index 0000000..f740f74
--- /dev/null
+++ b/features/pom.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.parent</artifactId>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ <relativePath>../releng/org.eclipse.emf.diffmerge.patch.parent</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <artifactId>org.eclipse.emf.diffmerge.patch.features</artifactId>
+ <name>Model Patcher Features</name>
+ <version>0.1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>org.eclipse.emf.diffmerge.patch.feature</module>
+ </modules>
+
+ <profiles>
+ <profile>
+ <id>gui.test</id>
+ <modules>
+ <!-- GUI tests -->
+ <module>org.eclipse.emf.diffmerge.patch.feature.dependencies</module>
+ </modules>
+ </profile>
+ </profiles>
+
+</project> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.classpath b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.classpath
new file mode 100644
index 0000000..098194c
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.project b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.project
new file mode 100644
index 0000000..2bc01da
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.patch.persistence.json</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.settings/org.eclipse.core.runtime.prefs b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..f42de36
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..f95ed82
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.diffmerge.patch.persistence.json;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Bundle-Vendor: %providerName
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: com.google.gson;bundle-version="2.2.4",
+ org.eclipse.emf.diffmerge.patch;bundle-version="[0.1.0,0.2.0)",
+ com.google.guava;bundle-version="15.0.0"
+Export-Package: org.eclipse.emf.diffmerge.patch.serializer.gson
+Bundle-ClassPath: .
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/about.html b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/about.html
new file mode 100644
index 0000000..d8e1984
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/about.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/build.properties b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/build.properties
new file mode 100644
index 0000000..8babb8d
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/build.properties
@@ -0,0 +1,16 @@
+###############################################################################
+# Copyright (c) 2016-2017 Thales Global Services S.A.S.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html
+src.includes = about.html
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/plugin.properties b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/plugin.properties
new file mode 100644
index 0000000..f73f543
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/plugin.properties
@@ -0,0 +1,9 @@
+###############################################################################
+# Copyright (c) 2016-2017 Thales Global Services S.A.S.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+pluginName = Model Patch JSON Persistence Plug-In (Incubation)
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/pom.xml b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/pom.xml
new file mode 100644
index 0000000..47b5f8b
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/pom.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.plugins</artifactId>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.persistence.json</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <version>0.1.0-SNAPSHOT</version>
+ <properties>
+ <rootPath>${basedir}/../</rootPath>
+ </properties>
+</project>
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/src/org/eclipse/emf/diffmerge/patch/serializer/gson/GsonModelPatchSerializer.java b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/src/org/eclipse/emf/diffmerge/patch/serializer/gson/GsonModelPatchSerializer.java
new file mode 100644
index 0000000..a739a2f
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/src/org/eclipse/emf/diffmerge/patch/serializer/gson/GsonModelPatchSerializer.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.serializer.gson;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+
+import org.eclipse.emf.diffmerge.patch.api.ModelPatch;
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry;
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchException;
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchMetadata;
+import org.eclipse.emf.diffmerge.patch.serializer.IModelPatchSerializer;
+import org.eclipse.emf.diffmerge.patch.serializer.gson.typeadapters.AbstractSubclassAdapter;
+
+import com.google.common.base.Charsets;
+import com.google.common.io.CharStreams;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+public class GsonModelPatchSerializer implements IModelPatchSerializer{
+
+ public static GsonModelPatchSerializer create(ClassLoader classLoader) {
+ GsonModelPatchSerializer gsonModelPatchSerializer = new GsonModelPatchSerializer();
+ gsonModelPatchSerializer.classLoader = classLoader;
+ return gsonModelPatchSerializer;
+ }
+
+ private ClassLoader classLoader = GsonModelPatchSerializer.class.getClassLoader();
+
+ @Override
+ public void serialize(ModelPatch modelPatch, File file) throws ModelPatchException {
+ file.getParentFile().mkdirs();
+ try {
+ FileWriter writer = new FileWriter(file);
+ createGson().toJson(modelPatch, writer);
+ writer.flush();
+ writer.close();
+ } catch (IOException e) {
+ throw new ModelPatchException("IO exception caught during GSON serialization", e);
+ }
+
+ }
+
+ @Override
+ public String serialize(ModelPatch modelPatch) throws ModelPatchException {
+ return createGson().toJson(modelPatch);
+ }
+
+ @Override
+ public InputStream serializeStream(ModelPatch modelPatch) throws ModelPatchException {
+ return new ByteArrayInputStream(createGson().toJson(modelPatch).getBytes(StandardCharsets.UTF_8));
+ }
+
+ @Override
+ public ModelPatch load(File file) throws ModelPatchException {
+ try {
+ FileReader reader = new FileReader(file);
+ ModelPatch patch = createGson().fromJson(reader, ModelPatch.class);
+ if(patch.getEntries().isEmpty()){
+ throw new ModelPatchException("Loaded GSON patch is empty, it probably has incorrect JSON syntax");
+ }
+ reader.close();
+ return patch;
+ } catch (IOException e) {
+ throw new ModelPatchException("GSON deserialization failed, check if source file has the correct JSON syntax", e);
+ }
+ }
+
+ @Override
+ public ModelPatch load(String jsonSource) throws ModelPatchException {
+ return createGson().fromJson(jsonSource, ModelPatch.class);
+ }
+
+ @Override
+ public ModelPatch load(InputStream jsonStream) throws ModelPatchException {
+ String content = "";
+ try {
+ content = CharStreams.toString(new InputStreamReader(jsonStream, Charsets.UTF_8));
+ } catch (IOException e) {
+ throw new ModelPatchException("GSON deserialization failed, check if source has the correct JSON syntax", e);
+ }
+ return createGson().fromJson(content, ModelPatch.class);
+ }
+
+ private Gson createGson(){
+ return new GsonBuilder()
+ .registerTypeAdapter(ModelPatchEntry.class, new AbstractSubclassAdapter<ModelPatchEntry>(classLoader))
+ .registerTypeAdapter(ModelPatchMetadata.class, new AbstractSubclassAdapter<ModelPatchMetadata>(classLoader))
+ .setPrettyPrinting()
+ .create();
+ }
+
+
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/src/org/eclipse/emf/diffmerge/patch/serializer/gson/typeadapters/AbstractSubclassAdapter.java b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/src/org/eclipse/emf/diffmerge/patch/serializer/gson/typeadapters/AbstractSubclassAdapter.java
new file mode 100644
index 0000000..35c23dc
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.persistence.json/src/org/eclipse/emf/diffmerge/patch/serializer/gson/typeadapters/AbstractSubclassAdapter.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.serializer.gson.typeadapters;
+
+import java.lang.reflect.Type;
+
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParseException;
+import com.google.gson.JsonPrimitive;
+import com.google.gson.JsonSerializationContext;
+import com.google.gson.JsonSerializer;
+
+public class AbstractSubclassAdapter<T> implements JsonSerializer<T>, JsonDeserializer<T> {
+
+ private static final String CLASSNAME = "CLASSNAME";
+ private static final String INSTANCE = "INSTANCE";
+ private ClassLoader classLoader;
+
+ public AbstractSubclassAdapter(ClassLoader classLoader) {
+ this.classLoader = classLoader;
+ }
+
+ @Override
+ public JsonElement serialize(T src, Type typeOfSrc, JsonSerializationContext context) {
+
+ JsonObject retValue = new JsonObject();
+ String className = src.getClass().getName();
+ retValue.addProperty(CLASSNAME, className);
+ JsonElement elem = context.serialize(src);
+ retValue.add(INSTANCE, elem);
+ return retValue;
+ }
+
+ @Override
+ public T deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ throws JsonParseException {
+ JsonObject jsonObject = json.getAsJsonObject();
+ JsonPrimitive prim = (JsonPrimitive) jsonObject.get(CLASSNAME);
+ String className = prim.getAsString();
+
+ Class<?> klass = null;
+ try {
+ klass = classLoader.loadClass(className);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ throw new JsonParseException(e.getMessage());
+ }
+ return context.deserialize(jsonObject.get(INSTANCE), klass);
+ }
+
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/.classpath b/plugins/org.eclipse.emf.diffmerge.patch.runtime/.classpath
new file mode 100644
index 0000000..e850b35
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="xtend-gen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/.project b/plugins/org.eclipse.emf.diffmerge.patch.runtime/.project
new file mode 100644
index 0000000..5aaa417
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.patch.runtime</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.emf.diffmerge.patch.runtime/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/.settings/org.eclipse.core.runtime.prefs b/plugins/org.eclipse.emf.diffmerge.patch.runtime/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.diffmerge.patch.runtime/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..f42de36
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.diffmerge.patch.runtime/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..6db8dbb
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/META-INF/MANIFEST.MF
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.diffmerge.patch.runtime
+Bundle-Version: 0.1.0.qualifier
+Bundle-Vendor: %providerName
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.eclipse.emf.diffmerge.patch;bundle-version="[0.1.0,0.2.0)",
+ org.eclipse.emf.ecore;bundle-version="2.10.2",
+ com.google.guava;bundle-version="15.0.0",
+ org.eclipse.xtend.lib,
+ org.eclipse.emf.diffmerge;bundle-version="[0.7.0,0.8.0)",
+ org.eclipse.emf.ecore.change;bundle-version="2.11.0",
+ org.eclipse.emf.edit;bundle-version="2.11.1",
+ org.eclipse.viatra.transformation.runtime.emf;bundle-version="[1.4.0,2.0.0)",
+ org.eclipse.viatra.query.runtime;bundle-version="[1.4.0,2.0.0)",
+ org.eclipse.viatra.query.runtime.base;bundle-version="[1.4.0,2.0.0)"
+Export-Package: org.eclipse.emf.diffmerge.patch.runtime,
+ org.eclipse.emf.diffmerge.patch.runtime.identifier,
+ org.eclipse.emf.diffmerge.patch.runtime.modelaccess
+Import-Package: org.apache.log4j;version="1.2.15"
+
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/about.html b/plugins/org.eclipse.emf.diffmerge.patch.runtime/about.html
new file mode 100644
index 0000000..d8e1984
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/about.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/build.properties b/plugins/org.eclipse.emf.diffmerge.patch.runtime/build.properties
new file mode 100644
index 0000000..6b228af
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/build.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2016-2017 Thales Global Services S.A.S.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+###############################################################################
+source.. = src/,\
+ xtend-gen/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html
+src.includes = about.html
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/plugin.properties b/plugins/org.eclipse.emf.diffmerge.patch.runtime/plugin.properties
new file mode 100644
index 0000000..8d7c1ca
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/plugin.properties
@@ -0,0 +1,9 @@
+###############################################################################
+# Copyright (c) 2016-2017 Thales Global Services S.A.S.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+pluginName = Model Patch Runtime Plug-In (Incubation)
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/pom.xml b/plugins/org.eclipse.emf.diffmerge.patch.runtime/pom.xml
new file mode 100644
index 0000000..d02ab8d
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/pom.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.plugins</artifactId>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.runtime</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <version>0.1.0-SNAPSHOT</version>
+ <properties>
+ <rootPath>${basedir}/../</rootPath>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>xtend-gen</directory>
+ <excludes>
+ <exclude>.gitignore</exclude>
+ </excludes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.xtend</groupId>
+ <artifactId>xtend-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/EMFModelPatchApplier.xtend b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/EMFModelPatchApplier.xtend
new file mode 100644
index 0000000..152e96e
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/EMFModelPatchApplier.xtend
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime
+
+import com.google.common.base.Preconditions
+import org.eclipse.emf.diffmerge.patch.api.ModelPatch
+import org.eclipse.emf.diffmerge.patch.api.PatchApplication
+import org.eclipse.emf.diffmerge.patch.runtime.identifier.IdentifiedEMFObjectLocator
+import org.eclipse.emf.diffmerge.patch.runtime.modelaccess.EMFModelAccess
+import org.eclipse.emf.ecore.resource.ResourceSet
+import org.eclipse.xtend.lib.annotations.Accessors
+
+class EMFModelPatchApplier {
+ EMFModelAccess modelAccess
+ @Accessors
+ IdentifiedEMFObjectLocator locator
+
+ new(EMFModelAccess modelAccess) {
+ this.modelAccess=modelAccess
+ this.locator = new IdentifiedEMFObjectLocator()
+ }
+
+ def PatchApplication apply(ModelPatch modelPatch, ResourceSet input) {
+ Preconditions.checkNotNull(input, "Input cannot be null")
+ val patchApplication = new EMFPatchApplication(modelPatch, modelAccess, input)
+ patchApplication.locator = locator
+ patchApplication.apply()
+
+ return patchApplication
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/EMFModelPatchMetadata.xtend b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/EMFModelPatchMetadata.xtend
new file mode 100644
index 0000000..3fed911
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/EMFModelPatchMetadata.xtend
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime
+
+import java.util.List
+import org.eclipse.xtend.lib.annotations.Accessors
+import org.eclipse.emf.diffmerge.patch.api.BaseModelPatchMetadata
+
+class EMFModelPatchMetadata extends BaseModelPatchMetadata {
+
+ @Accessors
+ private List<String> modelUriList = newArrayList
+
+ @Accessors
+ private List<String> usedNamespaceUris = newArrayList
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/EMFPatchApplication.xtend b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/EMFPatchApplication.xtend
new file mode 100644
index 0000000..61af8fb
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/EMFPatchApplication.xtend
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime
+
+import com.google.common.base.Optional
+import com.google.common.base.Preconditions
+import com.google.common.collect.HashMultimap
+import com.google.common.collect.Multimap
+import java.util.List
+import java.util.Map
+import org.eclipse.emf.diffmerge.patch.AttributeEntry
+import org.eclipse.emf.diffmerge.patch.ElementEntry
+import org.eclipse.emf.diffmerge.patch.ReferenceEntry
+import org.eclipse.emf.diffmerge.patch.api.ChangeDirection
+import org.eclipse.emf.diffmerge.patch.api.ModelPatch
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchDiagnosticElement
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry
+import org.eclipse.emf.diffmerge.patch.api.PatchApplication
+import org.eclipse.emf.diffmerge.patch.api.PatchApplicationDiagnostic
+import org.eclipse.emf.diffmerge.patch.runtime.identifier.IdentifiedEMFObjectLocator
+import org.eclipse.emf.diffmerge.patch.runtime.modelaccess.EMFModelAccess
+import org.eclipse.emf.ecore.EAttribute
+import org.eclipse.emf.ecore.EClassifier
+import org.eclipse.emf.ecore.EObject
+import org.eclipse.emf.ecore.EReference
+import org.eclipse.emf.ecore.EStructuralFeature
+import org.eclipse.emf.ecore.resource.ResourceSet
+import org.eclipse.emf.ecore.util.EcoreUtil
+import org.eclipse.xtend.lib.annotations.Accessors
+import org.eclipse.xtend.lib.annotations.Data
+
+public class EMFPatchApplication implements PatchApplication {
+ @Accessors(PUBLIC_GETTER)
+ val EMFModelAccess modelAccess
+ @Accessors(PUBLIC_GETTER)
+ val ResourceSet input
+ @Accessors(PUBLIC_GETTER,PROTECTED_SETTER)
+ IdentifiedEMFObjectLocator locator
+ val ModelPatch modelPatch
+ val PatchApplicationDiagnostic diagnostics
+ val Map<String, EObject> storage
+ val Multimap<FeatureHolder, EObject> addedOpposites = HashMultimap.create
+ val Multimap<FeatureHolder, EObject> removedOpposites = HashMultimap.create
+
+ protected new(ModelPatch modelPatch, EMFModelAccess modelAccess, ResourceSet input) {
+ Preconditions.checkNotNull(modelPatch, "Model patch cannot be null")
+ Preconditions.checkNotNull(modelAccess, "Model access cannot be null")
+ Preconditions.checkNotNull(input, "Input cannot be null")
+
+ this.modelPatch = modelPatch
+ this.modelAccess = modelAccess
+ this.input = input
+ this.diagnostics = new PatchApplicationDiagnostic
+ this.storage = newHashMap
+ this.locator = new IdentifiedEMFObjectLocator()
+ }
+
+ protected def void apply() {
+ val List<ModelPatchEntry> entries = modelPatch.entries
+ for (ModelPatchEntry entry : entries) {
+ try {
+ val contextId = entry.context.identifier
+
+ switch (entry.entryType) {
+ case ELEMENT: applyElementEntry(contextId, entry)
+ case REFERENCE: applyReferenceEntry(contextId, entry)
+ case ATTRIBUTE: applyAttributeEntry(contextId, entry)
+ }
+ } catch (Exception ex) {
+ val diagnosticElement = new ModelPatchDiagnosticElement()
+ diagnosticElement.setCaughtException(ex)
+ diagnosticElement.setProblematicEntry(entry)
+ diagnosticElement.setMessage(ex.message)
+ diagnostics.addElement(diagnosticElement)
+ }
+ }
+ }
+
+ def private void applyElementEntry(String elementId, ModelPatchEntry entry) {
+ val elementEntry = (entry as ElementEntry)
+ val typeId = elementEntry.type.identifier
+ val locatedType = locator.locateEClassifier(typeId)
+ if (entry.direction == ChangeDirection.ADD) {
+ // create object and put into storage
+ if(!locatedType.present){
+ throw new IllegalStateException('''Could not find EClassifier''')
+ }
+ val type = locatedType.get
+ val existingId = findEObjectById(elementId)
+ if(existingId.present){
+ throw new IllegalStateException('''Cannot create element with existing id''')
+ }
+ val createdElement = createElement(elementId, type)
+ storage.put(elementId, createdElement)
+ } else {
+ // locate element and remove from model
+ val element = findEObjectById(elementId)
+ if (element.isPresent()) {
+ modelAccess.remove(element.get())
+ }
+ // if the element is not in the model, delete it from the storage
+ val eObject = storage.remove(elementId)
+ if (eObject == null) {
+ throw new IllegalStateException('''Could not find element in storage''')
+ }
+ }
+ }
+
+ def private void applyReferenceEntry(String contextId, ModelPatchEntry entry) {
+ // Find the requested element
+ val locatedContext = findEObjectById(contextId)
+ val referenceEntry = (entry as ReferenceEntry)
+ // Find the reference
+ val featureId = referenceEntry.feature.identifier
+ val locatedEStructuralFeature = locator.locateEStructuralFeature(featureId)
+ // owner = the element with the reference
+ if(!locatedContext.present){
+ throw new IllegalStateException('''Could not find owner object''')
+ }
+ val owner = locatedContext.get
+ // feature = the reference to modify
+ if(!locatedEStructuralFeature.present){
+ throw new IllegalStateException('''Could not find feature''')
+ }
+ val feature = locatedEStructuralFeature.get
+ // The feature should be a reference for a ReferenceEntry
+ if (!(feature instanceof EReference)) {
+ throw new IllegalStateException('''Feature is not a reference''')
+ }
+ val reference = (feature as EReference)
+ val targetId = referenceEntry.target.identifier
+ var target = storage.get(targetId)
+ if (target == null) {
+ val locatedTargetObject = findEObjectById(targetId)
+ target = locatedTargetObject.orNull
+ }
+ if (target == null) {
+ throw new IllegalStateException('''Could not find target object''')
+ }
+ val index = referenceEntry.index
+ if (referenceEntry.direction == ChangeDirection.ADD) {
+ setOrAdd(owner, reference, target, index)
+ } else {
+ unsetOrRemove(owner, reference, target, index)
+ // put removed element to the storage
+ if (reference.isContainment()) {
+ storage.put(targetId, target)
+ }
+ }
+ }
+
+ def private void applyAttributeEntry(String elementId, ModelPatchEntry entry) {
+ val locatedEObject = findEObjectById(elementId)
+ val attributeEntry = (entry as AttributeEntry)
+ val featureId = attributeEntry.feature.identifier
+ val locatedEStructuralFeature = locator.locateEStructuralFeature(featureId)
+ if (!locatedEObject.isPresent()) {
+ throw new IllegalStateException('''Could not find owner object''')
+ }
+ if (!locatedEStructuralFeature.isPresent()) {
+ throw new IllegalStateException('''Could not find feature''')
+ }
+ val owner = locatedEObject.get()
+ val feature = locatedEStructuralFeature.get()
+ var Object value = null
+ if (feature instanceof EAttribute) {
+ val attributeType = ((feature as EAttribute)).getEAttributeType()
+ value = EcoreUtil.createFromString(attributeType, attributeEntry.value)
+ } else {
+ throw new IllegalStateException('''Feature is not an attribute''')
+ }
+ val index = attributeEntry.index
+ if (entry.direction == ChangeDirection.ADD) {
+ setOrAdd(owner, feature, value, index)
+ } else {
+ unsetOrRemove(owner, feature, value, index)
+ }
+ }
+
+ def private EObject createElement(String elementId, EClassifier type) {
+ val eObject = modelAccess.create(type)
+ EcoreUtil.setID(eObject, elementId)
+ return eObject
+ }
+
+ def private void setOrAdd(EObject owner, EStructuralFeature feature, Object value, Optional<Integer> index) {
+ val holder = new FeatureHolder(owner, feature)
+ if (addedOpposites.containsKey(holder)
+ && addedOpposites.get(holder).contains(value)
+ ) {
+ modelAccess.changeIndex(owner, feature, value, index)
+ } else {
+ modelAccess.add(owner, feature, value, index)
+
+ if (feature instanceof EReference) {
+ val opposite = feature.EOpposite
+ if (opposite != null) {
+ val oppositeHolder = new FeatureHolder(value as EObject, opposite)
+ addedOpposites.put(oppositeHolder, owner)
+ }
+ }
+ }
+ }
+
+ def private void unsetOrRemove(EObject owner, EStructuralFeature feature, Object value, Optional<Integer> index) {
+ val holder = new FeatureHolder(owner, feature)
+ if (removedOpposites.containsKey(holder)
+ && removedOpposites.get(holder).contains(value)
+ ) {
+ return
+ } else {
+ modelAccess.remove(owner, feature, value, index)
+ if (feature instanceof EReference) {
+ val opposite = feature.EOpposite
+ if (opposite != null) {
+ val oppositeHolder = new FeatureHolder(value as EObject, opposite)
+ removedOpposites.put(oppositeHolder, owner)
+ }
+ }
+ }
+ }
+
+ def private Optional<EObject> findEObjectById(String identifier) {
+ Preconditions.checkNotNull(identifier, "Identifier cannot be null")
+ var eObject = storage.get(identifier)
+ if (eObject == null) {
+ val locatedEObject = locator.locateEObject(identifier)
+ if (locatedEObject.isPresent()) {
+ return locatedEObject
+ }
+ }
+ return Optional.fromNullable(eObject)
+ }
+
+ override getDiagnostics() {
+ return diagnostics
+ }
+
+ override getModelPatch() {
+ return modelPatch
+ }
+
+}
+
+@Data
+class FeatureHolder {
+ EObject eObject
+ EStructuralFeature feature
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/ModelPatchRecorder.xtend b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/ModelPatchRecorder.xtend
new file mode 100644
index 0000000..2809369
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/ModelPatchRecorder.xtend
@@ -0,0 +1,458 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime
+
+import com.google.common.base.Optional
+import java.util.Collection
+import java.util.Comparator
+import java.util.Set
+import org.eclipse.emf.common.util.EList
+import org.eclipse.emf.diffmerge.api.IComparison
+import org.eclipse.emf.diffmerge.api.Role
+import org.eclipse.emf.diffmerge.api.diff.IDifference
+import org.eclipse.emf.diffmerge.api.diff.IPresenceDifference
+import org.eclipse.emf.diffmerge.diffdata.EAttributeValuePresence
+import org.eclipse.emf.diffmerge.diffdata.EElementPresence
+import org.eclipse.emf.diffmerge.diffdata.EReferenceValuePresence
+import org.eclipse.emf.diffmerge.patch.api.ChangeDirection
+import org.eclipse.emf.diffmerge.patch.api.Identifiable
+import org.eclipse.emf.diffmerge.patch.api.ModelPatch
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchBuilder
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntryBuilder
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchException
+import org.eclipse.emf.diffmerge.patch.runtime.identifier.EMFIdentifierProvider
+import org.eclipse.emf.ecore.EObject
+import org.eclipse.emf.ecore.EReference
+import org.eclipse.emf.ecore.EStructuralFeature
+
+class ModelPatchRecorder {
+ extension EMFIdentifierProvider identifierProvider = new EMFIdentifierProvider
+
+ private ModelPatchBuilder attributeRemoveBuilder
+ private ModelPatchBuilder referenceRemoveBuilder
+ private ModelPatchBuilder containmentRemoveBuilder
+ private ModelPatchBuilder secondContainmentRemoveBuilder
+ private ModelPatchBuilder elementRemoveBuilder
+
+ private ModelPatchBuilder elementAddBuilder
+ private ModelPatchBuilder containmentAddBuilder
+ private ModelPatchBuilder referenceAddBuilder
+ private ModelPatchBuilder attributeAddBuilder
+
+ private ModelPatchBuilder modelPatchBuilder
+
+ private Set<ModelPatchEntry> addedEntries = newHashSet();
+
+ /**
+ * TODO Using dispatch on public API is problematic (method will have Object parameter)
+ */
+ dispatch def ModelPatch generateModelPatch(IComparison comparison) {
+ val differences = (<IDifference>newArrayList => [
+ it += comparison.getDifferences(Role.REFERENCE)
+ it += comparison.getDifferences(Role.TARGET)
+ ])
+ return differences.generateModelPatch
+ }
+
+ dispatch def ModelPatch generateModelPatch(Collection<? extends IDifference> diffs) {
+ val differences = <IDifference>newArrayList(diffs).sortInplace(DiffComparator.INSTANCE)
+ initModelPatchBuilders()
+ differences.forEach[
+ processDifference
+ ]
+
+ val modelPatch = modelPatchBuilder.appendNewEntries(attributeRemoveBuilder)
+ .appendNewEntries(referenceRemoveBuilder)
+ .appendNewEntries(containmentRemoveBuilder)
+ .appendNewEntries(secondContainmentRemoveBuilder)
+ .appendNewEntries(elementRemoveBuilder)
+ .appendNewEntries(elementAddBuilder)
+ .appendNewEntries(containmentAddBuilder)
+ .appendNewEntries(referenceAddBuilder)
+ .appendNewEntries(attributeAddBuilder)
+ .build
+
+ return modelPatch
+ }
+
+ protected def initModelPatchBuilders() {
+ attributeRemoveBuilder = ModelPatchBuilder.create
+ referenceRemoveBuilder = ModelPatchBuilder.create
+ containmentRemoveBuilder = ModelPatchBuilder.create
+ secondContainmentRemoveBuilder = ModelPatchBuilder.create
+ elementRemoveBuilder = ModelPatchBuilder.create
+ elementAddBuilder = ModelPatchBuilder.create
+ containmentAddBuilder = ModelPatchBuilder.create
+ referenceAddBuilder = ModelPatchBuilder.create
+ attributeAddBuilder = ModelPatchBuilder.create
+ modelPatchBuilder = ModelPatchBuilder.create
+ }
+
+ private def void processDifference(IDifference diff) {
+ if(diff instanceof IPresenceDifference) {
+ val mergeDestination = Role.REFERENCE
+ // which model contains the presence
+ val presenceRole = diff.presenceRole
+ val direction = presenceRole.changeDirection
+
+ processDifference(diff, mergeDestination, presenceRole, direction)
+ }
+ }
+
+ private dispatch def void processDifference(IDifference diff, Role mergeDestination, Role presenceRole, ChangeDirection direction) {
+ throw new ModelPatchException('''Unsupported IDifference descendant: «diff.class.name»''')
+ }
+
+ private dispatch def void processDifference(EAttributeValuePresence diff, Role mergeDestination, Role presenceRole, ChangeDirection direction) {
+ val owner = diff.elementMatch.get(mergeDestination)
+ val feature = diff.feature
+ val value = diff.value
+
+ val ownerId = new Identifiable(owner.id)
+ val featureId = new Identifiable(feature.identify)
+ val stringValue = value.toString
+
+ val presenceOwner = diff.elementMatch.get(presenceRole)
+ val index = presenceOwner.indexOf(value, feature)
+
+ val entryBuilder = ModelPatchBuilder.entryBuilder(ownerId, direction) => [
+ it.feature = featureId
+ it.value = stringValue
+ it.index = index
+ ]
+ val attributeEntry = entryBuilder.buildAttributeEntry
+
+ if(direction == ChangeDirection.ADD) {
+ if(!feature.isMany) {
+ val oldValue = owner.eGet(feature)
+ if(oldValue != null){
+ // create REMOVE if it already has value
+ val oldStringValue = oldValue.toString
+ val removeEntry = (entryBuilder => [
+ it.direction = ChangeDirection.REMOVE
+ it.value = oldStringValue
+ ]).buildAttributeEntry
+ attributeRemoveBuilder.addNewEntry(removeEntry)
+ }
+ }
+ attributeAddBuilder.addNewEntry(attributeEntry)
+ } else {
+ attributeRemoveBuilder.addNewEntry(attributeEntry)
+ }
+ }
+
+ private def Optional<Integer> indexOf(EObject presenceOwner, Object value, EStructuralFeature feature) {
+ if(feature.isMany) {
+ val values = presenceOwner.eGet(feature) as EList
+ val index = values.indexOf(value)
+ if(index < 0) {
+ throw new IllegalStateException("The object is not found in the containing list.")
+ } else {
+ return Optional.of(index)
+ }
+ }
+ return Optional.absent
+ }
+
+ private dispatch def void processDifference(EReferenceValuePresence diff, Role mergeDestination, Role presenceRole, ChangeDirection direction) {
+ val owner = diff.elementMatch.get(mergeDestination)
+ val feature = diff.feature as EReference
+ val value = if(diff.valueMatch != null){
+ diff.valueMatch.get(presenceRole)
+ } else {
+ diff.value
+ }
+
+ val ownerId = new Identifiable(owner.id)
+ val featureId = new Identifiable(feature.identify)
+ val targetId = new Identifiable(getId(value))
+
+ val presenceOwner = diff.elementMatch.get(presenceRole)
+ val index = presenceOwner.indexOf(value, feature)
+
+ val entryBuilder = ModelPatchBuilder.entryBuilder(ownerId, direction) => [
+ it.feature = featureId
+ it.target = targetId
+ it.index = index
+ ]
+ val referenceEntry = entryBuilder.buildReferenceEntry
+
+ if(direction == ChangeDirection.ADD) {
+ if(!feature.isMany) {
+ val oldValue = owner.eGet(feature)
+ if(oldValue != null) {
+ if(oldValue instanceof EObject){
+ val oldValueId = new Identifiable(oldValue.id)
+ // create REMOVE if it already has value
+ val removeEntry = (entryBuilder => [
+ it.direction = ChangeDirection.REMOVE
+ it.target = oldValueId
+ ]).buildReferenceEntry
+ if(feature.isContainment) {
+ secondContainmentRemoveBuilder.addNewEntry(removeEntry)
+ } else {
+ referenceRemoveBuilder.addNewEntry(removeEntry)
+ }
+ }
+ }
+ }
+ if(feature.isContainment) {
+ containmentAddBuilder.addNewEntry(referenceEntry)
+ } else {
+ referenceAddBuilder.addNewEntry(referenceEntry)
+ }
+ } else {
+ if(feature.isContainment) {
+ secondContainmentRemoveBuilder.addNewEntry(referenceEntry)
+ } else {
+ referenceRemoveBuilder.addNewEntry(referenceEntry)
+ }
+ }
+ }
+
+ private dispatch def void processDifference(EElementPresence diff, Role mergeDestination, Role presenceRole, ChangeDirection direction) {
+ val element = diff.element
+ var parent = diff.ownerMatch.get(mergeDestination)
+ val ownershipDifference = diff.elementMatch.getOwnershipDifference(presenceRole)
+ val containmentHasPresence = ownershipDifference != null
+ var EReference containmentFeature = null
+ if(ownershipDifference != null){
+ containmentFeature = ownershipDifference.feature
+ } else {
+ // in some cases, there is no ownershipDifference
+ // this happens when only one role is allowed and
+ // the current container feature can be used
+ containmentFeature = element.eContainingFeature as EReference
+ parent = element.eContainer
+ }
+
+ val elementId = new Identifiable(element.id)
+ val typeId = new Identifiable(element.eClass.identify)
+ val parentId = new Identifiable(parent.id)
+ val containmentFeatureId = new Identifiable(containmentFeature.identify)
+
+ val index = element.eContainer.indexOf(element, containmentFeature)
+
+ if(direction == ChangeDirection.ADD){
+ val elementEntry = (ModelPatchBuilder.entryBuilder(elementId, direction) => [it.type = typeId]).buildElementEntry
+ elementAddBuilder.addNewEntry(elementEntry)
+
+ val entryBuilder = ModelPatchBuilder.entryBuilder(parentId, direction) => [
+ it.feature = containmentFeatureId
+ it.target = elementId
+ it.index = index
+ ]
+ val referenceEntry = entryBuilder.buildReferenceEntry
+ if(!containmentFeature.isMany){
+ val oldValue = parent.eGet(containmentFeature)
+ if(oldValue != null && oldValue != element) {
+ if(oldValue instanceof EObject){
+ val oldValueId = new Identifiable(oldValue.id)
+ // create REMOVE if it already has value
+ val removeEntry = (entryBuilder => [
+ it.direction = ChangeDirection.REMOVE
+ it.target = oldValueId
+ ]).buildReferenceEntry
+ containmentRemoveBuilder.addNewEntry(removeEntry)
+ }
+ }
+ }
+ if(!containmentHasPresence) {
+ containmentAddBuilder.addNewEntry(referenceEntry)
+ }
+ entryBuilder => [
+ it.direction = ChangeDirection.ADD
+ it.context = elementId
+ it.index = Optional.absent
+ ]
+ // We need to save the attributes (create add entries)
+ element.saveAllAttribute(attributeAddBuilder, entryBuilder)
+
+ // We need to save the non-containment outward references (create add entries)
+ element.saveAllNonContainmentRef(referenceAddBuilder, entryBuilder)
+
+ } else {
+ val elementAsContextEntryBuilder = ModelPatchBuilder.entryBuilder(elementId, direction)
+ // We need to save the attributes (create remove entries)
+ element.saveAllAttribute(attributeRemoveBuilder, elementAsContextEntryBuilder)
+
+ // We need to save the non-containment outward references (create remove entries)
+ element.saveAllNonContainmentRef(referenceRemoveBuilder, elementAsContextEntryBuilder)
+
+ if(!containmentHasPresence) {
+ // We need to create a new entry to remove the containment
+ val removeableContainmentEntry = (ModelPatchBuilder.entryBuilder(parentId, direction) => [
+ it.feature = containmentFeatureId
+ it.target = elementId
+ it.index = index
+ ]).buildReferenceEntry
+ containmentRemoveBuilder.addNewEntry(removeableContainmentEntry)
+ }
+ val elementRemove = (elementAsContextEntryBuilder => [
+ it.type = typeId
+ ]).buildElementEntry
+ elementRemoveBuilder.addNewEntry(elementRemove)
+ }
+ }
+
+ private def void saveAllAttribute(EObject element, ModelPatchBuilder patchBuilder, ModelPatchEntryBuilder entryBuilder) {
+ for(eAttr : element.eClass.EAllAttributes.filter[!it.isID]) {
+ val value = element.eGet(eAttr)
+ if(value != null && (eAttr.defaultValue == null || eAttr.defaultValue != value)) {
+ val index = element.indexOf(value, eAttr)
+ val addedAttributeEntry = (entryBuilder => [
+ it.feature = new Identifiable(eAttr.identify)
+ it.value = value.toString
+ it.index = index
+ ]).buildAttributeEntry
+ patchBuilder.addNewEntry(addedAttributeEntry)
+ }
+ }
+ }
+ private def void saveAllNonContainmentRef(EObject element, ModelPatchBuilder patchBuilder, ModelPatchEntryBuilder entryBuilder) {
+ for(eRef : element.eClass.EAllReferences.filter[!it.isContainment && !it.derived && it.changeable && (it.EOpposite == null || it.EOpposite.isDerived || !it.EOpposite.isContainment)]) {
+ val value = element.eGet(eRef)
+ if(value != null) {
+ if(value instanceof EObject) {
+ val index = element.indexOf(value, eRef)
+ val removeableReferenceEntry = (entryBuilder => [
+ it.feature = new Identifiable(eRef.identify)
+ it.target = new Identifiable(value.id)
+ it.index = index
+ ]).buildReferenceEntry
+ patchBuilder.addNewEntry(removeableReferenceEntry)
+ } else if(value instanceof EList) {
+ for(v : value) {
+ if(v instanceof EObject) {
+ val index = element.indexOf(v, eRef)
+ val referenceEntry = (entryBuilder => [
+ it.feature = new Identifiable(eRef.identify)
+ it.target = new Identifiable(v.id)
+ it.index = index
+ ]).buildReferenceEntry
+ patchBuilder.addNewEntry(referenceEntry)
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private def addNewEntry(ModelPatchBuilder builder, ModelPatchEntry entry) {
+ if(!addedEntries.contains(entry)){
+ addedEntries.add(entry)
+ return builder.addEntry(entry)
+ }
+ return builder
+ }
+
+ private def appendNewEntries(ModelPatchBuilder target, ModelPatchBuilder source) {
+ target.append(source)
+ return target
+ }
+
+ private def ChangeDirection getChangeDirection(Role scopeDiff) {
+ if(scopeDiff == Role.TARGET){
+ return ChangeDirection.ADD
+ }
+ return ChangeDirection.REMOVE
+ }
+
+ private def String getId(EObject semanticElementDiff) {
+ val eidAttribute = semanticElementDiff.eClass.EIDAttribute
+ if(eidAttribute != null){
+ return semanticElementDiff.eGet(eidAttribute).toString
+ }
+ return "NO_ID"
+ }
+
+ protected static class DiffComparator implements Comparator<IDifference> {
+ public static val ADD_ATTRIBUTE_PRIORITY = 7
+ public static val ADD_REFERENCE_PRIORITY = 6
+ public static val ADD_ELEMENT_PRIORITY = 5
+ public static val ADD_CONTAINMENT_PRIORITY = 4
+ public static val REMOVE_CONTAINMENT_PRIORITY = 3
+ public static val REMOVE_ELEMENT_PRIORITY = 2
+ public static val REMOVE_REFERENCE_PRIORITY = 1
+ public static val REMOVE_ATTRIBUTE_PRIORITY = 0
+
+ public static def getINSTANCE() {
+ return new DiffComparator()
+ }
+
+ override compare(IDifference o1, IDifference o2) {
+ val result = o1.priority-o2.priority
+ if(result != 0) {
+ return result
+ }
+ return o1.compareTo(o2)
+ }
+
+ dispatch def int compareTo(IDifference o1, IDifference o2) {
+ return 0
+ }
+ dispatch def int compareTo(EElementPresence o1, EElementPresence o2) {
+ if(o1.priority == ADD_ELEMENT_PRIORITY) {
+ // If differences are additions
+ return o1.element.deepness-o2.element.deepness
+ } else {
+ // If differences are deletions
+ return o2.element.deepness-o1.element.deepness
+ }
+ }
+ dispatch def int compareTo(EReferenceValuePresence o1, EReferenceValuePresence o2) {
+ if(o1.priority == ADD_CONTAINMENT_PRIORITY) {
+ // If differences are deletions
+ return o1.valueMatch.target.deepness-o2.valueMatch.target.deepness
+ } else if(o1.priority == REMOVE_CONTAINMENT_PRIORITY) {
+ // If differences are additions
+ return o2.valueMatch.reference.deepness-o1.valueMatch.reference.deepness
+ }
+ return 0
+ }
+
+ private def int getDeepness(EObject eObject) {
+ if(eObject.eContainer == null) {
+ return 0
+ }
+ return eObject.eContainer.deepness+1
+ }
+
+ dispatch def int getPriority(IDifference diff) {
+ throw new ModelPatchException("Unsupported difference type")
+ }
+ dispatch def int getPriority(EAttributeValuePresence diff) {
+ if(Role.TARGET == diff.presenceRole) {
+ return ADD_ATTRIBUTE_PRIORITY
+ }
+ return REMOVE_ATTRIBUTE_PRIORITY
+ }
+ dispatch def int getPriority(EElementPresence diff) {
+ if(Role.TARGET == diff.presenceRole) {
+ return ADD_ELEMENT_PRIORITY
+ }
+ return REMOVE_ELEMENT_PRIORITY
+ }
+ dispatch def int getPriority(EReferenceValuePresence diff) {
+ if(Role.TARGET == diff.presenceRole) {
+ if((diff.feature as EReference).isContainment) {
+ return ADD_CONTAINMENT_PRIORITY
+ }
+ return ADD_REFERENCE_PRIORITY
+ }
+ if((diff.feature as EReference).isContainment) {
+ return REMOVE_CONTAINMENT_PRIORITY
+ }
+ return REMOVE_REFERENCE_PRIORITY
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/BaseIndexEObjectLocator.xtend b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/BaseIndexEObjectLocator.xtend
new file mode 100644
index 0000000..97ab090
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/BaseIndexEObjectLocator.xtend
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime.identifier
+
+import com.google.common.base.Optional
+import org.eclipse.emf.ecore.EObject
+import org.eclipse.viatra.query.runtime.base.api.NavigationHelper
+
+class BaseIndexEObjectLocator implements EObjectLocator {
+ val NavigationHelper navigationHelper;
+
+ new(NavigationHelper navigationHelper) {
+ this.navigationHelper = navigationHelper;
+ }
+
+ override Optional<EObject> locate(String identifier) {
+ var result = Optional.absent
+ val owners = navigationHelper.findByAttributeValue(identifier);
+ val idSettings = owners.filter[
+ getEObject.eClass.getEIDAttribute == getEStructuralFeature
+ ]
+ if(idSettings.size() == 1){
+ result = Optional.fromNullable(owners.iterator().next().getEObject);
+ }
+ return result;
+ }
+
+ def void dispose() {
+ navigationHelper.dispose();
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/EMFIdentifierProvider.java b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/EMFIdentifierProvider.java
new file mode 100644
index 0000000..64e226a
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/EMFIdentifierProvider.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime.identifier;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.ENamedElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+public class EMFIdentifierProvider {
+
+ public static final String ECLASS_FEATURE_SEPARATOR = ".";
+ public static final String ECLASS_OPERATION_SEPARATOR = ":";
+ public static final String ENUM_LITERAL_SEPARATOR = "::";
+ public static final String PACKAGED_ELEMENT_SEPARATOR = "#";
+
+ private EObjectIdentifierProvider eObjectIdentifierProvider;
+
+ public String identifyEObject(EObject eObject) {
+ String identifier = null;
+ if(eObjectIdentifierProvider != null){
+ identifier = eObjectIdentifierProvider.identify(eObject);
+ }
+ return identifier;
+ }
+
+ public String identify(EPackage ePackage) {
+ String identifier = ePackage.getNsURI();
+ return identifier;
+ }
+
+ public String identify(EClassifier eClassifier) {
+ EPackage ePackage = eClassifier.getEPackage();
+ String identifier = identifyNamedElementInPackage(eClassifier, ePackage);
+ return identifier;
+ }
+
+ public String identify(EOperation eOperation) {
+ EClass eContainingClass = eOperation.getEContainingClass();
+ String eClassIdentifier = identify(eContainingClass);
+ String name = eOperation.getName();
+ String identifier = eClassIdentifier + ECLASS_OPERATION_SEPARATOR + name;
+ return identifier;
+ }
+
+ public String identify(EStructuralFeature eStructuralFeature) {
+ EClass eContainingClass = eStructuralFeature.getEContainingClass();
+ String eClassIdentifier = identify(eContainingClass);
+ String name = eStructuralFeature.getName();
+ String identifier = eClassIdentifier + ECLASS_FEATURE_SEPARATOR + name;
+ return identifier;
+ }
+
+ public String identify(EEnumLiteral eEnumLiteral) {
+ EEnum eEnum = eEnumLiteral.getEEnum();
+ String eEnumIdentifier = identify(eEnum);
+ String name = eEnumLiteral.getName();
+ String identifier = eEnumIdentifier + ENUM_LITERAL_SEPARATOR + name;
+ return identifier;
+ }
+
+ private String identifyNamedElementInPackage(ENamedElement namedElement, EPackage ePackage) {
+ String ePackageIdentifier = identify(ePackage);
+ String name = namedElement.getName();
+ String identifier = ePackageIdentifier + PACKAGED_ELEMENT_SEPARATOR + name;
+ return identifier;
+ }
+
+ public EObjectIdentifierProvider getEObjectIdentifierProvider() {
+ return eObjectIdentifierProvider;
+ }
+
+ public void setEObjectIdentifierProvider(EObjectIdentifierProvider eObjectIdentifierProvider) {
+ this.eObjectIdentifierProvider = eObjectIdentifierProvider;
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/EObjectIdentifierProvider.java b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/EObjectIdentifierProvider.java
new file mode 100644
index 0000000..83aea50
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/EObjectIdentifierProvider.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime.identifier;
+
+import org.eclipse.emf.ecore.EObject;
+
+public interface EObjectIdentifierProvider {
+
+ String identify(EObject eObject);
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/EObjectLocator.java b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/EObjectLocator.java
new file mode 100644
index 0000000..d2e838f
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/EObjectLocator.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime.identifier;
+
+import org.eclipse.emf.ecore.EObject;
+
+import com.google.common.base.Optional;
+
+
+public interface EObjectLocator {
+
+ Optional<EObject> locate(String identifier);
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/IdentifiedEMFObjectLocator.java b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/IdentifiedEMFObjectLocator.java
new file mode 100644
index 0000000..7b56cf9
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/IdentifiedEMFObjectLocator.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime.identifier;
+
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Maps;
+
+public class IdentifiedEMFObjectLocator {
+
+ protected Map<String, EPackage> packageRegistry;
+ private EObjectLocator eObjectLocator;
+
+ public IdentifiedEMFObjectLocator() {
+ packageRegistry = Maps.newHashMap();
+ }
+
+ public void registerEPackage(EPackage ePackage) {
+ Preconditions.checkNotNull("EPackage cannot be null", ePackage);
+ String nsURI = ePackage.getNsURI();
+ checkNotNullIdentifier(nsURI);
+ packageRegistry.put(nsURI, ePackage);
+ }
+
+ public Optional<EObject> locateEObject(String identifier) {
+ checkNotNullIdentifier(identifier);
+ Optional<EObject> locate = Optional.absent();
+ if(eObjectLocator != null) {
+ locate = eObjectLocator.locate(identifier);
+ }
+ return locate;
+ }
+
+ public Optional<EPackage> locateEPackage(String identifier) {
+ checkNotNullIdentifier(identifier);
+ EPackage ePackage = packageRegistry.get(identifier);
+ if(ePackage == null) {
+ ePackage = EPackage.Registry.INSTANCE.getEPackage(identifier);
+ }
+ return Optional.fromNullable(ePackage);
+ }
+
+ public Optional<EClassifier> locateEClassifier(String identifier) {
+ checkNotNullIdentifier(identifier);
+ EClassifier eClassifier = null;
+ String separator = EMFIdentifierProvider.PACKAGED_ELEMENT_SEPARATOR;
+ int lastIndexOf = identifier.lastIndexOf(separator);
+ if(lastIndexOf > separator.length()){
+ String packageIdentifier = identifier.substring(0, lastIndexOf);
+ Optional<EPackage> locatedEPackage = locateEPackage(packageIdentifier);
+ if(locatedEPackage.isPresent() && lastIndexOf < identifier.length()){
+ String eClassIdentifier = identifier.substring(lastIndexOf + separator.length());
+ if(!eClassIdentifier.isEmpty()){
+ eClassifier = locatedEPackage.get().getEClassifier(eClassIdentifier);
+ }
+ }
+ }
+ return Optional.fromNullable(eClassifier);
+
+ }
+
+ public Optional<EStructuralFeature> locateEStructuralFeature(String identifier) {
+ checkNotNullIdentifier(identifier);
+ EStructuralFeature feature = null;
+ String separator = EMFIdentifierProvider.ECLASS_FEATURE_SEPARATOR;
+ int lastIndexOf = identifier.lastIndexOf(separator);
+ if(lastIndexOf > separator.length()){
+ String eClassIdentifier = identifier.substring(0, lastIndexOf);
+ Optional<EClassifier> locatedEClassifier = locateEClassifier(eClassIdentifier);
+ if(locatedEClassifier.isPresent() && lastIndexOf < identifier.length()){
+ String eStructuralFeatureIdentifier = identifier.substring(lastIndexOf + separator.length());
+ if(!eStructuralFeatureIdentifier.isEmpty()){
+ EClassifier eClassifier = locatedEClassifier.get();
+ if(eClassifier instanceof EClass){
+ feature = ((EClass) eClassifier).getEStructuralFeature(eStructuralFeatureIdentifier);
+ }
+ }
+ }
+ }
+ return Optional.fromNullable(feature);
+ }
+
+ public Optional<EEnumLiteral> locateEEnumLiteral(String identifier) {
+ checkNotNullIdentifier(identifier);
+ EEnumLiteral literal = null;
+ String separator = EMFIdentifierProvider.ENUM_LITERAL_SEPARATOR;
+ int lastIndexOf = identifier.lastIndexOf(separator);
+ if(lastIndexOf > separator.length()){
+ String eEnumIdentifier = identifier.substring(0, lastIndexOf);
+ Optional<EClassifier> locatedEEnum = locateEClassifier(eEnumIdentifier);
+ if(locatedEEnum.isPresent() && lastIndexOf < identifier.length()){
+ String literalIdentifier = identifier.substring(lastIndexOf + separator.length());
+ if(!literalIdentifier.isEmpty()){
+ EClassifier eClassifier = locatedEEnum.get();
+ if(eClassifier instanceof EEnum){
+ literal = ((EEnum) eClassifier).getEEnumLiteral(literalIdentifier);
+ }
+ }
+ }
+ }
+ return Optional.fromNullable(literal);
+ }
+
+ private void checkNotNullIdentifier(String identifier) {
+ Preconditions.checkNotNull(identifier, "Identifier cannot be null!");
+ }
+
+ public EObjectLocator getEObjectLocator() {
+ return eObjectLocator;
+ }
+
+ public void setEObjectLocator(EObjectLocator eObjectLocator) {
+ this.eObjectLocator = eObjectLocator;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/TreeIteratorEObjectLocator.xtend b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/TreeIteratorEObjectLocator.xtend
new file mode 100644
index 0000000..1497c03
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/identifier/TreeIteratorEObjectLocator.xtend
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime.identifier
+
+import com.google.common.base.Optional
+import org.eclipse.emf.ecore.resource.ResourceSet
+import org.eclipse.emf.ecore.util.EcoreUtil
+
+class TreeIteratorEObjectLocator implements EObjectLocator {
+
+ ResourceSet resourceSet
+
+ new(ResourceSet resourceSet) {
+ this.resourceSet = resourceSet
+ }
+
+ override locate(String identifier) {
+ val allResourceContents = resourceSet.resources.map [
+ allContents.toIterable
+ ].flatten
+
+ val eObject = allResourceContents.findFirst [ element |
+ identifier == EcoreUtil.getID(element)
+ ]
+
+ return Optional.fromNullable(eObject)
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/AbstractEMFModleAccess.xtend b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/AbstractEMFModleAccess.xtend
new file mode 100644
index 0000000..c30cbcd
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/AbstractEMFModleAccess.xtend
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime.modelaccess
+
+import com.google.common.base.Optional
+import org.eclipse.emf.common.util.EList
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchException
+import org.eclipse.emf.ecore.EClass
+import org.eclipse.emf.ecore.EClassifier
+import org.eclipse.emf.ecore.EObject
+import org.eclipse.emf.ecore.EStructuralFeature
+
+abstract class AbstractEMFModleAccess implements EMFModelAccess {
+
+ protected abstract def EObject doCreate(EClass type)
+ protected abstract def void doRemove(EObject element)
+ protected abstract def void doAdd(EObject container, EStructuralFeature feature, Object element)
+ protected abstract def void doAdd(EObject container, EStructuralFeature feature, Object element, int index)
+ protected abstract def void doRemove(EObject container, EStructuralFeature feature, Object element)
+ protected abstract def void doRemove(EObject container, EStructuralFeature feature, int index)
+ protected abstract def void doChangeIndex(EObject container, EStructuralFeature feature, Object element, int index)
+
+ override create(EClassifier type) {
+ if(type instanceof EClass) {
+ doCreate(type)
+ } else {
+ throw new IllegalArgumentException("Only EClasses are supported as element types.")
+ }
+ }
+
+ override add(EObject container, EStructuralFeature feature, Object element, Optional<Integer> index) {
+ if(feature.isMany) {
+ val featureValue = container.eGet(feature);
+ if(featureValue instanceof EList) {
+ if(feature.isUnique && featureValue.contains(element)) {
+ throw new ModelPatchException('''Element is already in the unique list''')
+ }
+ if (index.isPresent && featureValue.size >= index.get) {
+ doAdd(container, feature, element, index.get)
+ } else {
+ doAdd(container, feature, element)
+ }
+ } else {
+ throw new IllegalStateException("Feature value is not EList")
+ }
+ } else {
+ doAdd(container, feature, element)
+ }
+ }
+
+
+ override remove(EObject element) {
+ doRemove(element)
+ }
+
+ override remove(EObject container, EStructuralFeature feature, Object element, Optional<Integer> index) {
+ val featureValue = container.eGet(feature)
+ if(feature.isMany) {
+ if(featureValue instanceof EList) {
+ if(!featureValue.contains(element)){
+ throw new ModelPatchException('''Cannot remove nonexistent element''')
+ }
+ if (index.isPresent
+ && featureValue.size > index.get
+ && featureValue.get(index.get) == element
+ ) {
+ val int intIndex = index.get
+ doRemove(container, feature, intIndex)
+ } else {
+ doRemove(container, feature, element)
+ }
+ } else {
+ throw new IllegalStateException("Feature value is not EList")
+ }
+ } else {
+ if(featureValue == element) {
+ doRemove(container, feature, element)
+ } else {
+ throw new ModelPatchException('''Cannot remove nonexistent element''')
+ }
+ }
+ }
+
+ override changeIndex(EObject container, EStructuralFeature feature, Object element, Optional<Integer> newIndex) {
+ if(feature.isMany && newIndex.isPresent) {
+ val featureValue = container.eGet(feature)
+ if(featureValue instanceof EList) {
+ if(featureValue.size >= newIndex.get) {
+ doChangeIndex(container, feature, element, newIndex.get)
+ }
+ } else {
+ throw new IllegalStateException("Feature value is not EList")
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/EMFModelAccess.xtend b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/EMFModelAccess.xtend
new file mode 100644
index 0000000..5b92ecc
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/EMFModelAccess.xtend
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime.modelaccess
+
+import com.google.common.base.Optional
+import org.eclipse.emf.ecore.EClassifier
+import org.eclipse.emf.ecore.EObject
+import org.eclipse.emf.ecore.EStructuralFeature
+
+interface EMFModelAccess {
+
+ /**
+ * Creates a new model element with the specified type.
+ */
+ def EObject create(EClassifier type)
+
+ /**
+ * Adds an existing model element to a selected EReference.
+ */
+ def void add(EObject container, EStructuralFeature feature, Object element, Optional<Integer> index)
+
+ /**
+ * Removes an object from the model.
+ */
+ def void remove(EObject element)
+
+ /**
+ * Removes an object from the 'many'-valued feature, or unsets the
+ * 'single'-valued feature. If the feature is a containment reference,
+ * the element is removed from the model as well.
+ */
+ def void remove(EObject container, EStructuralFeature feature, Object element, Optional<Integer> index)
+
+ /**
+ * Moves an object inside an EStructuralFeature of an EObject to the specified index.
+ */
+ def void changeIndex(EObject container, EStructuralFeature feature, Object element, Optional<Integer> newIndex)
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/ModelAccessProvider.xtend b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/ModelAccessProvider.xtend
new file mode 100644
index 0000000..5cc64d8
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/ModelAccessProvider.xtend
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime.modelaccess
+
+import org.eclipse.emf.common.util.URI
+import org.eclipse.emf.ecore.resource.ResourceSet
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain
+import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine
+import org.eclipse.viatra.query.runtime.emf.EMFScope
+import org.eclipse.viatra.transformation.runtime.emf.modelmanipulation.ModelManipulationWithEditingDomain
+import org.eclipse.viatra.transformation.runtime.emf.modelmanipulation.SimpleModelManipulations
+
+public class ModelAccessProvider {
+ public def EMFModelAccess getSelectedModelAccess(String pref, ResourceSet resourceSet){
+ val accessType = ModelAccessTypes.valueOf(pref)
+
+ var EMFModelAccess access
+ switch (accessType) {
+ case EMF_REFLECTIVE: {
+ access = new SimpleReflectiveEMFModelAccess
+ }
+ case VIATRA: {
+ val temporaryResource = resourceSet.createResource(URI.createURI("temporary_resource"))
+ val scope = new EMFScope(resourceSet)
+ val engine = ViatraQueryEngine.on(scope)
+
+ val domain = AdapterFactoryEditingDomain.getEditingDomainFor(resourceSet)
+ if(domain != null){
+ val viatraModelManipulator = new ModelManipulationWithEditingDomain(engine, domain)
+ access = new ViatraModelAccess(viatraModelManipulator, temporaryResource)
+ }else{
+ val viatraModelManipulator = new SimpleModelManipulations(engine)
+ access = new ViatraModelAccess(viatraModelManipulator, temporaryResource)
+ }
+ }
+ default: {
+ access = new SimpleReflectiveEMFModelAccess
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/ModelAccessTypes.java b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/ModelAccessTypes.java
new file mode 100644
index 0000000..5e310ff
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/ModelAccessTypes.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime.modelaccess;
+
+public enum ModelAccessTypes {
+ EMF_REFLECTIVE,
+ VIATRA
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/SimpleReflectiveEMFModelAccess.xtend b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/SimpleReflectiveEMFModelAccess.xtend
new file mode 100644
index 0000000..8c50c7b
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/SimpleReflectiveEMFModelAccess.xtend
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime.modelaccess
+
+import org.eclipse.emf.common.util.EList
+import org.eclipse.emf.ecore.EClass
+import org.eclipse.emf.ecore.EObject
+import org.eclipse.emf.ecore.EStructuralFeature
+import org.eclipse.emf.ecore.util.EcoreUtil
+
+class SimpleReflectiveEMFModelAccess extends AbstractEMFModleAccess {
+ override protected doCreate(EClass type) {
+ val eObject = type.EPackage.EFactoryInstance.create(type)
+ return eObject
+ }
+
+ override protected doAdd(EObject container, EStructuralFeature feature, Object element) {
+ if(feature.isMany) {
+ val featureValueList = container.eGet(feature) as EList
+ featureValueList.add(element)
+ } else {
+ container.eSet(feature, element)
+ }
+ }
+
+ override protected doAdd(EObject container, EStructuralFeature feature, Object element, int index) {
+ val featureValue = container.eGet(feature) as EList
+ featureValue.add(index, element)
+ }
+
+ override protected doChangeIndex(EObject container, EStructuralFeature feature, Object element, int index) {
+ val featureValue = container.eGet(feature) as EList
+ featureValue.move(index, element)
+ }
+
+ override protected doRemove(EObject element) {
+ EcoreUtil.remove(element)
+ }
+
+ override protected doRemove(EObject container, EStructuralFeature feature, Object element) {
+ if(feature.isMany) {
+ val featureValueList = container.eGet(feature) as EList
+ featureValueList.remove(element)
+ } else {
+ container.eUnset(feature)
+ }
+ }
+
+ override protected doRemove(EObject container, EStructuralFeature feature, int index) {
+ val featureValueList = container.eGet(feature) as EList
+ featureValueList.remove(index)
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/ViatraModelAccess.xtend b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/ViatraModelAccess.xtend
new file mode 100644
index 0000000..b7f1faa
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/src/org/eclipse/emf/diffmerge/patch/runtime/modelaccess/ViatraModelAccess.xtend
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.runtime.modelaccess
+
+import org.eclipse.emf.common.util.EList
+import org.eclipse.emf.ecore.EClass
+import org.eclipse.emf.ecore.EObject
+import org.eclipse.emf.ecore.EReference
+import org.eclipse.emf.ecore.EStructuralFeature
+import org.eclipse.emf.ecore.resource.Resource
+import org.eclipse.viatra.transformation.runtime.emf.modelmanipulation.IModelManipulations
+
+class ViatraModelAccess extends AbstractEMFModleAccess {
+ val IModelManipulations viatraModelManipulator
+ val Resource temporaryResource
+
+ new(IModelManipulations viatraModelManipulator, Resource temporaryResource) {
+ this.viatraModelManipulator = viatraModelManipulator
+ this.temporaryResource = temporaryResource
+ }
+
+ override protected doCreate(EClass type) {
+ viatraModelManipulator.create(temporaryResource, type)
+ }
+
+ override protected doRemove(EObject element) {
+ viatraModelManipulator.remove(element)
+ }
+
+ override protected doAdd(EObject container, EStructuralFeature feature, Object element) {
+ if(feature.isMany) {
+ if(feature instanceof EReference && (feature as EReference).isContainment) {
+ if(element instanceof EObject) {
+ viatraModelManipulator.moveTo(element, container, feature as EReference)
+ } else {
+ throw new IllegalArgumentException("Only EObjects can be added to EReferences.")
+ }
+ } else {
+ viatraModelManipulator.add(container, feature, element)
+ }
+ } else {
+ viatraModelManipulator.set(container, feature, element)
+ }
+ }
+
+ override protected doAdd(EObject container, EStructuralFeature feature, Object element, int index) {
+ if(feature instanceof EReference && (feature as EReference).isContainment) {
+ if(element instanceof EObject) {
+ viatraModelManipulator.moveTo(element as EObject, container, feature as EReference, index)
+ } else {
+ throw new IllegalArgumentException("Only EObjects can be added to EReferences.")
+ }
+ } else {
+ viatraModelManipulator.add(container, feature, element, index)
+ }
+ }
+
+ override protected doRemove(EObject container, EStructuralFeature feature, Object element) {
+ if(feature.isMany) {
+ viatraModelManipulator.remove(container, feature, element)
+ } else {
+ viatraModelManipulator.set(container, feature, feature.defaultValue)
+ }
+ }
+
+ override protected doRemove(EObject container, EStructuralFeature feature, int index) {
+ viatraModelManipulator.remove(container, feature, index)
+ }
+
+ override protected doChangeIndex(EObject container, EStructuralFeature feature, Object element, int index) {
+ val oldIndex = (container.eGet(feature) as EList).indexOf(element)
+ viatraModelManipulator.changeIndex(container, feature, oldIndex, index)
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.runtime/xtend-gen/.gitignore b/plugins/org.eclipse.emf.diffmerge.patch.runtime/xtend-gen/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.runtime/xtend-gen/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/.classpath b/plugins/org.eclipse.emf.diffmerge.patch.ui/.classpath
new file mode 100644
index 0000000..e850b35
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="xtend-gen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/.project b/plugins/org.eclipse.emf.diffmerge.patch.ui/.project
new file mode 100644
index 0000000..8eee33b
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.patch.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.emf.diffmerge.patch.ui/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/.settings/org.eclipse.core.runtime.prefs b/plugins/org.eclipse.emf.diffmerge.patch.ui/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.diffmerge.patch.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..f42de36
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.diffmerge.patch.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..50534d0
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,31 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.diffmerge.patch.ui;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.emf.common.ui;bundle-version="2.10.0",
+ org.eclipse.emf.diffmerge;bundle-version="[0.7.0,0.8.0)",
+ org.eclipse.core.resources,
+ com.google.guava;bundle-version="15.0.0",
+ org.eclipse.xtend.lib,
+ org.eclipse.core.runtime,
+ org.eclipse.emf.diffmerge.patch;bundle-version="[0.1.0,0.2.0)",
+ org.eclipse.core.databinding.observable,
+ org.eclipse.jface,
+ org.eclipse.core.databinding,
+ org.eclipse.core.databinding.property,
+ org.eclipse.jface.databinding,
+ org.eclipse.emf.diffmerge.patch.runtime;bundle-version="[0.1.0,0.2.0)",
+ org.eclipse.ui.ide,
+ org.eclipse.emf.diffmerge.ui;bundle-version="[0.7.0,0.8.0)",
+ org.eclipse.viatra.query.runtime.base;bundle-version="[1.4.0,2.0.0)",
+ org.eclipse.emf.diffmerge.patch.persistence.json;bundle-version="0.1.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Export-Package: org.eclipse.emf.diffmerge.patch.ui.dialogs,
+ org.eclipse.emf.diffmerge.patch.ui.preferences,
+ org.eclipse.emf.diffmerge.patch.ui.utils
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.emf.diffmerge.patch.ui.Activator
+Import-Package: org.apache.log4j;version="1.2.0"
+
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/about.html b/plugins/org.eclipse.emf.diffmerge.patch.ui/about.html
new file mode 100644
index 0000000..d8e1984
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/about.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/build.properties b/plugins/org.eclipse.emf.diffmerge.patch.ui/build.properties
new file mode 100644
index 0000000..ef79c67
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/build.properties
@@ -0,0 +1,19 @@
+###############################################################################
+# Copyright (c) 2016-2017 Thales Global Services S.A.S.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+###############################################################################
+source.. = src/,\
+ xtend-gen/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/,\
+ about.html
+src.includes = about.html
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/apply.png b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/apply.png
new file mode 100644
index 0000000..1ab01d4
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/apply.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/apply_16.png b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/apply_16.png
new file mode 100644
index 0000000..2b15918
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/apply_16.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/generate.png b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/generate.png
new file mode 100644
index 0000000..c20e3f7
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/generate.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/generate_16.png b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/generate_16.png
new file mode 100644
index 0000000..4ae6fa3
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/generate_16.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/patch.png b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/patch.png
new file mode 100644
index 0000000..650adcc
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/patch.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/patch_16.png b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/patch_16.png
new file mode 100644
index 0000000..4a0157a
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/patch_16.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/reverse.png b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/reverse.png
new file mode 100644
index 0000000..39c6079
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/reverse.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/reverse_16.png b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/reverse_16.png
new file mode 100644
index 0000000..f7172df
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/icons/reverse_16.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/plugin.properties b/plugins/org.eclipse.emf.diffmerge.patch.ui/plugin.properties
new file mode 100644
index 0000000..ef61b0e
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/plugin.properties
@@ -0,0 +1,9 @@
+###############################################################################
+# Copyright (c) 2016-2017 Thales Global Services S.A.S.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+pluginName = Model Patch GUI Plug-In (Incubation)
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/plugin.xml b/plugins/org.eclipse.emf.diffmerge.patch.ui/plugin.xml
new file mode 100644
index 0000000..8855797
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/plugin.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ id="org.eclipse.emf.diffmerge.patch.ui.patch.generate"
+ name="Generate modelpatch">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="org.eclipse.emf.diffmerge.patch.ui.editors.ModelPatchEditorPart"
+ extensions="modelpatch"
+ id="org.eclipse.emf.diffmerge.patch.ui.editors.ModelPatchEditorPart"
+ name="ModelPatch Editor">
+ </editor>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ class="org.eclipse.emf.diffmerge.patch.ui.preferences.ModelPatchPreferencePage"
+ id="org.eclipse.emf.diffmerge.patch.ui.preferences.page"
+ name="Model Patch Preferences">
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="menu:edit?after=additions">
+ <command
+ commandId="org.eclipse.emf.diffmerge.patch.ui.patch.generate"
+ icon="icons/generate_16.png"
+ label="Generate modelpatch"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeEditorInput">
+ <instanceof
+ value="org.eclipse.emf.diffmerge.ui.setup.EMFDiffMergeEditorInput">
+ </instanceof>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.ui.popup.any?after=additions">
+ <command
+ commandId="org.eclipse.emf.diffmerge.patch.ui.patch.apply"
+ icon="icons/apply_16.png"
+ label="Apply modelpatch"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate>
+ <or>
+ <adapt
+ type="org.eclipse.emf.ecore.EObject">
+ </adapt>
+ <adapt
+ type="org.eclipse.emf.ecore.resource.Resource">
+ </adapt>
+ </or>
+ </iterate>
+ </with>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.diffmerge.patch.ui.patch.generate"
+ icon="icons/generate_16.png"
+ label="Generate modelpatch"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <with
+ variable="activeEditorInput">
+ <instanceof
+ value="org.eclipse.emf.diffmerge.ui.setup.EMFDiffMergeEditorInput">
+ </instanceof>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <category
+ id="org.eclipse.emf.diffmerge.patch.ui.patch"
+ name="Modelpatch">
+ </category>
+ <command
+ categoryId="org.eclipse.emf.diffmerge.patch.ui.patch"
+ defaultHandler="org.eclipse.emf.diffmerge.patch.ui.handlers.ModelpatchApplicationHandler"
+ id="org.eclipse.emf.diffmerge.patch.ui.patch.apply"
+ name="Apply modelpatch">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.emf.diffmerge.patch.ui.handlers.ModelpatchGenerationHandler"
+ commandId="org.eclipse.emf.diffmerge.patch.ui.patch.generate">
+ </handler>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/pom.xml b/plugins/org.eclipse.emf.diffmerge.patch.ui/pom.xml
new file mode 100644
index 0000000..58b8572
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/pom.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.plugins</artifactId>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.ui</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <version>0.1.0-SNAPSHOT</version>
+ <properties>
+ <rootPath>${basedir}/../</rootPath>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>xtend-gen</directory>
+ <excludes>
+ <exclude>.gitignore</exclude>
+ </excludes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.xtend</groupId>
+ <artifactId>xtend-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/Activator.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/Activator.java
new file mode 100644
index 0000000..942f498
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/Activator.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.emf.diffmerge.patch.gui"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/dialogs/ModelpatchEntryFilterCreationDialog.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/dialogs/ModelpatchEntryFilterCreationDialog.java
new file mode 100644
index 0000000..3ace2a0
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/dialogs/ModelpatchEntryFilterCreationDialog.java
@@ -0,0 +1,273 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.dialogs;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ComboViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+import org.eclipse.emf.diffmerge.patch.api.ChangeDirection;
+import org.eclipse.emf.diffmerge.patch.api.EntryType;
+import org.eclipse.emf.diffmerge.patch.api.IModelPatchEntryFilter;
+import org.eclipse.emf.diffmerge.patch.api.filters.EntryDirectionFilter;
+import org.eclipse.emf.diffmerge.patch.api.filters.EntryTypeFilter;
+
+public class ModelpatchEntryFilterCreationDialog extends Dialog {
+ @SuppressWarnings("unused")
+ private DataBindingContext m_bindingContext;
+ IModelPatchEntryFilter filter = null;
+ private Label lblDirection;
+ private Label lblFilterType;
+ private Label lblEntryType;
+ private Combo cFilterType;
+ private ModelpatchEntryFilterType filterType = ModelpatchEntryFilterType.Direction;
+ private boolean add = true;
+ private boolean remove = false;
+ private boolean attribute = true;
+ private boolean element = false;
+ private boolean reference = false;
+ /**
+ * Create the dialog.
+ * @param parentShell
+ */
+ public ModelpatchEntryFilterCreationDialog(Shell parentShell) {
+ super(parentShell);
+ setShellStyle(SWT.TITLE | SWT.APPLICATION_MODAL);
+ }
+ private String title;
+
+ public void setTitle(String title) {
+ this.title = title;
+ if(getShell()==null) {
+ configureShell(createShell());
+ } else {
+ getShell().setText(title);
+ }
+ }
+
+ @Override
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ shell.setText(title);
+ }
+
+ /**
+ * Create contents of the dialog.
+ * @param parent
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Composite container = (Composite) super.createDialogArea(parent);
+ GridLayout gridLayout = (GridLayout) container.getLayout();
+ gridLayout.numColumns = 2;
+
+ lblFilterType = new Label(container, SWT.NONE);
+ GridData gd_lblFilterType = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
+ gd_lblFilterType.widthHint = 55;
+ lblFilterType.setLayoutData(gd_lblFilterType);
+ lblFilterType.setText("Filter type:");
+
+ ComboViewer cvFilterType = new ComboViewer(container, SWT.READ_ONLY);
+ cvFilterType.setContentProvider(new ArrayContentProvider());
+ cvFilterType.setInput(ModelpatchEntryFilterType.values());
+ cFilterType = cvFilterType.getCombo();
+ cFilterType.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ cFilterType.select(0);
+
+ final Composite composite = new Composite(container, SWT.NONE);
+ final StackLayout stack = new StackLayout();
+ composite.setLayout(stack);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 2, 1));
+
+ final Composite cmpNothing = new Composite(composite, SWT.NONE);
+ cmpNothing.setLayout(new FillLayout(SWT.HORIZONTAL));
+
+ final Composite grpDirectionFilter = new Composite(composite, SWT.NONE);
+ GridLayout gl_grpDirectionFilter = new GridLayout(3, false);
+ gl_grpDirectionFilter.marginWidth = 0;
+ gl_grpDirectionFilter.marginHeight = 0;
+ grpDirectionFilter.setLayout(gl_grpDirectionFilter);
+
+ lblDirection = new Label(grpDirectionFilter, SWT.NONE);
+ GridData gd_lblDirection = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+ gd_lblDirection.widthHint = 55;
+ lblDirection.setLayoutData(gd_lblDirection);
+ lblDirection.setText("Direction:");
+
+ Button btnAdd = new Button(grpDirectionFilter, SWT.RADIO);
+ btnAdd.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ add = ((Button)e.widget).getSelection();
+ }
+ });
+ btnAdd.setSelection(true);
+ btnAdd.setText("ADD");
+
+ Button btnRemove = new Button(grpDirectionFilter, SWT.RADIO);
+ btnRemove.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ remove = ((Button)e.widget).getSelection();
+ }
+ });
+ btnRemove.setText("REMOVE");
+
+ final Composite grpEntryTypeFilter = new Composite(composite, SWT.NONE);
+ GridLayout gl_grpEntryTypeFilter = new GridLayout(4, false);
+ gl_grpEntryTypeFilter.marginHeight = 0;
+ gl_grpEntryTypeFilter.marginWidth = 0;
+ grpEntryTypeFilter.setLayout(gl_grpEntryTypeFilter);
+
+ lblEntryType = new Label(grpEntryTypeFilter, SWT.NONE);
+ GridData gd_lblEntryType = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+ gd_lblEntryType.widthHint = 55;
+ lblEntryType.setLayoutData(gd_lblEntryType);
+ lblEntryType.setText("Entry type:");
+
+ Button btnAttribute = new Button(grpEntryTypeFilter, SWT.RADIO);
+ btnAttribute.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ attribute = ((Button)e.widget).getSelection();
+ }
+ });
+ btnAttribute.setSelection(true);
+ btnAttribute.setText("Attribute");
+
+ Button btnElement = new Button(grpEntryTypeFilter, SWT.RADIO);
+ btnElement.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ element = ((Button)e.widget).getSelection();
+ }
+ });
+ btnElement.setText("Element");
+
+ Button btnReference = new Button(grpEntryTypeFilter, SWT.RADIO);
+ btnReference.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ reference = ((Button)e.widget).getSelection();
+ }
+ });
+ btnReference.setText("Reference");
+
+ stack.topControl = grpDirectionFilter;
+
+ cFilterType.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ filterType = getSelectedFilterType();
+ switch(filterType) {
+ case Direction:
+ stack.topControl = grpDirectionFilter;
+ break;
+ case EntryType:
+ stack.topControl = grpEntryTypeFilter;
+ break;
+ default:
+ stack.topControl = cmpNothing;
+ break;
+ }
+ composite.layout();
+ }
+
+ });
+
+ return container;
+ }
+
+ /**
+ * Create contents of the button bar.
+ * @param parent
+ */
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
+ Button btnOK = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+ btnOK.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ switch(filterType) {
+ case Direction:
+ if(add) {
+ filter = new EntryDirectionFilter(ChangeDirection.ADD);
+ } else if (remove) {
+ filter = new EntryDirectionFilter(ChangeDirection.REMOVE);
+ }
+ break;
+ case EntryType:
+ if(attribute) {
+ filter = new EntryTypeFilter(EntryType.ATTRIBUTE);
+ } else if(element) {
+ filter = new EntryTypeFilter(EntryType.ELEMENT);
+ } else if(reference) {
+ filter = new EntryTypeFilter(EntryType.REFERENCE);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ });
+ createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
+ m_bindingContext = initDataBindings();
+ }
+
+ /**
+ * Return the initial size of the dialog.
+ */
+ @Override
+ protected Point getInitialSize() {
+ return new Point(310, 160);
+ }
+
+ public IModelPatchEntryFilter getCreatedFilter() {
+ return filter;
+ }
+ enum ModelpatchEntryFilterType {
+ Direction, EntryType
+ }
+ private ModelpatchEntryFilterType getSelectedFilterType() {
+ return ModelpatchEntryFilterType.valueOf(cFilterType.getItem(cFilterType.getSelectionIndex()));
+ }
+ protected DataBindingContext initDataBindings() {
+ DataBindingContext bindingContext = new DataBindingContext();
+ //
+ IObservableValue observeSizeLblDirectionObserveWidget = WidgetProperties.size().observe(lblDirection);
+ IObservableValue observeSizeLblFilterTypeObserveWidget = WidgetProperties.size().observe(lblFilterType);
+ bindingContext.bindValue(observeSizeLblDirectionObserveWidget, observeSizeLblFilterTypeObserveWidget, null, null);
+ //
+ IObservableValue observeSizeLblEntryTypeObserveWidget = WidgetProperties.size().observe(lblEntryType);
+ IObservableValue observeSizeLblFilterTypeObserveWidget_1 = WidgetProperties.size().observe(lblFilterType);
+ bindingContext.bindValue(observeSizeLblEntryTypeObserveWidget, observeSizeLblFilterTypeObserveWidget_1, null, null);
+ //
+ return bindingContext;
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/dialogs/ModelpatchViewerDialog.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/dialogs/ModelpatchViewerDialog.java
new file mode 100644
index 0000000..7484736
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/dialogs/ModelpatchViewerDialog.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.dialogs;
+
+import org.eclipse.emf.diffmerge.patch.api.ModelPatch;
+import org.eclipse.emf.diffmerge.patch.ui.utils.DescriptiveEntryLabelProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelPatchContentProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelPatchLabelProvider;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.wb.swt.SWTResourceManager;
+
+public class ModelpatchViewerDialog extends Dialog {
+ private ModelPatch patch;
+ private String path;
+ private TreeViewer tvParsedPatch;
+
+ /**
+ * Create the dialog.
+ * @param parentShell
+ */
+ public ModelpatchViewerDialog(Shell parentShell, ModelPatch patch, String path) {
+ super(parentShell);
+ setShellStyle(SWT.RESIZE | SWT.TITLE | SWT.APPLICATION_MODAL);
+ this.patch = patch;
+ this.path = path;
+ }
+
+ private String title;
+ private Text txtPath;
+
+ public void setTitle(String title) {
+ this.title = title;
+ if(getShell()==null) {
+ configureShell(createShell());
+ } else {
+ getShell().setText(title);
+ }
+ }
+
+ @Override
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ shell.setText(title);
+ }
+
+ /**
+ * Create contents of the dialog.
+ * @param parent
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ getShell().setMinimumSize(getInitialSize());
+ Composite container = (Composite) super.createDialogArea(parent);
+
+ Composite composite = new Composite(container, SWT.NONE);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ GridLayout gl_composite = new GridLayout(2, false);
+ gl_composite.marginHeight = 0;
+ gl_composite.marginWidth = 0;
+ composite.setLayout(gl_composite);
+
+ Label lblPath = new Label(composite, SWT.WRAP);
+ lblPath.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+ lblPath.setSize(92, 15);
+ lblPath.setText("Path: ");
+
+ txtPath = new Text(composite, SWT.BORDER);
+ txtPath.setEditable(false);
+ txtPath.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ txtPath.setText(path);
+
+ Label lblEntries = new Label(container, SWT.NONE);
+ lblEntries.setFont(SWTResourceManager.getFont("Segoe UI", 14, SWT.BOLD));
+ lblEntries.setText("Entries:");
+
+ tvParsedPatch = new TreeViewer(container, SWT.BORDER);
+ Tree treeParsedPatch = tvParsedPatch.getTree();
+ treeParsedPatch.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+ treeParsedPatch.setVisible(true);
+ tvParsedPatch.setContentProvider(new ModelPatchContentProvider());
+ tvParsedPatch.setLabelProvider(new ModelPatchLabelProvider(new DescriptiveEntryLabelProvider()));
+ tvParsedPatch.setInput(patch);
+
+ return container;
+ }
+
+ /**
+ * Create contents of the button bar.
+ * @param parent
+ */
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+ }
+
+ /**
+ * Return the initial size of the dialog.
+ */
+ @Override
+ protected Point getInitialSize() {
+ return new Point(450, 300);
+ }
+
+ @Override
+ public boolean close() {
+ SWTResourceManager.dispose();
+ return super.close();
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/dialogs/PluginID.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/dialogs/PluginID.java
new file mode 100644
index 0000000..a02ab46
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/dialogs/PluginID.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.dialogs;
+
+public final class PluginID {
+
+ public static final String PLUGIN_ID = "org.eclipse.emf.diffmerge.patch.gui";
+
+ private PluginID() {
+
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/editors/ModelPatchEditorPart.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/editors/ModelPatchEditorPart.java
new file mode 100644
index 0000000..ca0b0f1
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/editors/ModelPatchEditorPart.java
@@ -0,0 +1,263 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.editors;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.diffmerge.patch.api.IModelPatchEntryFilter;
+import org.eclipse.emf.diffmerge.patch.api.ModelPatch;
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchException;
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchFilterApplier;
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchReverser;
+import org.eclipse.emf.diffmerge.patch.ui.dialogs.ModelpatchEntryFilterCreationDialog;
+import org.eclipse.emf.diffmerge.patch.ui.preferences.ModelPatchPreferenceProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.DescriptiveEntryLabelProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.DialogFactory;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelPatchContentProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelPatchEntryFilterContentProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelPatchEntryFilterLabelProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelPatchLabelProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.SerializerProvider;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+import org.eclipse.ui.part.FileEditorInput;
+
+public class ModelPatchEditorPart extends EditorPart {
+ private SerializerProvider serializerProvider = new SerializerProvider();
+ private ModelPatchFilterApplier filterApplier = new ModelPatchFilterApplier();
+ private IFile file;
+ public ModelPatch originalModelPatch;
+ public ModelPatch modifiedModelPatch;
+ public java.util.List<IModelPatchEntryFilter> filters = new ArrayList<>();
+ public DialogFactory dialFactory;
+
+ public static final String ID = "org.eclipse.emf.diffmerge.patch.gui.editors.ModelPatchEditorPart"; //$NON-NLS-1$
+ private Button btnReversePatch;
+ private List lFilters;
+ private Button btnAdd;
+ private Button btnRemove;
+ private Label lblSequenceOfPatch;
+ private TreeViewer tvParsedPatch;
+ private Label lblFilters;
+
+ public ModelPatchEditorPart() {}
+
+ /**
+ * Create contents of the editor part.
+ * @param parent
+ */
+ @Override
+ public void createPartControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NONE);
+ container.setLayout(new GridLayout(1, false));
+ dialFactory = new DialogFactory(getSite().getShell());
+
+ Composite compFile = new Composite(container, SWT.NONE);
+ compFile.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+ GridLayout gl_compFile = new GridLayout(2, false);
+ gl_compFile.marginWidth = 0;
+ gl_compFile.marginHeight = 0;
+ compFile.setLayout(gl_compFile);
+
+ lblSequenceOfPatch = new Label(container, SWT.NONE);
+ lblSequenceOfPatch.setText("Sequence of patch entries:");
+
+ tvParsedPatch = new TreeViewer(container, SWT.BORDER);
+ tvParsedPatch.setContentProvider(new ModelPatchContentProvider());
+ tvParsedPatch.setLabelProvider(new ModelPatchLabelProvider(new DescriptiveEntryLabelProvider()));
+ Tree treeParsedPatch = tvParsedPatch.getTree();
+ treeParsedPatch.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+ treeParsedPatch.setVisible(true);
+
+ btnReversePatch = new Button(container, SWT.CHECK);
+ btnReversePatch.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ refreshPatchViewer();
+ }
+ });
+ btnReversePatch.setText("Reverse");
+
+ lblFilters = new Label(container, SWT.NONE);
+ lblFilters.setText("Filters:");
+
+ Composite compFiltering = new Composite(container, SWT.NONE);
+ compFiltering.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+ GridLayout gl_compFiltering = new GridLayout(2, false);
+ gl_compFiltering.marginWidth = 0;
+ gl_compFiltering.marginHeight = 0;
+ compFiltering.setLayout(gl_compFiltering);
+
+ final ListViewer lvFilters = new ListViewer(compFiltering, SWT.BORDER | SWT.V_SCROLL);
+ lFilters = lvFilters.getList();
+ lFilters.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2));
+ lvFilters.setContentProvider(new ModelPatchEntryFilterContentProvider());
+ lvFilters.setLabelProvider(new ModelPatchEntryFilterLabelProvider());
+ lvFilters.setInput(filters);
+
+ btnAdd = new Button(compFiltering, SWT.NONE);
+ btnAdd.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ ModelpatchEntryFilterCreationDialog dialog = new ModelpatchEntryFilterCreationDialog(getSite().getShell());
+ dialog.setBlockOnOpen(true);
+ dialog.setTitle("Add filter");
+ dialog.open();
+ IModelPatchEntryFilter filter = dialog.getCreatedFilter();
+ if(filter!=null) {
+ filters.add(filter);
+ lvFilters.refresh();
+ refreshPatchViewer();
+ }
+ }
+ });
+ btnAdd.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+ btnAdd.setText("Add");
+
+ btnRemove = new Button(compFiltering, SWT.NONE);
+ btnRemove.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ for(Object selectedElement : lvFilters.getStructuredSelection().toList()) {
+ filters.remove(selectedElement);
+ }
+ lvFilters.refresh();
+ refreshPatchViewer();
+ }
+ });
+ btnRemove.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
+ btnRemove.setText("Remove");
+
+ refreshPatchViewer();
+ }
+
+ private ModelPatch modifyPatch(boolean isReverse) {
+ if(isReverse) {
+ try {
+ modifiedModelPatch = ModelPatchReverser.INSTANCE.reverse(originalModelPatch);
+ } catch (ModelPatchException e) {
+ e.printStackTrace();
+ }
+ } else {
+ modifiedModelPatch = originalModelPatch;
+ }
+ for(IModelPatchEntryFilter filter : filters) {
+ if(filter!=null) modifiedModelPatch = filterApplier.applyFilter(modifiedModelPatch, filter);
+ }
+ return modifiedModelPatch;
+ }
+
+ private void refreshPatchViewer() {
+ modifyPatch(btnReversePatch.getSelection());
+ tvParsedPatch.setInput(modifiedModelPatch);
+ tvParsedPatch.refresh();
+ firePropertyChange(PROP_DIRTY);
+ }
+
+ @Override
+ public void setFocus() {
+ // Set the focus
+ }
+
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ monitor.beginTask("Save model patch: "+file.getName(), 1);
+ try {
+ String pref = ModelPatchPreferenceProvider.INSTANCE.getSerializationType();
+ serializerProvider.getSelectedSerializer(pref).serialize(modifiedModelPatch, new File(file.getLocation().toOSString()));
+ refreshAfterSave();
+ } catch (ModelPatchException e) {
+ new RuntimeException("We are unable to save the modifications!", new Throwable(e));
+ }
+ monitor.done();
+ }
+
+ @Override
+ public void doSaveAs() {
+ try {
+ IWorkbench workbench = getSite().getWorkbenchWindow().getWorkbench();
+ IFile newFile = dialFactory.openSaveFileDialog(workbench, new StructuredSelection(ResourcesPlugin.getWorkspace().getRoot().getFile(file.getFullPath())), "modelpatch");
+ String pref = ModelPatchPreferenceProvider.INSTANCE.getSerializationType();
+ serializerProvider.getSelectedSerializer(pref).serialize(modifiedModelPatch, newFile.getLocation().toFile());
+ file = newFile;
+ setPartName("ModelPatch: "+file.getName());
+ refreshAfterSave();
+ } catch (ModelPatchException e) {
+ new RuntimeException("We are unable to save the new file!", new Throwable(e));
+ }
+ }
+
+ private void refreshAfterSave() {
+ originalModelPatch = modifiedModelPatch;
+ filters.clear();
+ btnReversePatch.setSelection(false);
+ refreshPatchViewer();
+ }
+
+ @Override
+ public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+ if(!(input instanceof FileEditorInput)) {
+ throw new PartInitException("Wrong input!");
+ }
+ file = ((FileEditorInput)input).getFile();
+ try {
+ String pref = ModelPatchPreferenceProvider.INSTANCE.getSerializationType();
+ originalModelPatch = serializerProvider.getSelectedSerializer(pref).load(new File(file.getLocation().toOSString()));
+ modifiedModelPatch = originalModelPatch;
+ } catch (ModelPatchException e) {
+ throw new PartInitException(e.getMessage(), new Throwable(e));
+ }
+ this.setInput(input);
+ this.setSite(site);
+ setPartName("ModelPatch: "+file.getName());
+ }
+
+ @Override
+ public boolean isDirty() {
+ return !originalModelPatch.equals(modifiedModelPatch);
+ }
+
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ filterApplier = new ModelPatchFilterApplier();
+ file = null;
+ originalModelPatch = null;
+ modifiedModelPatch = null;
+ filters = null;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ComparisonSelectionUtil.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ComparisonSelectionUtil.xtend
new file mode 100644
index 0000000..b61b9e7
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ComparisonSelectionUtil.xtend
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.handlers
+
+import java.lang.reflect.InvocationTargetException
+import java.util.ArrayList
+import java.util.Collection
+import java.util.Collections
+import java.util.HashSet
+import java.util.List
+import java.util.Map.Entry
+import java.util.Set
+import org.eclipse.core.runtime.IProgressMonitor
+import org.eclipse.emf.common.util.EMap
+import org.eclipse.emf.diffmerge.api.IMatch
+import org.eclipse.emf.diffmerge.api.Role
+import org.eclipse.emf.diffmerge.api.diff.IDifference
+import org.eclipse.emf.diffmerge.api.diff.IPresenceDifference
+import org.eclipse.emf.diffmerge.diffdata.EMatch
+import org.eclipse.emf.diffmerge.ui.diffuidata.ComparisonSelection
+import org.eclipse.emf.diffmerge.ui.viewers.EMFDiffNode
+import org.eclipse.emf.diffmerge.ui.viewers.MergeImpactViewer.ImpactInput
+import org.eclipse.jface.operation.IRunnableWithProgress
+import org.eclipse.ui.PlatformUI
+import org.eclipse.ui.progress.IProgressService
+
+class ComparisonSelectionUtil {
+
+ protected def Collection<IDifference> getDiffsToMerge(ComparisonSelection selection, boolean toLeft_p,
+ EMFDiffNode input) {
+ val showImpact = input.isShowMergeImpact();
+ input.setDefaultShowImpact(false);
+ val Role destination = Role.REFERENCE;
+ val isCoverChildren = true;
+ val isIncrementalMode = false;
+ val List<EMatch> selectedMatches = getSelectedMatchesForInteractions(selection)
+ val Collection<IDifference> toMerge = if (!selectedMatches.isEmpty()) {
+ getDifferencesToMerge(selectedMatches, destination, isCoverChildren, isIncrementalMode, input)
+ } else {
+ input.categoryManager.getPendingDifferencesFiltered(selection.asDifferencesToMerge())
+ }
+ val ImpactInput mergeInput = new ImpactInput(toMerge, toLeft_p, input);
+ val IProgressService progress = PlatformUI.getWorkbench().getProgressService();
+ try {
+ progress.busyCursorWhile(new IRunnableWithProgress() {
+ /**
+ * @see IRunnableWithProgress#run(IProgressMonitor)
+ */
+ override void run(IProgressMonitor monitor_p) throws InvocationTargetException, InterruptedException {
+ mergeInput.compute(monitor_p);
+ }
+ });
+ } catch (Exception ex) {
+ return null;
+ }
+ input.setDefaultShowImpact(showImpact);
+
+ val EMap<IMatch, Collection<IDifference>> explicitImpacts = mergeInput.getImpact(true);
+ val EMap<IMatch, Collection<IDifference>> implicitImpacts = mergeInput.getImpact(false);
+ val Set<IDifference> diffs = new HashSet<IDifference>();
+ for (Entry<IMatch, Collection<IDifference>> impact : implicitImpacts) {
+ diffs.addAll(impact.getValue());
+ }
+ for (Entry<IMatch, Collection<IDifference>> impact : explicitImpacts) {
+ diffs.addAll(impact.getValue());
+ }
+
+ return diffs;
+ }
+
+ protected def List<EMatch> getSelectedMatchesForInteractions(ComparisonSelection selection_p) {
+ var List<EMatch> selectedMatches = selection_p.getSelectedMatches();
+ if (selectedMatches.isEmpty()) {
+ val List<EMatch> treePath = selection_p.getSelectedTreePath();
+ if (!treePath.isEmpty()) {
+ selectedMatches = Collections.singletonList(treePath.get(treePath.size() - 1));
+ }
+ }
+ return selectedMatches;
+ }
+
+ /**
+ * Copied from {@link org.eclipse.emf.diffmerge.ui.viewers.ComparisonViewer}
+ *
+ * Return the differences to merge from a given list of selected matches and the given
+ * criteria
+ * @param selectedMatches_p a non-null list
+ * @param coverChildren_p whether children of the matches must be covered
+ * @param incrementalMode_p whether optional deletions must be skipped
+ * @return a non-null, potentially empty, unmodifiable list
+ */
+ protected def List<IDifference> getDifferencesToMerge(List<EMatch> selectedMatches_p, Role destination_p,
+ boolean coverChildren_p, boolean incrementalMode_p, EMFDiffNode input) {
+ val List<IDifference> result = new ArrayList<IDifference>();
+ val IProgressService progress = PlatformUI.getWorkbench().getProgressService();
+ try {
+ progress.busyCursorWhile(new IRunnableWithProgress() {
+ /**
+ * @see IRunnableWithProgress#run(IProgressMonitor)
+ */
+ override void run(IProgressMonitor monitor_p) throws InvocationTargetException, InterruptedException {
+ for (EMatch selectedMatch : selectedMatches_p) {
+ if (coverChildren_p) {
+ addDifferencesToMergeRec(result, selectedMatch, destination_p, incrementalMode_p, input);
+ } else {
+ addDifferencesToMerge(result, selectedMatch, destination_p, incrementalMode_p, input);
+ }
+ }
+ }
+ });
+ } catch (Exception e) {
+ // Proceed
+ }
+ return Collections.unmodifiableList(result);
+ }
+
+ /**
+ * Copied from {@link org.eclipse.emf.diffmerge.ui.viewers.ComparisonViewer}
+ *
+ * Add differences to merge on the given match to the given list according
+ * to the given criteria
+ * @param toMerge_p a non-null, modifiable list
+ * @param match_p a non-null match
+ * @param destination_p a non-null role which is TARGET or REFEREBCE
+ * @param incrementalMode_p whether optional deletions must be skipped
+ */
+ protected def void addDifferencesToMerge(List<IDifference> toMerge_p, IMatch match_p, Role destination_p,
+ boolean incrementalMode_p, EMFDiffNode input) {
+ for (IDifference difference : match_p.getAllDifferences()) {
+ if (!input.getCategoryManager().isFiltered(difference)) {
+ if (!incrementalMode_p || difference instanceof IPresenceDifference &&
+ (difference as IPresenceDifference).getPresenceRole() != destination_p)
+ toMerge_p.add(difference);
+ }
+ }
+ }
+
+ /**
+ * Copied from {@link org.eclipse.emf.diffmerge.ui.viewers.ComparisonViewer}
+ *
+ * Add differences to merge on the given match and its children to the given list according
+ * to the given criteria
+ * @param toMerge_p a non-null, modifiable list
+ * @param match_p a non-null match
+ * @param destination_p a non-null role which is TARGET or REFEREBCE
+ * @param incrementalMode_p whether optional deletions must be skipped
+ */
+ protected def void addDifferencesToMergeRec(List<IDifference> toMerge_p, IMatch match_p, Role destination_p,
+ boolean incrementalMode_p, EMFDiffNode input) {
+ addDifferencesToMerge(toMerge_p, match_p, destination_p, incrementalMode_p, input);
+ for (IMatch child : input.getCategoryManager().getChildrenForMerge(match_p)) {
+ addDifferencesToMergeRec(toMerge_p, child, destination_p, incrementalMode_p, input);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ModelpatchApplicationHandler.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ModelpatchApplicationHandler.xtend
new file mode 100644
index 0000000..e1a2de6
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ModelpatchApplicationHandler.xtend
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.handlers
+
+import org.eclipse.emf.diffmerge.patch.ui.utils.DialogFactory
+import org.eclipse.emf.diffmerge.patch.ui.wizards.ModelpatchApplicationWizard
+import org.eclipse.core.commands.AbstractHandler
+import org.eclipse.core.commands.ExecutionEvent
+import org.eclipse.core.commands.ExecutionException
+import org.eclipse.emf.ecore.EObject
+import org.eclipse.emf.ecore.resource.Resource
+import org.eclipse.jface.viewers.IStructuredSelection
+import org.eclipse.jface.wizard.WizardDialog
+import org.eclipse.swt.widgets.Shell
+import org.eclipse.ui.handlers.HandlerUtil
+
+class ModelpatchApplicationHandler extends AbstractHandler {
+ public static val ID = "org.eclipse.emf.diffmerge.patch"
+
+ Shell shell
+
+ override Object execute(ExecutionEvent event) throws ExecutionException {
+ try {
+ shell = HandlerUtil.getActiveShell(event)
+ (HandlerUtil.getCurrentSelection(event) as IStructuredSelection).executePatch
+ } catch(Exception ex) {
+ val factory = new DialogFactory(shell)
+ factory.openErrorDialog("Modelpatch Application Problem", "Patch cannot be applied!", ex, ID)
+ ex.printStackTrace
+ }
+ return null
+ }
+
+
+ private dispatch def void executePatch(IStructuredSelection strucSelection) {
+ strucSelection.firstElement.executePatch
+ }
+ private dispatch def void executePatch(EObject eobj) {
+ eobj.eResource.executePatch
+ }
+ private dispatch def void executePatch(Resource resource) {
+ // Show ModelpatchApplicationWizard for patch file and filters
+ val wizard = new WizardDialog(shell, new ModelpatchApplicationWizard(resource))
+ wizard.open
+ }
+}
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
new file mode 100644
index 0000000..2a74e18
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/handlers/ModelpatchGenerationHandler.xtend
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.handlers
+
+import java.io.File
+import org.eclipse.core.commands.AbstractHandler
+import org.eclipse.core.commands.ExecutionEvent
+import org.eclipse.core.commands.ExecutionException
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchException
+import org.eclipse.emf.diffmerge.patch.runtime.ModelPatchRecorder
+import org.eclipse.emf.diffmerge.patch.ui.preferences.ModelPatchPreferenceProvider
+import org.eclipse.emf.diffmerge.patch.ui.utils.DialogFactory
+import org.eclipse.emf.diffmerge.patch.ui.utils.SerializerProvider
+import org.eclipse.emf.diffmerge.ui.diffuidata.ComparisonSelection
+import org.eclipse.emf.diffmerge.ui.setup.EMFDiffMergeEditorInput
+import org.eclipse.jface.viewers.IStructuredSelection
+import org.eclipse.swt.widgets.Shell
+import org.eclipse.ui.IWorkbench
+import org.eclipse.ui.handlers.HandlerUtil
+
+class ModelpatchGenerationHandler extends AbstractHandler {
+ public static val String MODELPATCH_GENERATION_ERROR_TITLE = "Model Patch Generation Error"
+ extension ModelPatchPreferenceProvider = ModelPatchPreferenceProvider.INSTANCE
+ extension ComparisonSelectionUtil util = new ComparisonSelectionUtil
+
+ override Object execute(ExecutionEvent event) throws ExecutionException {
+ val shell = HandlerUtil.getActiveShell(event)
+ val workbench = HandlerUtil.getActiveWorkbenchWindow(event).workbench
+ var IStructuredSelection selection = null
+
+ try {
+ selection = HandlerUtil.getCurrentSelection(event) as IStructuredSelection
+ } catch (Exception ex) {
+ ex.printStackTrace
+ }
+
+ val part = HandlerUtil.getActiveEditorInput(event)
+ if (part instanceof EMFDiffMergeEditorInput){
+ val diffNode = part.compareResult
+ val comparison = diffNode.actualComparison
+ if (selection instanceof ComparisonSelection){
+ val diffs = selection.getDiffsToMerge(false, diffNode)
+ if(!diffs.empty) {
+ diffs.generatePatch(shell, workbench, selection)
+ }
+ } else {
+ comparison.generatePatch(shell, workbench, selection)
+ }
+ }
+ return null
+ }
+
+ public def Object generatePatch(Object diff, Shell shell, IWorkbench workbench, IStructuredSelection selection) {
+ extension val DialogFactory factory = new DialogFactory(shell)
+ val SerializerProvider serializerProvider = new SerializerProvider
+ try {
+ val path = openSaveFileDialog(workbench, selection,"modelpatch")
+ if (path != null) {
+ val modelPatchRecorder = new ModelPatchRecorder
+ val generatedPatch = modelPatchRecorder.generateModelPatch(diff)
+ val patchFile = path.location.toFile
+ serializerProvider.getSelectedSerializer(serializationType).serialize(generatedPatch,patchFile)
+
+ if(isFileGenerated(patchFile)==true) {
+ openModelPatchEditor(workbench.activeWorkbenchWindow, path);
+ } else {
+ openErrorDialog(MODELPATCH_GENERATION_ERROR_TITLE, '''File cannot be created at the following path: «path»''')
+ }
+ } else {
+ openInformationDialog("Model Patch Generation Information", "No file has been selected!")
+ }
+ } catch (ModelPatchException ex) {
+ openErrorDialog(MODELPATCH_GENERATION_ERROR_TITLE, "Modelpatch generation finished with errors!", ex, "org.eclipse.emf.diffmerge.patch")
+ } catch (ClassCastException ex) {
+ openErrorDialog(MODELPATCH_GENERATION_ERROR_TITLE, "Patch generation only works from EMF Diff/Merge!")
+ } catch (Exception ex) {
+ ex.printStackTrace
+ openErrorDialog(MODELPATCH_GENERATION_ERROR_TITLE, "Unknown error!", ex, "org.eclipse.emf.diffmerge.patch")
+ }
+ return null
+ }
+
+ def boolean isFileGenerated(File file) {
+ return file.exists
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/preferences/ModelPatchPreferencePage.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/preferences/ModelPatchPreferencePage.java
new file mode 100644
index 0000000..caa1256
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/preferences/ModelPatchPreferencePage.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.preferences;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.RadioGroupFieldEditor;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.emf.diffmerge.patch.runtime.modelaccess.ModelAccessTypes;
+import org.eclipse.emf.diffmerge.patch.ui.Activator;
+import org.eclipse.emf.diffmerge.patch.ui.utils.SerializationTypes;
+
+public class ModelPatchPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ public ModelPatchPreferencePage() {
+ super(GRID);
+
+ }
+
+ public void createFieldEditors() {
+
+ addField(new RadioGroupFieldEditor(ModelPatchPreferenceProvider.MODELACCESS_PREFERENCE_ID, "Model access:", 1,
+ new String[][] { { "EMF Reflective Model Access", ModelAccessTypes.EMF_REFLECTIVE.toString() },
+ { "Editing Domain Aware Model Access", ModelAccessTypes.VIATRA.toString() } },
+ getFieldEditorParent()));
+
+ addField(new RadioGroupFieldEditor(ModelPatchPreferenceProvider.SERIALIZER_PREFERENCE_ID, "Serialization:", 1,
+ new String[][] { { "Jackson - JSON", SerializationTypes.JACKSON.toString() },
+ { "GSON - JSON", SerializationTypes.GSON.toString() },
+ { "Jackson - BSON", SerializationTypes.BSON.toString() } },
+ getFieldEditorParent()));
+ }
+
+ @Override
+ public void init(IWorkbench workbench) {
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/preferences/ModelPatchPreferenceProvider.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/preferences/ModelPatchPreferenceProvider.java
new file mode 100644
index 0000000..f9e7288
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/preferences/ModelPatchPreferenceProvider.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.preferences;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.diffmerge.patch.runtime.modelaccess.ModelAccessTypes;
+import org.eclipse.emf.diffmerge.patch.ui.utils.SerializationTypes;
+
+public enum ModelPatchPreferenceProvider {
+ INSTANCE;
+
+ public static String PREFERENCES_ID = "org.eclipse.emf.diffmerge.patch.gui";
+ public static String SERIALIZER_PREFERENCE_ID = "ModelPatch.Serializer";
+ public static String MODELACCESS_PREFERENCE_ID = "ModelPatch.ModelAccess";
+
+ public String getSerializationType() {
+ return Platform.getPreferencesService().getString(PREFERENCES_ID,
+ SERIALIZER_PREFERENCE_ID, SerializationTypes.JACKSON.toString(), null);
+ }
+
+ public String getModelAccessType() {
+ return Platform.getPreferencesService().getString(PREFERENCES_ID, MODELACCESS_PREFERENCE_ID,
+ ModelAccessTypes.EMF_REFLECTIVE.toString(), null);
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/DefaultEntryLabelProvider.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/DefaultEntryLabelProvider.xtend
new file mode 100644
index 0000000..976cad7
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/DefaultEntryLabelProvider.xtend
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils
+
+import org.eclipse.emf.diffmerge.patch.AttributeEntry
+import org.eclipse.emf.diffmerge.patch.ElementEntry
+import org.eclipse.emf.diffmerge.patch.ReferenceEntry
+import org.eclipse.emf.diffmerge.patch.StructuralFeatureEntry
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry
+
+class DefaultEntryLabelProvider implements IEntryLabelProvider {
+
+ override getLabel(ModelPatchEntry entry) {
+ return entry.toString
+ }
+
+ override shortDescription(ModelPatchEntry entry) '''«entry.direction.toString.toLowerCase.toFirstUpper» «entry.entryType.toString.toLowerCase.toFirstUpper»'''
+
+ override getPropertyList(ModelPatchEntry entry) {
+ val props = <EntryPropertyWrapper>newArrayList
+
+ props.add(new EntryPropertyWrapper("context", entry.context))
+
+ if (entry instanceof ElementEntry) {
+ props.add(new EntryPropertyWrapper("type", entry.type))
+ }
+
+ if (entry instanceof StructuralFeatureEntry) {
+ props.add(new EntryPropertyWrapper("feature", entry.feature))
+ if(entry.index.isPresent) {
+ props.add(new EntryPropertyWrapper("index", entry.index))
+ }
+
+ if (entry instanceof AttributeEntry) {
+ props.add(new EntryPropertyWrapper("value", entry.value))
+ } else if (entry instanceof ReferenceEntry) {
+ props.add(new EntryPropertyWrapper("target", entry.target))
+ }
+ }
+
+ return props
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/DescriptiveEntryLabelProvider.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/DescriptiveEntryLabelProvider.xtend
new file mode 100644
index 0000000..867c1c2
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/DescriptiveEntryLabelProvider.xtend
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils
+
+import org.eclipse.emf.diffmerge.patch.AttributeEntry
+import org.eclipse.emf.diffmerge.patch.ElementEntry
+import org.eclipse.emf.diffmerge.patch.ReferenceEntry
+import org.eclipse.emf.diffmerge.patch.api.ChangeDirection
+import org.eclipse.emf.diffmerge.patch.api.Identifiable
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry
+import org.eclipse.emf.diffmerge.patch.StructuralFeatureEntry
+
+class DescriptiveEntryLabelProvider extends DefaultEntryLabelProvider {
+
+ override getLabel(ModelPatchEntry entry) {
+ return entry.shortPrettyPrint
+ }
+
+ private dispatch def String shortPrettyPrint(ModelPatchEntry entry) '''«entry.direction» «entry.entryType» «IF entry.direction==ChangeDirection.ADD»TO«ELSE»FROM«ENDIF» «entry.context.identifier»'''
+ private dispatch def String shortPrettyPrint(ElementEntry entry) '''«entry.direction.decodeDirectionLabel(true).toFirstUpper» '«entry.context.identifier»' (type: '«entry.type.typeString»')'''
+ private dispatch def String shortPrettyPrint(AttributeEntry entry) {
+ if(entry.index==null || !entry.index.present) {
+ return '''«entry.direction.decodeDirectionLabel(false).toFirstUpper» '«entry.feature.featureString»' attribute of '«entry.context.identifier»' «IF entry.direction==ChangeDirection.ADD»to '«entry.value»'«ELSE»(old value: «entry.value»)«ENDIF»'''
+ } else {
+ return '''«entry.direction.decodeDirectionLabel(true).toFirstUpper» '«entry.value»' value «entry.direction.toFrom» the '«entry.feature.featureString»' «entry.listEnding»'''
+ }
+ }
+ private dispatch def String shortPrettyPrint(ReferenceEntry entry) {
+ if(entry.index==null || !entry.index.present) {
+ return '''«entry.direction.decodeDirectionLabel(false).toFirstUpper» '«entry.feature.featureString»' reference of '«entry.context.identifier»'«IF entry.direction==ChangeDirection.ADD» to '«entry.target.identifier»'«ELSE» (old target: '«entry.target.identifier»')«ENDIF»'''
+ } else {
+ return '''«entry.direction.decodeDirectionLabel(true).toFirstUpper» reference to '«entry.target.identifier»' «entry.direction.toFrom» the '«entry.feature.featureString»' «entry.listEnding»'''
+ }
+ }
+
+ def String getListEnding(StructuralFeatureEntry entry) '''list of '«entry.context.identifier»' (index: «entry.index.get»)'''
+
+ private def String decodeDirectionLabel(ChangeDirection direction, boolean isAddRemove) {
+ if(isAddRemove) {
+ if(direction==ChangeDirection.ADD) {
+ return "add"
+ } else {
+ return "remove"
+ }
+ } else {
+ if(direction==ChangeDirection.ADD) {
+ return "set"
+ } else {
+ return "unset"
+ }
+ }
+ }
+
+ private def String toFrom(ChangeDirection direction) {
+ if(direction==ChangeDirection.ADD) {
+ return "to"
+ } else {
+ return "from"
+ }
+ }
+
+ private def getTypeString(Identifiable identifiable) {
+ return identifiable.identifier//.split('#').last
+ }
+
+ private def String getFeatureString(Identifiable identifiable) {
+ return identifiable.identifier//.split("#").last.split(Pattern.quote(".")).last
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/DialogFactory.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/DialogFactory.xtend
new file mode 100644
index 0000000..8cc3721
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/DialogFactory.xtend
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils
+
+import org.eclipse.core.resources.IFile
+import org.eclipse.core.resources.IResource
+import org.eclipse.core.resources.ResourcesPlugin
+import org.eclipse.core.runtime.CoreException
+import org.eclipse.core.runtime.IStatus
+import org.eclipse.core.runtime.MultiStatus
+import org.eclipse.core.runtime.Status
+import org.eclipse.jface.dialogs.ErrorDialog
+import org.eclipse.jface.dialogs.MessageDialog
+import org.eclipse.jface.viewers.IStructuredSelection
+import org.eclipse.jface.window.Window
+import org.eclipse.jface.wizard.WizardDialog
+import org.eclipse.swt.SWT
+import org.eclipse.swt.widgets.FileDialog
+import org.eclipse.swt.widgets.Shell
+import org.eclipse.ui.IWorkbench
+import org.eclipse.ui.IWorkbenchWindow
+import org.eclipse.ui.PartInitException
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage
+import org.eclipse.ui.ide.IDE
+import org.eclipse.ui.model.WorkbenchContentProvider
+import org.eclipse.ui.model.WorkbenchLabelProvider
+import org.eclipse.ui.wizards.newresource.BasicNewFileResourceWizard
+
+class DialogFactory {
+ private val Shell shell
+
+ new(Shell shell) {
+ this.shell = shell
+ }
+
+ public def openInformationDialog(String title, String message) {
+ MessageDialog.openInformation(shell, title, message);
+ }
+
+ public def openFileDialog(String[] supportedFileExtensions) {
+ return openFileDialog("File Selection", supportedFileExtensions)
+ }
+
+ public def openFileDialog(String title, String[] supportedFileExtensions) {
+ (new FileDialog(shell, SWT.OPEN) => [
+ it.text = title
+ it.filterExtensions = supportedFileExtensions
+ ]).open
+ }
+
+ public def openSaveFileDialog(IWorkbench workbench, IStructuredSelection selection, String fextension) {
+ val wizard = new BasicNewFileResourceWizard() {
+ public String path = null
+ public IFile file = null
+ private WizardNewFileCreationPage mainPage
+
+ override addPages() {
+ super.addPages()
+ mainPage = (pages.get(0) as WizardNewFileCreationPage)
+ mainPage.fileExtension = fextension
+ }
+
+ override performFinish() {
+ file = mainPage.createNewFile();
+ if (file == null) {
+ return false
+ }
+
+ selectAndReveal(file)
+ if(file.location!=null) {
+ path = file.location.toString
+ }
+
+ return true;
+ }
+
+
+
+ } => [
+ it.windowTitle = "Modelpatch file"
+ ]
+ wizard.init(workbench, selection)
+ val dialog = new WizardDialog(shell, wizard) => [
+ it.blockOnOpen = true
+ ]
+ dialog.open()
+ return wizard.file
+ }
+
+ public def openModelPatchEditor(IWorkbenchWindow window, IFile file) {
+ try {
+ if (window != null) {
+ val page = window.getActivePage()
+ if (page != null) {
+ IDE.openEditor(page, file, true)
+ }
+ }
+ } catch (PartInitException e) {
+ openError(window.getShell(), "Modelpatch editor cannot be opened",e.getMessage(), e)
+ }
+ }
+
+ public def openWorkspaceFileDialog() {
+ return openWorkspaceFileDialog("File Selection")
+ }
+
+ public def openWorkspaceFileDialog(String title) {
+ val dialog = new ElementTreeSelectionDialog(shell, new WorkbenchLabelProvider(), new WorkbenchContentProvider())
+
+ dialog.title = title
+ dialog.setInput(ResourcesPlugin.getWorkspace().getRoot())
+ dialog.setAllowMultiple(false)
+
+ if (dialog.open() == Window.OK) {
+ return (dialog.firstResult as IResource).location.toOSString
+ }
+ return null
+ }
+
+ public def openErrorDialog(String dialogTitle, String message, String errorMessage, Throwable ex, String ID) {
+ ErrorDialog.openError(shell, dialogTitle, message, createMultiStatus(errorMessage, ex, ID))
+ }
+
+ public def openErrorDialog(String dialogTitle, String message, Throwable ex, String ID) {
+ ErrorDialog.openError(shell, dialogTitle, message, createMultiStatus(ex.getMessage(), ex, ID))
+ }
+
+ public def openErrorDialog(String dialogTitle, String message) {
+ MessageDialog.openError(shell, dialogTitle, message)
+ }
+
+ /**
+ * Copied from {@link org.eclipse.ui.internal.ide.DialogUtil#openError(Shell, String, String, PartInitException)}
+ */
+ private def void openError(Shell parent, String title, String message, PartInitException exception) {
+ // Check for a nested CoreException
+ var CoreException nestedException = null
+ var status = exception.getStatus()
+ if (status !== null && status.getException() instanceof CoreException) {
+ nestedException = status.getException() as CoreException
+ }
+ if (nestedException !== null) {
+ // Open an error dialog and include the extra
+ // status information from the nested CoreException
+ ErrorDialog.openError(parent, title, message, nestedException.getStatus())
+ } else {
+ // Open a regular error dialog since there is no
+ // extra information to display. Don't use SWT.SHEET because
+ // we don't know if the title contains important information.
+ MessageDialog.openError(parent, title, message)
+ }
+ }
+
+ private def MultiStatus createMultiStatus(String msg, Throwable t, String ID) {
+ val childStatuses = <Status>newArrayList
+ val stackTraces = t.getStackTrace()
+
+ for (StackTraceElement stackTrace : stackTraces) {
+ val status = new Status(IStatus.ERROR, ID, stackTrace.toString)
+ childStatuses.add(status)
+ }
+
+ return new MultiStatus(ID, IStatus.ERROR, childStatuses.toArray(#[]), t.toString(), t)
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/EntryPropertyWrapper.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/EntryPropertyWrapper.java
new file mode 100644
index 0000000..85b6f25
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/EntryPropertyWrapper.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils;
+
+import org.eclipse.emf.diffmerge.patch.api.Identifiable;
+
+import com.google.common.base.Optional;
+
+public class EntryPropertyWrapper {
+ public String prop = "";
+ public String value = "";
+
+ public EntryPropertyWrapper(String prop, String value) {
+ this.prop = prop;
+ this.value = value;
+ }
+ public EntryPropertyWrapper(String prop, Identifiable value) {
+ this.prop = prop;
+ this.value = value.getIdentifier();
+ }
+ public EntryPropertyWrapper(String prop, Optional<? extends Object> value) {
+ this.prop = prop;
+ this.value = value.isPresent()?value.get().toString():"No value";
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/IEntryLabelProvider.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/IEntryLabelProvider.java
new file mode 100644
index 0000000..fdfec1b
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/IEntryLabelProvider.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils;
+
+import java.util.List;
+
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry;
+
+public interface IEntryLabelProvider {
+ public String shortDescription(ModelPatchEntry entry);
+
+ public String getLabel(ModelPatchEntry entry);
+
+ public List<EntryPropertyWrapper> getPropertyList(ModelPatchEntry entry);
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/IdentifiableWrapper.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/IdentifiableWrapper.java
new file mode 100644
index 0000000..51ca3e8
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/IdentifiableWrapper.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils;
+
+public class IdentifiableWrapper {
+ public String name;
+ public String ident;
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/IdentifiableWrapperFactory.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/IdentifiableWrapperFactory.java
new file mode 100644
index 0000000..c8f1f89
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/IdentifiableWrapperFactory.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils;
+
+import org.eclipse.emf.diffmerge.patch.api.Identifiable;
+
+public enum IdentifiableWrapperFactory {
+ INSTANCE;
+
+ public IdentifiableWrapper create(Identifiable ident, String name) {
+ return create(ident.getIdentifier(), name);
+ }
+ public IdentifiableWrapper create(String ident, String name) {
+ IdentifiableWrapper wrapper = new IdentifiableWrapper();
+ wrapper.name = name;
+ wrapper.ident = ident;
+ return wrapper;
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchContentProvider.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchContentProvider.xtend
new file mode 100644
index 0000000..ac5cfcf
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchContentProvider.xtend
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils
+
+import org.eclipse.emf.diffmerge.patch.api.ModelPatch
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry
+import java.util.List
+import org.eclipse.jface.viewers.ITreeContentProvider
+import org.eclipse.jface.viewers.Viewer
+
+class ModelPatchContentProvider implements ITreeContentProvider {
+
+ override void dispose() {}
+
+ override void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+
+ override Object[] getElements(Object inputElement) {
+ if(inputElement==null) {
+ return newArrayList
+ }
+ return inputElement.allElements
+ }
+
+ override Object[] getChildren(Object parentElement) {
+ return parentElement.allElements
+ }
+
+ override Object getParent(Object element) {
+ return null
+ }
+
+ override boolean hasChildren(Object element) {
+ return element.allElements.size>0
+ }
+
+ private dispatch def List<? extends Object> getAllElements(Object patch) {
+ return newArrayList
+ }
+ private dispatch def List<? extends Object> getAllElements(ModelPatch patch) {
+ return patch.entries
+ }
+ private dispatch def List<? extends Object> getAllElements(ModelPatchEntry ee) {
+ return newArrayList
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchEntryFilterContentProvider.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchEntryFilterContentProvider.xtend
new file mode 100644
index 0000000..83903cc
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchEntryFilterContentProvider.xtend
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils
+
+import java.util.List
+import org.eclipse.jface.viewers.IStructuredContentProvider
+import org.eclipse.jface.viewers.Viewer
+
+class ModelPatchEntryFilterContentProvider implements IStructuredContentProvider {
+
+ override void dispose() {}
+
+ override void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+
+ override Object[] getElements(Object inputElement) {
+ if(inputElement==null) {
+ return newArrayList
+ }
+ return inputElement.allElements
+ }
+
+ private dispatch def List<? extends Object> getAllElements(Object object) {
+ return newArrayList
+ }
+ private dispatch def List<? extends Object> getAllElements(List list) {
+ return list
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchEntryFilterLabelProvider.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchEntryFilterLabelProvider.xtend
new file mode 100644
index 0000000..02726b7
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchEntryFilterLabelProvider.xtend
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils
+
+import org.eclipse.jface.viewers.ILabelProvider
+import org.eclipse.jface.viewers.ILabelProviderListener
+import org.eclipse.emf.diffmerge.patch.api.filters.ComplexEntryFilter
+import org.eclipse.emf.diffmerge.patch.api.filters.EntryDirectionFilter
+import org.eclipse.emf.diffmerge.patch.api.filters.EntryTypeFilter
+
+class ModelPatchEntryFilterLabelProvider implements ILabelProvider {
+
+ override getImage(Object element) {}
+
+ override getText(Object element) {
+ return element.label
+ }
+
+ private dispatch def String getLabel(Object object) {
+ return object.toString
+ }
+ private dispatch def String getLabel(ComplexEntryFilter filter) '''«filter.type.name»'''
+ private dispatch def String getLabel(EntryDirectionFilter filter) '''Filtered direction: «filter.filteredDirection.name»'''
+ private dispatch def String getLabel(EntryTypeFilter filter) '''Filtered entry types: «FOR type : filter.filteredTypes SEPARATOR ", "»«type.name»«ENDFOR»'''
+
+ override addListener(ILabelProviderListener listener) {}
+
+ override dispose() {}
+
+ override isLabelProperty(Object element, String property) {
+ return true
+ }
+
+ override removeListener(ILabelProviderListener listener) {}
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchEntryHelper.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchEntryHelper.xtend
new file mode 100644
index 0000000..0ed9ba9
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchEntryHelper.xtend
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils
+
+import org.eclipse.emf.diffmerge.patch.ElementEntry
+import org.eclipse.emf.diffmerge.patch.AttributeEntry
+import org.eclipse.emf.diffmerge.patch.ReferenceEntry
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry
+
+class ModelPatchEntryHelper {
+ dispatch def String stringRepresentation(ElementEntry entry) '''
+ ElementEntry
+ * Direction: «entry.direction.name»
+ * ID: «entry.context.identifier»
+ * Type: «entry.type.identifier»
+ '''
+ dispatch def String stringRepresentation(AttributeEntry entry) '''
+ AttributeEntry
+ * Direction: «entry.direction.name»
+ * Attribute owner: «entry.context.identifier»
+ * Attribute: «entry.feature.identifier»
+ * Value: «entry.value»
+ '''
+ dispatch def String stringRepresentation(ReferenceEntry entry) '''
+ ReferenceEntry
+ * Direction: «entry.direction.name»
+ * Reference owner: «entry.context.identifier»
+ * Reference: «entry.feature.identifier»
+ * Target: «entry.target.identifier»
+ '''
+ dispatch def String stringRepresentation(ModelPatchEntry entry) {
+ return entry.toString
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchLabelProvider.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchLabelProvider.xtend
new file mode 100644
index 0000000..085841c
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelPatchLabelProvider.xtend
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils
+
+import org.eclipse.jface.viewers.ILabelProvider
+import org.eclipse.jface.viewers.ILabelProviderListener
+import org.eclipse.emf.diffmerge.patch.api.ModelPatch
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry
+
+class ModelPatchLabelProvider implements ILabelProvider {
+ IEntryLabelProvider entryLabelProvider
+
+ new() {
+ entryLabelProvider = new DefaultEntryLabelProvider
+ }
+
+ new(IEntryLabelProvider entryLabelProvider) {
+ this.entryLabelProvider = entryLabelProvider
+ }
+
+ override getImage(Object element) {
+ return null
+ }
+
+ override getText(Object element) {
+ return element.label
+ }
+
+ override addListener(ILabelProviderListener listener) {}
+
+ override dispose() {}
+
+ override isLabelProperty(Object element, String property) {
+ return true
+ }
+
+ override removeListener(ILabelProviderListener listener) {}
+
+
+ private dispatch def String getLabel(ModelPatch patch) {
+ return '''ModelPatch [«patch.entries.size»]'''
+ }
+ private dispatch def String getLabel(ModelPatchEntry entry) {
+ return entryLabelProvider.getLabel(entry)
+ }
+ private dispatch def String getLabel(IdentifiableWrapper wrapper) {
+ return '''«wrapper.name»: «wrapper.ident»'''
+ }
+ private dispatch def String getLabel(Object object) {
+ return object.toString
+ }
+
+ def correctCase(String string) {
+ return string.toLowerCase.toFirstUpper
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelpatchApplicationDTO.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelpatchApplicationDTO.xtend
new file mode 100644
index 0000000..743ed9d
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/ModelpatchApplicationDTO.xtend
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils
+
+import java.io.File
+import org.apache.log4j.Logger
+import org.eclipse.core.runtime.IProgressMonitor
+import org.eclipse.core.runtime.NullProgressMonitor
+import org.eclipse.emf.common.command.AbstractCommand
+import org.eclipse.emf.common.command.Command
+import org.eclipse.emf.common.util.URI
+import org.eclipse.emf.diffmerge.api.IDiffPolicy
+import org.eclipse.emf.diffmerge.api.IMatchPolicy
+import org.eclipse.emf.diffmerge.api.IMergePolicy
+import org.eclipse.emf.diffmerge.api.scopes.IEditableModelScope
+import org.eclipse.emf.diffmerge.diffdata.EComparison
+import org.eclipse.emf.diffmerge.diffdata.impl.EComparisonImpl
+import org.eclipse.emf.diffmerge.impl.policies.DefaultDiffPolicy
+import org.eclipse.emf.diffmerge.impl.policies.DefaultMatchPolicy
+import org.eclipse.emf.diffmerge.impl.policies.DefaultMergePolicy
+import org.eclipse.emf.diffmerge.impl.scopes.FragmentedModelScope
+import org.eclipse.emf.diffmerge.patch.api.IModelPatchEntryFilter
+import org.eclipse.emf.diffmerge.patch.api.ModelPatch
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchFilterApplier
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchReverser
+import org.eclipse.emf.diffmerge.patch.api.PatchApplication
+import org.eclipse.emf.diffmerge.patch.runtime.EMFModelPatchApplier
+import org.eclipse.emf.diffmerge.patch.runtime.identifier.BaseIndexEObjectLocator
+import org.eclipse.emf.diffmerge.patch.runtime.modelaccess.EMFModelAccess
+import org.eclipse.emf.diffmerge.patch.runtime.modelaccess.ModelAccessProvider
+import org.eclipse.emf.diffmerge.patch.ui.preferences.ModelPatchPreferenceProvider
+import org.eclipse.emf.diffmerge.ui.viewers.EMFDiffNode
+import org.eclipse.emf.ecore.resource.Resource
+import org.eclipse.emf.ecore.resource.ResourceSet
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
+import org.eclipse.emf.ecore.util.EcoreUtil
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain
+import org.eclipse.emf.edit.domain.EditingDomain
+import org.eclipse.viatra.query.runtime.base.api.BaseIndexOptions
+import org.eclipse.viatra.query.runtime.base.api.IndexingLevel
+import org.eclipse.viatra.query.runtime.base.api.ViatraBaseFactory
+
+import static com.google.common.base.Preconditions.*
+
+class ModelpatchApplicationDTO {
+ private extension ModelPatchFilterApplier applier = new ModelPatchFilterApplier
+ private extension ModelAccessProvider provider = new ModelAccessProvider
+ private extension SerializerProvider serializerProvider = new SerializerProvider
+ private extension ModelPatchPreferenceProvider = ModelPatchPreferenceProvider.INSTANCE
+
+ public Resource originalModel
+ public Resource modifiedModel
+
+ public String patchPath
+ public ModelPatch originalModelPatch
+ public ModelPatch modifiedModelPatch
+
+ public PatchApplication patchApplication
+
+ public EMFDiffNode diffNode
+ Command lastCommand
+ EditingDomain editingDomain
+
+
+
+ new(Resource originalModel) {
+ checkNotNull(originalModel, "Model cannot be null.")
+ this.originalModel=originalModel
+ }
+
+ def boolean loadPatch(String patchPath) {
+ if(!patchPath.isNullOrEmpty) {
+ try {
+ originalModelPatch = serializationType.selectedSerializer.load(new File(patchPath))
+ modifiedModelPatch = originalModelPatch
+ } catch(Exception ex) {
+ originalModelPatch = null
+ this.patchPath = patchPath
+ throw ex
+ }
+ } else {
+ originalModelPatch = null
+ return false
+ }
+ this.patchPath = patchPath
+ return true
+ }
+
+ def ModelPatch modifyPatch(boolean isReverse, IModelPatchEntryFilter... filters) {
+ if(isReverse) {
+ modifiedModelPatch = ModelPatchReverser.INSTANCE.reverse(originalModelPatch)
+ } else {
+ modifiedModelPatch = originalModelPatch
+ }
+ if(filters != null) {
+ for(filter : filters) {
+ if(filter!=null) modifiedModelPatch = modifiedModelPatch.applyFilter(filter)
+ }
+ }
+ return modifiedModelPatch
+ }
+
+ def PatchApplication applyPatch() {
+ modifiedModel = originalModel.createCopy('''Resolved Model''')
+ patchApplication = modifiedModel.applyPatch
+ return patchApplication
+ }
+
+ def void saveModel() {
+ val patchCommand = new AbstractCommand() {
+ public ModelPatch patch
+ public ModelPatch reversePatch
+ public Resource model
+
+ override execute() {
+ model.executePatchApplication(patch)
+ }
+
+ override redo() {
+ model.executePatchApplication(patch)
+ }
+
+ override undo() {
+ model.executePatchApplication(reversePatch)
+ }
+
+ override protected prepare() {
+ return true
+ }
+
+ private def void executePatchApplication(Resource resource, ModelPatch patch) {
+ val patchApplier = preparePatchApplier(resource.resourceSet)
+ patchApplication = patchApplier.apply(patch, resource.resourceSet)
+ }
+ }
+ patchCommand.model = originalModel
+ patchCommand.patch = modifiedModelPatch
+ patchCommand.reversePatch = ModelPatchReverser.INSTANCE.reverse(modifiedModelPatch)
+ AdapterFactoryEditingDomain.getEditingDomainFor(originalModel.contents.get(0)).commandStack.execute(patchCommand)
+ }
+
+ def EMFDiffNode prepareDiffNode() {
+ val IEditableModelScope targetScope = new FragmentedModelScope(modifiedModel, true)
+ editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(originalModel.contents.get(0))
+ lastCommand = editingDomain.commandStack.undoCommand
+ val IEditableModelScope referenceScope = new FragmentedModelScope(originalModel, false)
+
+ // Compute comparison
+ val IProgressMonitor aProgressMonitor = new NullProgressMonitor()
+ val IMergePolicy aMergePolicy = new DefaultMergePolicy()
+ val IDiffPolicy aDiffPolicy = new DefaultDiffPolicy()
+ val IMatchPolicy aMatchPolicy = new DefaultMatchPolicy()
+ val comparison = new EComparisonImpl(targetScope, referenceScope)
+ comparison.compute(aMatchPolicy, aDiffPolicy, aMergePolicy, aProgressMonitor)
+
+ // Turn comparison into an input for viewers
+ diffNode = new EMFDiffNode(comparison as EComparison, editingDomain) => [
+ it.setEditable(false, true) // Lock the tmp model in EMF Diff/Merge
+ ]
+ return diffNode
+ }
+
+ def void undoEDMModifications() {
+ if(lastCommand==null) {
+ while(lastCommand!=editingDomain.commandStack.undoCommand && editingDomain.commandStack.canUndo) {
+ editingDomain.commandStack.undo
+ }
+ } else {
+ while(editingDomain.commandStack.canUndo) {
+ editingDomain.commandStack.undo
+ }
+ }
+ }
+
+
+
+ private def PatchApplication applyPatch(Resource resource) {
+
+ val patchApplier = preparePatchApplier(resource.resourceSet)
+ return patchApplier.apply(modifiedModelPatch, resource.resourceSet)
+ }
+
+ def preparePatchApplier(ResourceSet resourceSet) {
+ val EMFModelAccess access = modelAccessType.getSelectedModelAccess(resourceSet)
+
+ val patchApplier = new EMFModelPatchApplier(access)
+ val navigationHelper = ViatraBaseFactory.getInstance().createNavigationHelper(resourceSet,new BaseIndexOptions(false, IndexingLevel.FULL), Logger.getLogger(class));
+ patchApplier.locator.EObjectLocator = new BaseIndexEObjectLocator(navigationHelper)
+ patchApplier
+ }
+
+ private def Resource createCopy(Resource copiable, String copyPath) {
+ val copyOfOriginalRS = new ResourceSetImpl
+ val copyRes = copyOfOriginalRS.createResource(URI.createURI(copyPath))
+ return copiable.copyTo(copyRes)
+ }
+
+ private def Resource copyTo(Resource copiable, Resource target) {
+ val copier = new EcoreUtil.Copier
+ if(target.contents!=null && target.contents.size>0) {
+ target.contents.clear
+ }
+ target.contents.addAll(copier.copyAll(copiable.contents))
+ copier.copyReferences
+ return target
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/SerializationTypes.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/SerializationTypes.java
new file mode 100644
index 0000000..bec2e0b
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/SerializationTypes.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils;
+
+public enum SerializationTypes {
+ JACKSON,
+ GSON,
+ BSON
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/SerializerProvider.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/SerializerProvider.xtend
new file mode 100644
index 0000000..be0e8f0
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/utils/SerializerProvider.xtend
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.utils
+
+import org.eclipse.emf.diffmerge.patch.serializer.gson.GsonModelPatchSerializer
+
+class SerializerProvider {
+ public def org.eclipse.emf.diffmerge.patch.serializer.IModelPatchSerializer getSelectedSerializer(String preference){
+ val accessType = SerializationTypes.valueOf(preference)
+
+ var org.eclipse.emf.diffmerge.patch.serializer.IModelPatchSerializer serializer
+ switch (accessType) {
+ case GSON: {
+ serializer = GsonModelPatchSerializer.create(this.class.classLoader)
+
+ }
+
+ default: {
+ serializer = GsonModelPatchSerializer.create(this.class.classLoader)
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/ModelpatchApplicationWizard.xtend b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/ModelpatchApplicationWizard.xtend
new file mode 100644
index 0000000..f36e168
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/ModelpatchApplicationWizard.xtend
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.wizards
+
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchException
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelpatchApplicationDTO
+import org.eclipse.emf.diffmerge.patch.ui.wizards.pages.ModelpatchEDMWizardPage
+import org.eclipse.emf.diffmerge.patch.ui.wizards.pages.ModelpatchFilteringWizardPage
+import org.eclipse.emf.diffmerge.patch.ui.wizards.pages.ModelpatchLoadingPatchWizardPage
+import org.eclipse.emf.diffmerge.patch.ui.wizards.pages.ModelpatchResultWizardPage
+import org.eclipse.emf.ecore.resource.Resource
+import org.eclipse.jface.wizard.IWizardPage
+import org.eclipse.jface.wizard.Wizard
+
+class ModelpatchApplicationWizard extends Wizard {
+ ModelpatchApplicationDTO dto
+
+ ModelpatchLoadingPatchWizardPage patchLoadingPage
+ ModelpatchFilteringWizardPage patchModificationPage
+ ModelpatchResultWizardPage resultPage
+ ModelpatchEDMWizardPage edmPage
+
+ new(Resource originalModel) {
+ setWindowTitle("Modelpatch Application")
+ dto = new ModelpatchApplicationDTO(originalModel)
+ patchLoadingPage = new ModelpatchLoadingPatchWizardPage(dto)
+ patchModificationPage = new ModelpatchFilteringWizardPage(dto)
+ resultPage = new ModelpatchResultWizardPage(dto)
+ edmPage = new ModelpatchEDMWizardPage(dto)
+ }
+
+ override void addPages() {
+ addPage(patchLoadingPage)
+ addPage(patchModificationPage)
+ addPage(resultPage)
+ addPage(edmPage)
+ }
+
+ override canFinish() {
+ return container.currentPage==resultPage || (container.currentPage==edmPage && edmPage.canFinish)
+ }
+
+ override boolean performFinish() {
+ if(container.currentPage == resultPage) {
+ dto.saveModel
+ return true
+ } else if(container.currentPage == edmPage) {
+ return true
+ }
+ return false
+ }
+
+ override performCancel() {
+ if(container.currentPage == edmPage) {
+ dto.undoEDMModifications
+ }
+ super.performCancel()
+ }
+
+ override IWizardPage getNextPage(IWizardPage currentPage) {
+ try {
+ switch(currentPage) {
+ case patchLoadingPage: {
+ dto.loadPatch(patchLoadingPage.getSelectedFilePath())
+ return patchModificationPage
+ }
+ case patchModificationPage: {
+ return resultPage
+ }
+ case resultPage: {
+ return edmPage
+ }
+ }
+ } catch (ModelPatchException e) {
+ e.printStackTrace()
+ }
+
+ return null
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchEDMWizardPage.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchEDMWizardPage.java
new file mode 100644
index 0000000..12facef
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchEDMWizardPage.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.wizards.pages;
+
+import org.eclipse.compare.CompareEditorInput;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelpatchApplicationDTO;
+import org.eclipse.emf.diffmerge.ui.viewers.ComparisonViewer;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+
+public class ModelpatchEDMWizardPage extends WizardPage {
+ ModelpatchApplicationDTO dto;
+ public boolean canFinish = false;
+
+ ComparisonViewer comp;
+ /**
+ * Create the wizard.
+ */
+ public ModelpatchEDMWizardPage(ModelpatchApplicationDTO dto) {
+ super("EDM Wizard Page");
+ setTitle("Differences");
+ setDescription("You can select changes which you want to apply. The target model will be only modified if you explicitly merge changes from the synthesis panel.");
+ this.dto = dto;
+ }
+
+ /**
+ * Create contents of the wizard.
+ * @param parent
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+
+ setControl(container);
+ container.setLayout(new GridLayout(1, false));
+ comp = new ComparisonViewer(container) {
+ @Override
+ protected void setupToolBars() {
+ // We only need the lower tool bars
+ setupToolsDetails(_viewerFeatures.getToolbar());
+ setupToolsDetailsSide(_viewerValuesLeft.getToolbar(), true);
+ setupToolsDetailsSide(_viewerValuesRight.getToolbar(), false);
+ addSelectionChangedListener(new ISelectionChangedListener() {
+ /**
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ public void selectionChanged(SelectionChangedEvent event_p) {
+ refreshTools();
+ }
+ });
+ refreshTools();
+ addPropertyChangeListener(new IPropertyChangeListener() {
+ /**
+ * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent event_p) {
+ if (CompareEditorInput.DIRTY_STATE.equals(event_p.getProperty()) && event_p.getNewValue() instanceof Boolean && ((Boolean)event_p.getNewValue()).booleanValue()) {
+ canFinish = true;
+ setPageComplete(true);
+ }
+ }
+ });
+ }
+ };
+ comp.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ }
+
+ @Override
+ public void setVisible(boolean visible) {
+ if(visible==true) {
+ dto.prepareDiffNode();
+ dto.diffNode.updateDifferenceNumbers();
+ comp.setInput(dto.diffNode);
+ }
+ super.setVisible(visible);
+ }
+
+ @Override
+ public IWizardPage getPreviousPage() {
+ return null;
+ }
+
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchFilteringWizardPage.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchFilteringWizardPage.java
new file mode 100644
index 0000000..d0731f4
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchFilteringWizardPage.java
@@ -0,0 +1,244 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.wizards.pages;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+
+import org.eclipse.emf.diffmerge.patch.api.ComplexMPEFilterType;
+import org.eclipse.emf.diffmerge.patch.api.IModelPatchEntryFilter;
+import org.eclipse.emf.diffmerge.patch.api.filters.ComplexEntryFilter;
+import org.eclipse.emf.diffmerge.patch.ui.dialogs.ModelpatchEntryFilterCreationDialog;
+import org.eclipse.emf.diffmerge.patch.ui.utils.DescriptiveEntryLabelProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelPatchContentProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelPatchEntryFilterContentProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelPatchEntryFilterLabelProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelPatchLabelProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelpatchApplicationDTO;
+
+public class ModelpatchFilteringWizardPage extends WizardPage {
+ public static final String[] SUPPORTED_PATCH_FILE_EXTENSIONS = { "*.modelpatch" };
+ public static final String ID = "org.eclipse.emf.diffmerge.patch";
+
+ // Data fields
+ private DataBindingContext m_bindingContext;
+ private ModelpatchApplicationDTO dto;
+ private java.util.List<IModelPatchEntryFilter> filters = new ArrayList<>();
+ private boolean isFiltered = false;
+
+ // UI fields
+ private Text txtPatchFilePath;
+
+ private TreeViewer tvParsedPatch;
+ private Button btnReversePatch;
+ private Button btnFiltering;
+ private Button btnAdd;
+ private Button btnRemove;
+ private List lFilters;
+
+ /**
+ * Create the dialog.
+ * @param patch
+ *
+ * @param parentShell
+ */
+ public ModelpatchFilteringWizardPage(ModelpatchApplicationDTO dto) {
+ super("Modify patch");
+ this.setTitle("Modify Patch");
+ this.dto = dto;
+ }
+
+ /**
+ * Create contents of the dialog.
+ *
+ * @param parent
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ setControl(container);
+ container.setLayout(new GridLayout(1, false));
+
+ Composite compFile = new Composite(container, SWT.NONE);
+ compFile.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ GridLayout gl_compFile = new GridLayout(2, false);
+ gl_compFile.marginWidth = 0;
+ gl_compFile.marginHeight = 0;
+ compFile.setLayout(gl_compFile);
+
+ CLabel lblPatchFile = new CLabel(compFile, SWT.NONE);
+ lblPatchFile.setBounds(0, 0, 61, 21);
+ lblPatchFile.setText("Patch file:");
+
+ txtPatchFilePath = new Text(compFile, SWT.BORDER);
+ txtPatchFilePath.setEditable(false);
+ txtPatchFilePath.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ txtPatchFilePath.setBounds(0, 0, 76, 21);
+
+ btnReversePatch = new Button(container, SWT.CHECK);
+ btnReversePatch.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ reverse = btnReversePatch.getSelection();
+ refreshPatchViewer();
+ }
+ });
+ btnReversePatch.setText("Reverse");
+
+ btnFiltering = new Button(container, SWT.CHECK);
+ btnFiltering.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ isFiltered = ((Button)btnFiltering).getSelection();
+ refreshPatchViewer();
+ }
+ });
+ btnFiltering.setText("Filtering");
+
+ Composite compFiltering = new Composite(container, SWT.NONE);
+ compFiltering.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ GridLayout gl_compFiltering = new GridLayout(2, false);
+ gl_compFiltering.marginWidth = 0;
+ gl_compFiltering.marginHeight = 0;
+ compFiltering.setLayout(gl_compFiltering);
+
+ final ListViewer lvFilters = new ListViewer(compFiltering, SWT.BORDER | SWT.V_SCROLL);
+ lFilters = lvFilters.getList();
+ lFilters.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2));
+ lvFilters.setContentProvider(new ModelPatchEntryFilterContentProvider());
+ lvFilters.setLabelProvider(new ModelPatchEntryFilterLabelProvider());
+ lvFilters.setInput(filters);
+
+ btnAdd = new Button(compFiltering, SWT.NONE);
+ btnAdd.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ ModelpatchEntryFilterCreationDialog dialog = new ModelpatchEntryFilterCreationDialog(getShell());
+ dialog.setBlockOnOpen(true);
+ dialog.setTitle("Add filter");
+ dialog.open();
+ IModelPatchEntryFilter filter = dialog.getCreatedFilter();
+ if(filter!=null) {
+ filters.add(filter);
+ lvFilters.refresh();
+ refreshPatchViewer();
+ }
+ }
+ });
+ btnAdd.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+ btnAdd.setText("Add");
+
+ btnRemove = new Button(compFiltering, SWT.NONE);
+ btnRemove.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ for(Object selectedElement : lvFilters.getStructuredSelection().toList()) {
+ filters.remove(selectedElement);
+ }
+ lvFilters.refresh();
+ refreshPatchViewer();
+ }
+ });
+ btnRemove.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
+ btnRemove.setText("Remove");
+
+ lblSequenceOfPatch = new Label(container, SWT.NONE);
+ lblSequenceOfPatch.setText("Sequence of patch entries:");
+
+ tvParsedPatch = new TreeViewer(container, SWT.BORDER);
+ tvParsedPatch.setContentProvider(new ModelPatchContentProvider());
+ tvParsedPatch.setLabelProvider(new ModelPatchLabelProvider(new DescriptiveEntryLabelProvider()));
+ Tree treeParsedPatch = tvParsedPatch.getTree();
+ treeParsedPatch.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+ treeParsedPatch.setVisible(true);
+
+ m_bindingContext = initDataBindings();
+ }
+
+ private void refreshPatchViewer() {
+ dto.modifyPatch(btnReversePatch.getSelection(), getFilter());
+ tvParsedPatch.setInput(dto.modifiedModelPatch);
+ tvParsedPatch.refresh();
+ }
+
+ private boolean direct;
+ public boolean isDirect() {
+ return direct;
+ }
+ private boolean reverse;
+ private Label lblSequenceOfPatch;
+ public boolean isReverse() {
+ return reverse;
+ }
+
+ public IModelPatchEntryFilter getFilter() {
+ if(isFiltered) {
+ if(filters.size()>1) {
+ return new ComplexEntryFilter(ComplexMPEFilterType.OR, filters.toArray(new IModelPatchEntryFilter[] {}));
+ } else if(filters.size()==1) {
+ return filters.get(0);
+ }
+ }
+ return null;
+ }
+
+ public void setPatchPath(String patchPath) {
+ txtPatchFilePath.setText(patchPath);
+ }
+
+ @Override
+ public void setVisible(boolean visible) {
+ if(visible) {
+ refreshPatchViewer();
+ setPatchPath(org.eclipse.core.runtime.Path.fromOSString(dto.patchPath).lastSegment());
+ }
+ super.setVisible(visible);
+ }
+
+ protected DataBindingContext initDataBindings() {
+ DataBindingContext bindingContext = new DataBindingContext();
+ IObservableValue observeSelectionBtnFilteringObserveWidget = WidgetProperties.selection().observe(btnFiltering);
+ //
+ IObservableValue observeEnabledBtnAddObserveWidget = WidgetProperties.enabled().observe(btnAdd);
+ bindingContext.bindValue(observeEnabledBtnAddObserveWidget, observeSelectionBtnFilteringObserveWidget, null, null);
+ //
+ IObservableValue observeEnabledBtnRemoveObserveWidget = WidgetProperties.enabled().observe(btnRemove);
+ bindingContext.bindValue(observeEnabledBtnRemoveObserveWidget, observeSelectionBtnFilteringObserveWidget, null, null);
+ //
+ IObservableValue observeEnabledLFiltersObserveWidget = WidgetProperties.enabled().observe(lFilters);
+ bindingContext.bindValue(observeEnabledLFiltersObserveWidget, observeSelectionBtnFilteringObserveWidget, null, null);
+ //
+ return bindingContext;
+ }
+
+ @Override
+ public void dispose() {
+ m_bindingContext.dispose();
+ super.dispose();
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchLoadingPatchWizardPage.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchLoadingPatchWizardPage.java
new file mode 100644
index 0000000..52573c6
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchLoadingPatchWizardPage.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.wizards.pages;
+
+import org.eclipse.emf.diffmerge.patch.ui.utils.DialogFactory;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelpatchApplicationDTO;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+public class ModelpatchLoadingPatchWizardPage extends WizardPage {
+ private ModelpatchApplicationDTO dto;
+ private Text txtPatchFilePath;
+ private String filePath;
+
+ /**
+ * Create the wizard.
+ */
+ public ModelpatchLoadingPatchWizardPage(ModelpatchApplicationDTO dto) {
+ super("Load Patch File");
+ setTitle("Load Patch File");
+ setDescription("Select the applicable patch file.");
+ this.dto = dto;
+ }
+
+ /**
+ * Create contents of the wizard.
+ * @param parent
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ final DialogFactory dialogFactory = new DialogFactory(getShell());
+
+ setControl(container);
+ container.setLayout(new GridLayout(4, false));
+
+ Label lblPatchFile = new Label(container, SWT.NONE);
+ lblPatchFile.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+ lblPatchFile.setText("Patch file:");
+
+ txtPatchFilePath = new Text(container, SWT.BORDER);
+ txtPatchFilePath.setEditable(false);
+ txtPatchFilePath.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+
+ Button btnBrowseWorkspace = new Button(container, SWT.NONE);
+ btnBrowseWorkspace.setText("Browse Workspace...");
+ btnBrowseWorkspace.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ String path = dialogFactory.openWorkspaceFileDialog("Patch File Selection");
+ if (path != null) {
+ txtPatchFilePath.setText(path);
+ } else {
+ txtPatchFilePath.setText("");
+ }
+ filePath = path;
+ setPageComplete(checkPatchFile(path));
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ });
+
+ Button btnBrowseFileSystem = new Button(container, SWT.NONE);
+ btnBrowseFileSystem.setText("Browse File System...");
+
+ btnBrowseFileSystem.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ String path = dialogFactory.openFileDialog("Patch File Selection", new String[] {"modelpatch"});
+ if (path != null) {
+ txtPatchFilePath.setText(path);
+ } else {
+ txtPatchFilePath.setText("");
+ }
+ filePath = path;
+ setPageComplete(checkPatchFile(path));
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ });
+ setPageComplete(false);
+ }
+
+ public String getSelectedFilePath() {
+ return filePath;
+ }
+
+ private boolean checkPatchFile(String path) {
+ boolean loadedSuccessfully = false;
+ try{
+ loadedSuccessfully = dto.loadPatch(path);
+ setErrorMessage(null);
+ } catch(Exception ex) {
+ setErrorMessage(ex.getMessage());
+ }
+ return loadedSuccessfully;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchResultWizardPage.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchResultWizardPage.java
new file mode 100644
index 0000000..0f3b66b
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/emf/diffmerge/patch/ui/wizards/pages/ModelpatchResultWizardPage.java
@@ -0,0 +1,223 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.ui.wizards.pages;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.wb.swt.SWTResourceManager;
+
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchDiagnosticElement;
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry;
+import org.eclipse.emf.diffmerge.patch.ui.utils.DefaultEntryLabelProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.EntryPropertyWrapper;
+import org.eclipse.emf.diffmerge.patch.ui.utils.IEntryLabelProvider;
+import org.eclipse.emf.diffmerge.patch.ui.utils.ModelpatchApplicationDTO;
+
+public class ModelpatchResultWizardPage extends WizardPage {
+ IEntryLabelProvider entryLabelProvider = new DefaultEntryLabelProvider();
+
+ private Tree tblDiagnostics;
+ private ModelpatchApplicationDTO dto;
+ private StackLayout stack;
+ private TreeViewer tvDiagnostics;
+ private Text lblNoProblem;
+ private Composite composite;
+ private Text txtDescription;
+ private Text txtRejects;
+ private Composite cmpDiagnostics;
+
+ /**
+ * Create the dialog.
+ * @param dto
+ */
+ public ModelpatchResultWizardPage(ModelpatchApplicationDTO dto) {
+ super("Patch application results");
+ setTitle("Patch Application Resolution Result");
+ this.dto = dto;
+ }
+
+ @Override
+ public void setVisible(boolean visible) {
+ if(visible) {
+ dto.applyPatch();
+ final List<ModelPatchDiagnosticElement> input = getTableInput();
+ if(input.size()==0) {
+ stack.topControl = lblNoProblem;
+ } else {
+ tvDiagnostics.setInput(input);
+ stack.topControl = cmpDiagnostics;
+ }
+ }
+ composite.layout();
+ super.setVisible(visible);
+ }
+
+ private List<ModelPatchDiagnosticElement> getTableInput() {
+ if(dto.patchApplication!=null && dto.patchApplication.getDiagnostics()!=null && dto.patchApplication.getDiagnostics().getDiagnosticElements()!=null) {
+ List<ModelPatchDiagnosticElement> elements = dto.patchApplication.getDiagnostics().getDiagnosticElements();
+ return elements;
+ }
+ return new ArrayList<>();
+ }
+
+ /**
+ * Create contents of the dialog.
+ * @param parent
+ */
+ @Override
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ setControl(container);
+ container.setLayout(new GridLayout(1, false));
+
+
+ Label lblResult = new Label(container, SWT.NONE);
+ lblResult.setFont(SWTResourceManager.getFont("Segoe UI", 14, SWT.BOLD));
+ lblResult.setText("Result");
+
+ composite = new Composite(container, SWT.NONE);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+ stack = new StackLayout();
+ composite.setLayout(stack);
+
+ lblNoProblem = new Text(composite, SWT.READ_ONLY | SWT.MULTI);
+ lblNoProblem.setText("Patch application resolution finished successfully!\r\nPatch can be applied without any rejects.");
+
+ cmpDiagnostics = new Composite(composite, SWT.NONE);
+ GridLayout gl_cmpDiagnostics = new GridLayout(1, false);
+ gl_cmpDiagnostics.marginWidth = 0;
+ gl_cmpDiagnostics.marginHeight = 0;
+ cmpDiagnostics.setLayout(gl_cmpDiagnostics);
+
+ txtRejects = new Text(cmpDiagnostics, SWT.READ_ONLY | SWT.MULTI);
+ txtRejects.setText("Patch application resolution finished!\r\nThe following rejects have been found while resolving the patch:");
+ txtRejects.setBounds(0, 0, 76, 21);
+
+ tvDiagnostics = new TreeViewer(cmpDiagnostics, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
+ tblDiagnostics = tvDiagnostics.getTree();
+ tblDiagnostics.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+ tblDiagnostics.setSize(564, 236);
+ tblDiagnostics.setLinesVisible(true);
+ tblDiagnostics.setHeaderVisible(true);
+
+ TreeColumn tvcEntry = new TreeColumn(tblDiagnostics, SWT.NONE);
+ tvcEntry.setWidth(150);
+ tvcEntry.setText("Entry");
+
+ TreeColumn tvcMessage = new TreeColumn(tblDiagnostics, SWT.NONE);
+ tvcMessage.setWidth(400);
+ tvcMessage.setText("Details");
+
+ tvDiagnostics.setContentProvider(new ITreeContentProvider() {
+ @Override
+ public void dispose() {}
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ if(parentElement instanceof ModelPatchDiagnosticElement) {
+ ModelPatchDiagnosticElement diagElem = (ModelPatchDiagnosticElement)parentElement;
+ ModelPatchEntry entry = diagElem.getProblematicEntry();
+ return entryLabelProvider.getPropertyList(entry).toArray();
+ }
+ if(parentElement instanceof ArrayList) {
+ return ((ArrayList)parentElement).toArray();
+ }
+ return new Object[0];
+ }
+
+ @Override
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ @Override
+ public boolean hasChildren(Object element) {
+ Object[] childrens = getChildren(element);
+ return childrens!=null && childrens.length>0;
+ }
+
+ });
+ tvDiagnostics.setLabelProvider(new ITableLabelProvider() {
+ @Override
+ public void removeListener(ILabelProviderListener listener) {}
+
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ @Override
+ public void dispose() {}
+
+ @Override
+ public void addListener(ILabelProviderListener listener) {}
+
+ @Override
+ public String getColumnText(Object element, int columnIndex) {
+ if(element instanceof ModelPatchDiagnosticElement) {
+ switch(columnIndex) {
+ case 0: return entryLabelProvider.shortDescription(((ModelPatchDiagnosticElement)element).getProblematicEntry());
+ case 1: return ((ModelPatchDiagnosticElement)element).getMessage();
+ }
+ } else if(element instanceof EntryPropertyWrapper) {
+ switch(columnIndex) {
+ case 0: return ((EntryPropertyWrapper)element).prop;
+ case 1: return ((EntryPropertyWrapper)element).value;
+ }
+ }
+ return "";
+ }
+
+ @Override
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+ });
+
+ Label label = new Label(container, SWT.SEPARATOR | SWT.HORIZONTAL);
+ label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+
+ txtDescription = new Text(container, SWT.READ_ONLY | SWT.WRAP | SWT.MULTI);
+ txtDescription.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ txtDescription.setText("If you click Next, you can select changes from the resolved model which you want to merge into the target model.\r\nIf you choose Finish, all the possible changes will be merged directly into the target model.");
+ }
+
+ @Override
+ public IWizardPage getPreviousPage() {
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/wb/swt/SWTResourceManager.java b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/wb/swt/SWTResourceManager.java
new file mode 100644
index 0000000..35f557a
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/src/org/eclipse/wb/swt/SWTResourceManager.java
@@ -0,0 +1,447 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Google, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Google, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wb.swt;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc.
+ * <p>
+ * !!! IMPORTANT !!! Application code must explicitly invoke the <code>dispose()</code> method to release the
+ * operating system resources managed by cached objects when those objects and OS resources are no longer
+ * needed (e.g. on application shutdown)
+ * <p>
+ * This class may be freely distributed as part of any application or plugin.
+ * <p>
+ * @author scheglov_ke
+ * @author Dan Rubel
+ */
+public class SWTResourceManager {
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Color
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ private static Map<RGB, Color> m_colorMap = new HashMap<RGB, Color>();
+ /**
+ * Returns the system {@link Color} matching the specific ID.
+ *
+ * @param systemColorID
+ * the ID value for the color
+ * @return the system {@link Color} matching the specific ID
+ */
+ public static Color getColor(int systemColorID) {
+ Display display = Display.getCurrent();
+ return display.getSystemColor(systemColorID);
+ }
+ /**
+ * Returns a {@link Color} given its red, green and blue component values.
+ *
+ * @param r
+ * the red component of the color
+ * @param g
+ * the green component of the color
+ * @param b
+ * the blue component of the color
+ * @return the {@link Color} matching the given red, green and blue component values
+ */
+ public static Color getColor(int r, int g, int b) {
+ return getColor(new RGB(r, g, b));
+ }
+ /**
+ * Returns a {@link Color} given its RGB value.
+ *
+ * @param rgb
+ * the {@link RGB} value of the color
+ * @return the {@link Color} matching the RGB value
+ */
+ public static Color getColor(RGB rgb) {
+ Color color = m_colorMap.get(rgb);
+ if (color == null) {
+ Display display = Display.getCurrent();
+ color = new Color(display, rgb);
+ m_colorMap.put(rgb, color);
+ }
+ return color;
+ }
+ /**
+ * Dispose of all the cached {@link Color}'s.
+ */
+ public static void disposeColors() {
+ for (Color color : m_colorMap.values()) {
+ color.dispose();
+ }
+ m_colorMap.clear();
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Image
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps image paths to images.
+ */
+ private static Map<String, Image> m_imageMap = new HashMap<String, Image>();
+ /**
+ * Returns an {@link Image} encoded by the specified {@link InputStream}.
+ *
+ * @param stream
+ * the {@link InputStream} encoding the image data
+ * @return the {@link Image} encoded by the specified input stream
+ */
+ protected static Image getImage(InputStream stream) throws IOException {
+ try {
+ Display display = Display.getCurrent();
+ ImageData data = new ImageData(stream);
+ if (data.transparentPixel > 0) {
+ return new Image(display, data, data.getTransparencyMask());
+ }
+ return new Image(display, data);
+ } finally {
+ stream.close();
+ }
+ }
+ /**
+ * Returns an {@link Image} stored in the file at the specified path.
+ *
+ * @param path
+ * the path to the image file
+ * @return the {@link Image} stored in the file at the specified path
+ */
+ public static Image getImage(String path) {
+ Image image = m_imageMap.get(path);
+ if (image == null) {
+ try {
+ image = getImage(new FileInputStream(path));
+ m_imageMap.put(path, image);
+ } catch (Exception e) {
+ image = getMissingImage();
+ m_imageMap.put(path, image);
+ }
+ }
+ return image;
+ }
+ /**
+ * Returns an {@link Image} stored in the file at the specified path relative to the specified class.
+ *
+ * @param clazz
+ * the {@link Class} relative to which to find the image
+ * @param path
+ * the path to the image file, if starts with <code>'/'</code>
+ * @return the {@link Image} stored in the file at the specified path
+ */
+ public static Image getImage(Class<?> clazz, String path) {
+ String key = clazz.getName() + '|' + path;
+ Image image = m_imageMap.get(key);
+ if (image == null) {
+ try {
+ image = getImage(clazz.getResourceAsStream(path));
+ m_imageMap.put(key, image);
+ } catch (Exception e) {
+ image = getMissingImage();
+ m_imageMap.put(key, image);
+ }
+ }
+ return image;
+ }
+ private static final int MISSING_IMAGE_SIZE = 10;
+ /**
+ * @return the small {@link Image} that can be used as placeholder for missing image.
+ */
+ private static Image getMissingImage() {
+ Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
+ //
+ GC gc = new GC(image);
+ gc.setBackground(getColor(SWT.COLOR_RED));
+ gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
+ gc.dispose();
+ //
+ return image;
+ }
+ /**
+ * Style constant for placing decorator image in top left corner of base image.
+ */
+ public static final int TOP_LEFT = 1;
+ /**
+ * Style constant for placing decorator image in top right corner of base image.
+ */
+ public static final int TOP_RIGHT = 2;
+ /**
+ * Style constant for placing decorator image in bottom left corner of base image.
+ */
+ public static final int BOTTOM_LEFT = 3;
+ /**
+ * Style constant for placing decorator image in bottom right corner of base image.
+ */
+ public static final int BOTTOM_RIGHT = 4;
+ /**
+ * Internal value.
+ */
+ protected static final int LAST_CORNER_KEY = 5;
+ /**
+ * Maps images to decorated images.
+ */
+ @SuppressWarnings("unchecked")
+ private static Map<Image, Map<Image, Image>>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY];
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated
+ * @param decorator
+ * the {@link Image} to decorate the base image
+ * @return {@link Image} The resulting decorated image
+ */
+ public static Image decorateImage(Image baseImage, Image decorator) {
+ return decorateImage(baseImage, decorator, BOTTOM_RIGHT);
+ }
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated
+ * @param decorator
+ * the {@link Image} to decorate the base image
+ * @param corner
+ * the corner to place decorator image
+ * @return the resulting decorated {@link Image}
+ */
+ public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) {
+ if (corner <= 0 || corner >= LAST_CORNER_KEY) {
+ throw new IllegalArgumentException("Wrong decorate corner");
+ }
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[corner];
+ if (cornerDecoratedImageMap == null) {
+ cornerDecoratedImageMap = new HashMap<Image, Map<Image, Image>>();
+ m_decoratedImageMap[corner] = cornerDecoratedImageMap;
+ }
+ Map<Image, Image> decoratedMap = cornerDecoratedImageMap.get(baseImage);
+ if (decoratedMap == null) {
+ decoratedMap = new HashMap<Image, Image>();
+ cornerDecoratedImageMap.put(baseImage, decoratedMap);
+ }
+ //
+ Image result = decoratedMap.get(decorator);
+ if (result == null) {
+ Rectangle bib = baseImage.getBounds();
+ Rectangle dib = decorator.getBounds();
+ //
+ result = new Image(Display.getCurrent(), bib.width, bib.height);
+ //
+ GC gc = new GC(result);
+ gc.drawImage(baseImage, 0, 0);
+ if (corner == TOP_LEFT) {
+ gc.drawImage(decorator, 0, 0);
+ } else if (corner == TOP_RIGHT) {
+ gc.drawImage(decorator, bib.width - dib.width, 0);
+ } else if (corner == BOTTOM_LEFT) {
+ gc.drawImage(decorator, 0, bib.height - dib.height);
+ } else if (corner == BOTTOM_RIGHT) {
+ gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height);
+ }
+ gc.dispose();
+ //
+ decoratedMap.put(decorator, result);
+ }
+ return result;
+ }
+ /**
+ * Dispose all of the cached {@link Image}'s.
+ */
+ public static void disposeImages() {
+ // dispose loaded images
+ {
+ for (Image image : m_imageMap.values()) {
+ image.dispose();
+ }
+ m_imageMap.clear();
+ }
+ // dispose decorated images
+ for (int i = 0; i < m_decoratedImageMap.length; i++) {
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[i];
+ if (cornerDecoratedImageMap != null) {
+ for (Map<Image, Image> decoratedMap : cornerDecoratedImageMap.values()) {
+ for (Image image : decoratedMap.values()) {
+ image.dispose();
+ }
+ decoratedMap.clear();
+ }
+ cornerDecoratedImageMap.clear();
+ }
+ }
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Font
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps font names to fonts.
+ */
+ private static Map<String, Font> m_fontMap = new HashMap<String, Font>();
+ /**
+ * Maps fonts to their bold versions.
+ */
+ private static Map<Font, Font> m_fontToBoldFontMap = new HashMap<Font, Font>();
+ /**
+ * Returns a {@link Font} based on its name, height and style.
+ *
+ * @param name
+ * the name of the font
+ * @param height
+ * the height of the font
+ * @param style
+ * the style of the font
+ * @return {@link Font} The font matching the name, height and style
+ */
+ public static Font getFont(String name, int height, int style) {
+ return getFont(name, height, style, false, false);
+ }
+ /**
+ * Returns a {@link Font} based on its name, height and style. Windows-specific strikeout and underline
+ * flags are also supported.
+ *
+ * @param name
+ * the name of the font
+ * @param size
+ * the size of the font
+ * @param style
+ * the style of the font
+ * @param strikeout
+ * the strikeout flag (warning: Windows only)
+ * @param underline
+ * the underline flag (warning: Windows only)
+ * @return {@link Font} The font matching the name, height, style, strikeout and underline
+ */
+ public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) {
+ String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline;
+ Font font = m_fontMap.get(fontName);
+ if (font == null) {
+ FontData fontData = new FontData(name, size, style);
+ if (strikeout || underline) {
+ try {
+ Class<?> logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$
+ Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$
+ if (logFont != null && logFontClass != null) {
+ if (strikeout) {
+ logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
+ }
+ if (underline) {
+ logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
+ }
+ }
+ } catch (Throwable e) {
+ System.err.println("Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ font = new Font(Display.getCurrent(), fontData);
+ m_fontMap.put(fontName, font);
+ }
+ return font;
+ }
+ /**
+ * Returns a bold version of the given {@link Font}.
+ *
+ * @param baseFont
+ * the {@link Font} for which a bold version is desired
+ * @return the bold version of the given {@link Font}
+ */
+ public static Font getBoldFont(Font baseFont) {
+ Font font = m_fontToBoldFontMap.get(baseFont);
+ if (font == null) {
+ FontData fontDatas[] = baseFont.getFontData();
+ FontData data = fontDatas[0];
+ font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD);
+ m_fontToBoldFontMap.put(baseFont, font);
+ }
+ return font;
+ }
+ /**
+ * Dispose all of the cached {@link Font}'s.
+ */
+ public static void disposeFonts() {
+ // clear fonts
+ for (Font font : m_fontMap.values()) {
+ font.dispose();
+ }
+ m_fontMap.clear();
+ // clear bold fonts
+ for (Font font : m_fontToBoldFontMap.values()) {
+ font.dispose();
+ }
+ m_fontToBoldFontMap.clear();
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Cursor
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps IDs to cursors.
+ */
+ private static Map<Integer, Cursor> m_idToCursorMap = new HashMap<Integer, Cursor>();
+ /**
+ * Returns the system cursor matching the specific ID.
+ *
+ * @param id
+ * int The ID value for the cursor
+ * @return Cursor The system cursor matching the specific ID
+ */
+ public static Cursor getCursor(int id) {
+ Integer key = Integer.valueOf(id);
+ Cursor cursor = m_idToCursorMap.get(key);
+ if (cursor == null) {
+ cursor = new Cursor(Display.getDefault(), id);
+ m_idToCursorMap.put(key, cursor);
+ }
+ return cursor;
+ }
+ /**
+ * Dispose all of the cached cursors.
+ */
+ public static void disposeCursors() {
+ for (Cursor cursor : m_idToCursorMap.values()) {
+ cursor.dispose();
+ }
+ m_idToCursorMap.clear();
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // General
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Dispose of cached objects and their underlying OS resources. This should only be called when the cached
+ * objects are no longer needed (e.g. on application shutdown).
+ */
+ public static void dispose() {
+ disposeColors();
+ disposeImages();
+ disposeFonts();
+ disposeCursors();
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch.ui/xtend-gen/.gitignore b/plugins/org.eclipse.emf.diffmerge.patch.ui/xtend-gen/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch.ui/xtend-gen/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/.classpath b/plugins/org.eclipse.emf.diffmerge.patch/.classpath
new file mode 100644
index 0000000..e850b35
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="xtend-gen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/.project b/plugins/org.eclipse.emf.diffmerge.patch/.project
new file mode 100644
index 0000000..9bf4182
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.patch</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.emf.diffmerge.patch/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/.settings/org.eclipse.core.runtime.prefs b/plugins/org.eclipse.emf.diffmerge.patch/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.diffmerge.patch/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..f42de36
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.diffmerge.patch/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..31c107f
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/META-INF/MANIFEST.MF
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.diffmerge.patch;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Bundle-Vendor: %providerName
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: com.google.guava;bundle-version="15.0.0",
+ org.eclipse.xtend.lib
+Export-Package: org.eclipse.emf.diffmerge.patch,
+ org.eclipse.emf.diffmerge.patch.api,
+ org.eclipse.emf.diffmerge.patch.api.filters,
+ org.eclipse.emf.diffmerge.patch.serializer
+Bundle-ClassPath: .
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/about.html b/plugins/org.eclipse.emf.diffmerge.patch/about.html
new file mode 100644
index 0000000..d8e1984
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/about.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/build.properties b/plugins/org.eclipse.emf.diffmerge.patch/build.properties
new file mode 100644
index 0000000..909ef3f
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/build.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2016-2017 Thales Global Services S.A.S.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+###############################################################################
+source.. = src/,\
+ xtend-gen/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html
+src.includes = about.html
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/plugin.properties b/plugins/org.eclipse.emf.diffmerge.patch/plugin.properties
new file mode 100644
index 0000000..ff2dfcc
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/plugin.properties
@@ -0,0 +1,9 @@
+###############################################################################
+# Copyright (c) 2016-2017 Thales Global Services S.A.S.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+pluginName = Model Patch Plug-In (Incubation)
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/pom.xml b/plugins/org.eclipse.emf.diffmerge.patch/pom.xml
new file mode 100644
index 0000000..7384c2b
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/pom.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.plugins</artifactId>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <version>0.1.0-SNAPSHOT</version>
+ <properties>
+ <rootPath>${basedir}/../</rootPath>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>xtend-gen</directory>
+ <excludes>
+ <exclude>.gitignore</exclude>
+ </excludes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.xtend</groupId>
+ <artifactId>xtend-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/AbstractModelPatchEntry.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/AbstractModelPatchEntry.java
new file mode 100644
index 0000000..92f2b7e
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/AbstractModelPatchEntry.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch;
+
+import java.util.Objects;
+
+import org.eclipse.emf.diffmerge.patch.api.ChangeDirection;
+import org.eclipse.emf.diffmerge.patch.api.Identifiable;
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry;
+
+public abstract class AbstractModelPatchEntry implements ModelPatchEntry {
+
+ private ChangeDirection direction;
+
+ private Identifiable context;
+
+ @Override
+ public ChangeDirection getDirection() {
+ return direction;
+ }
+
+ public void setDirection(ChangeDirection direction) {
+ this.direction = direction;
+ }
+
+ @Override
+ public Identifiable getContext() {
+ return context;
+ }
+
+ public void setContext(Identifiable context) {
+ this.context = context;
+ }
+
+ @Override
+ public abstract String toString();
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj instanceof AbstractModelPatchEntry) {
+ AbstractModelPatchEntry casted = (AbstractModelPatchEntry)obj;
+ return Objects.equals(this.context, casted.context) && this.direction==casted.direction;
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/AttributeEntry.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/AttributeEntry.java
new file mode 100644
index 0000000..c3b33e5
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/AttributeEntry.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch;
+
+import java.util.Objects;
+
+import org.eclipse.emf.diffmerge.patch.api.EntryType;
+
+public class AttributeEntry extends StructuralFeatureEntry {
+
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ @Override
+ public EntryType getEntryType() {
+ return EntryType.ATTRIBUTE;
+ }
+
+ @Override
+ public String toString() {
+ return getDirection()+" '"+value+"' value from '"+getToStringEnding();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj instanceof AttributeEntry) {
+ AttributeEntry casted = (AttributeEntry)obj;
+ return Objects.equals(this.value, casted.value) && super.equals(obj);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(this.getEntryType(), this.getDirection(), this.getContext(), this.getFeature(), this.getValue(), this.getIndex());
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/ElementEntry.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/ElementEntry.java
new file mode 100644
index 0000000..be123df
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/ElementEntry.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch;
+
+import java.util.Objects;
+
+import org.eclipse.emf.diffmerge.patch.api.EntryType;
+import org.eclipse.emf.diffmerge.patch.api.Identifiable;
+
+public class ElementEntry extends AbstractModelPatchEntry {
+
+ private Identifiable type;
+
+ public Identifiable getType() {
+ return type;
+ }
+
+ public void setType(Identifiable type) {
+ this.type = type;
+ }
+
+ @Override
+ public EntryType getEntryType() {
+ return EntryType.ELEMENT;
+ }
+
+ @Override
+ public String toString() {
+ return getDirection()+" '"+type.getIdentifier()+"' (id: '"+getContext().getIdentifier()+"')";
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj instanceof ElementEntry) {
+ ElementEntry casted = (ElementEntry)obj;
+ return Objects.equals(this.type, casted.type) && super.equals(obj);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(this.getEntryType(), this.getDirection(), this.getContext(), this.getType());
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/ReferenceEntry.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/ReferenceEntry.java
new file mode 100644
index 0000000..0ddb606
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/ReferenceEntry.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch;
+
+import java.util.Objects;
+
+import org.eclipse.emf.diffmerge.patch.api.EntryType;
+import org.eclipse.emf.diffmerge.patch.api.Identifiable;
+
+public class ReferenceEntry extends StructuralFeatureEntry {
+
+ private Identifiable target;
+
+ public Identifiable getTarget() {
+ return target;
+ }
+
+ public void setTarget(Identifiable target) {
+ this.target = target;
+ }
+
+ @Override
+ public EntryType getEntryType() {
+ return EntryType.REFERENCE;
+ }
+
+ @Override
+ public String toString() {
+ return getDirection()+" '"+target.getIdentifier()+"' reference from '"+getToStringEnding();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj instanceof ReferenceEntry) {
+ ReferenceEntry casted = (ReferenceEntry)obj;
+ return Objects.equals(this.target, casted.target) && super.equals(obj);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(this.getEntryType(), this.getDirection(), this.getContext(), this.getFeature(), this.getTarget(), this.getIndex());
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/StructuralFeatureEntry.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/StructuralFeatureEntry.java
new file mode 100644
index 0000000..61c9f70
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/StructuralFeatureEntry.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch;
+
+import java.util.Objects;
+
+import org.eclipse.emf.diffmerge.patch.api.Identifiable;
+
+import com.google.common.base.Optional;
+
+public abstract class StructuralFeatureEntry extends AbstractModelPatchEntry {
+
+ private Identifiable feature;
+
+ private Integer index = null;
+
+ public Identifiable getFeature() {
+ return feature;
+ }
+
+ public void setFeature(Identifiable feature) {
+ this.feature = feature;
+ }
+
+ public Optional<Integer> getIndex() {
+ return Optional.fromNullable(index);
+ }
+
+ public void setIndex(Optional<Integer> index) {
+ this.index = index.orNull();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj instanceof StructuralFeatureEntry) {
+ StructuralFeatureEntry casted = (StructuralFeatureEntry)obj;
+ return Objects.equals(this.feature, casted.feature) && this.getIndex().equals(casted.getIndex()) && super.equals(obj);
+ }
+ return false;
+ }
+
+ protected String getToStringEnding() {
+ return getFeature().getIdentifier()+"' of "+getContext().getIdentifier()+(getIndex().isPresent()?("(index: "+getIndex().get()+")"):(""));
+ }
+}
+
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/BaseModelPatchMetadata.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/BaseModelPatchMetadata.java
new file mode 100644
index 0000000..bfac620
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/BaseModelPatchMetadata.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+import java.util.Calendar;
+
+public class BaseModelPatchMetadata implements ModelPatchMetadata {
+
+ private String author = null;
+
+ private String createdAt = Calendar.getInstance().getTime().toString();
+
+ private String description = null;
+
+ private String input = null;
+
+ @Override
+ public String getAuthor() {
+ return author;
+ }
+
+ public void setAuthor(String author) {
+ this.author = author;
+ }
+
+ @Override
+ public String getCreatedAt() {
+ return createdAt;
+ }
+
+ public void setCreatedAt(String createdAt) {
+ this.createdAt = createdAt;
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Override
+ public String getInput() {
+ return input;
+ }
+
+ public void setInput(String input) {
+ this.input = input;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ChangeDirection.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ChangeDirection.java
new file mode 100644
index 0000000..2e1f7b4
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ChangeDirection.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+public enum ChangeDirection {
+
+ ADD, REMOVE
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ComplexMPEFilterType.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ComplexMPEFilterType.java
new file mode 100644
index 0000000..aa72623
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ComplexMPEFilterType.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+public enum ComplexMPEFilterType {
+ AND, OR
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/EntryType.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/EntryType.java
new file mode 100644
index 0000000..1081610
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/EntryType.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+public enum EntryType {
+
+ ELEMENT, REFERENCE, ATTRIBUTE
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/IModelPatchEntryFilter.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/IModelPatchEntryFilter.java
new file mode 100644
index 0000000..e1a7710
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/IModelPatchEntryFilter.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+public interface IModelPatchEntryFilter {
+ boolean isEntryFiltered(ModelPatchEntry entry);
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/Identifiable.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/Identifiable.java
new file mode 100644
index 0000000..dd3b719
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/Identifiable.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+import java.util.Objects;
+
+public class Identifiable {
+
+ private String identifier;
+
+ private String description;
+
+ public Identifiable(String identifier) {
+ this.identifier = identifier;
+ }
+
+ protected Identifiable() {
+ this.identifier = null;
+ }
+
+ public String getIdentifier() {
+ return identifier;
+ }
+
+ public void setIdentifier(String identifier) {
+ this.identifier = identifier;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(obj instanceof Identifiable) {
+ Identifiable casted = (Identifiable)obj;
+ return Objects.equals(this.identifier, casted.identifier);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(this.identifier);
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatch.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatch.java
new file mode 100644
index 0000000..ff00ca2
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatch.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+public class ModelPatch {
+
+ private ModelPatchMetadata metadata = new BaseModelPatchMetadata();
+
+ private List<ModelPatchEntry> entries = new ArrayList<>();
+
+ public List<ModelPatchEntry> getEntries() {
+ return entries;
+ }
+
+ public ModelPatchMetadata getMetadata() {
+ return metadata;
+ }
+
+ public void setMetadata(ModelPatchMetadata metadata) {
+ this.metadata = metadata;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchBuilder.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchBuilder.java
new file mode 100644
index 0000000..5934a3f
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchBuilder.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+import java.util.Collection;
+
+public class ModelPatchBuilder {
+ ModelPatch modelPatch = new ModelPatch();
+
+ public static ModelPatchBuilder create() {
+ return new ModelPatchBuilder();
+ }
+
+ public ModelPatchBuilder addEntry(ModelPatchEntry entry) {
+ modelPatch.getEntries().add(entry);
+ return this;
+ }
+
+ public ModelPatchBuilder addEntry(ModelPatchEntryBuilder entryBuilder, EntryType entryType) {
+ ModelPatchEntry entry = entryBuilder.build(entryType);
+ addEntry(entry);
+ return this;
+ }
+
+ public ModelPatchBuilder append(ModelPatchBuilder other) {
+ return this.append(other.build());
+ }
+ public ModelPatchBuilder append(ModelPatch patch) {
+ return this.append(patch.getEntries());
+ }
+ public ModelPatchBuilder append(Collection<? extends ModelPatchEntry> entries) {
+ this.modelPatch.getEntries().addAll(entries);
+ return this;
+ }
+
+ public ModelPatch build() {
+ return modelPatch;
+ }
+
+ public static ModelPatchEntryBuilder entryBuilder(Identifiable context, ChangeDirection direction) {
+ return ModelPatchEntryBuilder.create(context, direction);
+ }
+
+ public static ModelPatchEntryBuilder entryBuilder() {
+ return ModelPatchEntryBuilder.create();
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchDiagnosticElement.xtend b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchDiagnosticElement.xtend
new file mode 100644
index 0000000..a74e9ff
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchDiagnosticElement.xtend
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api
+
+import org.eclipse.xtend.lib.annotations.Accessors
+
+class ModelPatchDiagnosticElement {
+ @Accessors(PUBLIC_GETTER, PUBLIC_SETTER)
+ private Exception caughtException
+ @Accessors(PUBLIC_GETTER, PUBLIC_SETTER)
+ private String message
+ @Accessors(PUBLIC_GETTER, PUBLIC_SETTER)
+ private ModelPatchEntry problematicEntry
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchEntry.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchEntry.java
new file mode 100644
index 0000000..841778f
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchEntry.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+public interface ModelPatchEntry {
+
+ ChangeDirection getDirection();
+
+ EntryType getEntryType();
+
+ Identifiable getContext();
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchEntryBuilder.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchEntryBuilder.java
new file mode 100644
index 0000000..edf8a9a
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchEntryBuilder.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+import org.eclipse.emf.diffmerge.patch.AttributeEntry;
+import org.eclipse.emf.diffmerge.patch.ElementEntry;
+import org.eclipse.emf.diffmerge.patch.ReferenceEntry;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+
+public class ModelPatchEntryBuilder {
+
+ private ChangeDirection direction;
+ private Identifiable context;
+ private Identifiable feature;
+ private Identifiable target;
+ private Identifiable type;
+ private String value;
+ private Optional<Integer> index = Optional.absent();
+
+ public static ModelPatchEntryBuilder create() {
+ ModelPatchEntryBuilder builder = new ModelPatchEntryBuilder();
+ return builder;
+ }
+
+ public static ModelPatchEntryBuilder create(Identifiable context, ChangeDirection direction) {
+ ModelPatchEntryBuilder builder = create();
+ builder.context = context;
+ builder.direction = direction;
+ return builder;
+ }
+
+ public ModelPatchEntry build(EntryType entryType) {
+ ModelPatchEntry entry = null;
+ switch (entryType) {
+ case ELEMENT:
+ entry = buildElementEntry();
+ break;
+ case ATTRIBUTE:
+ entry = buildAttributeEntry();
+ break;
+ case REFERENCE:
+ entry = buildReferenceEntry();
+ break;
+ default:
+ break;
+ }
+ return entry;
+ }
+
+ public ElementEntry buildElementEntry() {
+ Preconditions.checkNotNull(direction, "Direction cannot be null");
+ Preconditions.checkNotNull(context, "Context cannot be null");
+ Preconditions.checkNotNull(type, "Type cannot be null");
+ ElementEntry elementEntry = new ElementEntry();
+ elementEntry.setDirection(direction);
+ elementEntry.setContext(context);
+ elementEntry.setType(type);
+ return elementEntry;
+ }
+
+ public ReferenceEntry buildReferenceEntry() {
+ Preconditions.checkNotNull(direction, "Direction cannot be null");
+ Preconditions.checkNotNull(context, "Context cannot be null");
+ Preconditions.checkNotNull(feature, "Feature cannot be null");
+ Preconditions.checkNotNull(target, "Target cannot be null");
+ ReferenceEntry referenceEntry = new ReferenceEntry();
+ referenceEntry.setDirection(direction);
+ referenceEntry.setContext(context);
+ referenceEntry.setFeature(feature);
+ referenceEntry.setTarget(target);
+ referenceEntry.setIndex(index);
+ return referenceEntry;
+ }
+
+ public AttributeEntry buildAttributeEntry() {
+ Preconditions.checkNotNull(direction, "Direction cannot be null");
+ Preconditions.checkNotNull(context, "Context cannot be null");
+ Preconditions.checkNotNull(feature, "Feature cannot be null");
+ Preconditions.checkNotNull(value, "Value cannot be null");
+ AttributeEntry attributeEntry = new AttributeEntry();
+ attributeEntry.setDirection(direction);
+ attributeEntry.setContext(context);
+ attributeEntry.setFeature(feature);
+ attributeEntry.setValue(value);
+ attributeEntry.setIndex(index);
+ return attributeEntry;
+ }
+
+ public ModelPatchEntryBuilder setDirection(ChangeDirection direction) {
+ this.direction = direction;
+ return this;
+ }
+
+ public ModelPatchEntryBuilder setContext(Identifiable context) {
+ this.context = context;
+ return this;
+ }
+
+ public ModelPatchEntryBuilder setFeature(Identifiable feature) {
+ this.feature = feature;
+ return this;
+ }
+
+ public ModelPatchEntryBuilder setTarget(Identifiable target) {
+ this.target = target;
+ return this;
+ }
+
+ public ModelPatchEntryBuilder setType(Identifiable type) {
+ this.type = type;
+ return this;
+ }
+
+ public ModelPatchEntryBuilder setValue(String value) {
+ this.value = value;
+ return this;
+ }
+
+ public ModelPatchEntryBuilder setIndex(Optional<Integer> index) {
+ this.index = index;
+ return this;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchEntryProperty.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchEntryProperty.java
new file mode 100644
index 0000000..2d83d2e
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchEntryProperty.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+public enum ModelPatchEntryProperty {
+ CONTEXT, TYPE, FEATURE, VALUE, TARGET
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchException.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchException.java
new file mode 100644
index 0000000..4fe25cb
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchException.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+public class ModelPatchException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public ModelPatchException(Throwable rootCause)
+ {
+ super(rootCause);
+ }
+
+ public ModelPatchException(String msg)
+ {
+ super(msg);
+ }
+
+ public ModelPatchException(String msg, Throwable rootCause)
+ {
+ super(msg, rootCause);
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchFilterApplier.xtend b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchFilterApplier.xtend
new file mode 100644
index 0000000..70d0ebe
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchFilterApplier.xtend
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api
+
+class ModelPatchFilterApplier {
+
+ /**
+ * Filter out matching entries from the originalPatch based on the given filter and return the filtered patch.
+ * Matching elements will not be in the new patch. If you need the matching elements use the
+ * {@link #applyUnfilter(ModelPatch, IModelPatchEntryFilter) applyUnfilter}.
+ *
+ * @param originalModelPatch The modifiable patch
+ * @param filter The applicable filter
+ * @return ModelPatch which does not contain filtered elements
+ */
+ def ModelPatch applyFilter(ModelPatch originalPatch, IModelPatchEntryFilter filter) {
+ val builder = ModelPatchBuilder.create
+ builder.append(originalPatch.entries.filter[!filter.isEntryFiltered(it)].toList)
+ return builder.build
+ }
+
+ /**
+ * Filter out non matching entries from the originalPatch based on the given filter and return the filtered patch.
+ * Only matching elements will be in the new patch. If you need the non matching elements
+ * {@link #applyFilter(ModelPatch, IModelPatchEntryFilter) applyFilter}.
+ *
+ * @param originalModelPatch The modifiable patch
+ * @param filter The applicable filter
+ * @return ModelPatch which only contains filtered elements
+ */
+ def ModelPatch applyUnfilter(ModelPatch originalPatch, IModelPatchEntryFilter filter) {
+ val builder = ModelPatchBuilder.create
+ builder.append(originalPatch.entries.filter[!filter.isEntryFiltered(it)].toList)
+ return builder.build
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchMetadata.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchMetadata.java
new file mode 100644
index 0000000..3be3789
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchMetadata.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+public interface ModelPatchMetadata {
+
+ String getAuthor();
+
+ String getCreatedAt();
+
+ String getDescription();
+
+ String getInput();
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchReverser.xtend b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchReverser.xtend
new file mode 100644
index 0000000..ff7c6a7
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/ModelPatchReverser.xtend
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api
+
+import org.eclipse.emf.diffmerge.patch.AttributeEntry
+import org.eclipse.emf.diffmerge.patch.ElementEntry
+import org.eclipse.emf.diffmerge.patch.ReferenceEntry
+
+class ModelPatchReverser {
+ public static val INSTANCE = new ModelPatchReverser()
+
+ public def ModelPatch reverse(ModelPatch originalPatch) throws ModelPatchException {
+ val reverseBuilder = ModelPatchBuilder.create
+ originalPatch.entries.reverseView.forEach[ originalEntry |
+ reverseBuilder.addEntry(originalEntry.reverseEntry)
+ ]
+ return reverseBuilder.build
+ }
+
+
+
+ public dispatch def ModelPatchEntry reverseEntry(ModelPatchEntry originalEntry) throws ModelPatchException {
+ throw new ModelPatchException("Unhandled entry type")
+ }
+
+ public dispatch def ModelPatchEntry reverseEntry(AttributeEntry originalEntry) {
+ val reverseEntryBuilder = originalEntry.reverseEntryBuilder => [
+ it.feature = originalEntry.feature.cloneIdentifiable
+ it.value = originalEntry.value
+ it.index = originalEntry.index
+ ]
+ return reverseEntryBuilder.buildAttributeEntry
+ }
+
+ public dispatch def ModelPatchEntry reverseEntry(ElementEntry originalEntry) {
+ val reverseEntryBuilder = originalEntry.reverseEntryBuilder => [
+ it.type = originalEntry.type.cloneIdentifiable
+ ]
+ return reverseEntryBuilder.buildElementEntry
+ }
+
+ public dispatch def ModelPatchEntry reverseEntry(ReferenceEntry originalEntry) {
+ val reverseEntryBuilder = originalEntry.reverseEntryBuilder => [
+ it.feature = originalEntry.feature.cloneIdentifiable
+ it.target = originalEntry.target.cloneIdentifiable
+ it.index = originalEntry.index
+ ]
+ return reverseEntryBuilder.buildReferenceEntry
+ }
+
+
+
+ public def ChangeDirection reverseDirection(ChangeDirection original) {
+ if(ChangeDirection.ADD==original) {
+ return ChangeDirection.REMOVE
+ } else {
+ return ChangeDirection.ADD
+ }
+ }
+
+
+
+ private def reverseEntryBuilder(ModelPatchEntry originalEntry) {
+ return ModelPatchBuilder.entryBuilder(
+ originalEntry.context.cloneIdentifiable,
+ originalEntry.direction.reverseDirection
+ )
+ }
+
+ private def Identifiable cloneIdentifiable(Identifiable original) {
+ return new Identifiable(original.identifier)
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/PatchApplication.xtend b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/PatchApplication.xtend
new file mode 100644
index 0000000..5b95dd0
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/PatchApplication.xtend
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api
+
+interface PatchApplication {
+ def PatchApplicationDiagnostic getDiagnostics()
+ def ModelPatch getModelPatch()
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/PatchApplicationDiagnostic.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/PatchApplicationDiagnostic.java
new file mode 100644
index 0000000..10044bb
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/PatchApplicationDiagnostic.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PatchApplicationDiagnostic {
+ private List<ModelPatchDiagnosticElement> diagnosticElements = new ArrayList<ModelPatchDiagnosticElement>();
+
+ public void addElement(ModelPatchDiagnosticElement element) {
+ diagnosticElements.add(element);
+ }
+
+ public List<ModelPatchDiagnosticElement> getDiagnosticElements() {
+ return diagnosticElements;
+ }
+
+ public int numOfExceptions() {
+ return diagnosticElements.size();
+ }
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/ComplexEntryFilter.xtend b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/ComplexEntryFilter.xtend
new file mode 100644
index 0000000..4500fb7
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/ComplexEntryFilter.xtend
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api.filters
+
+import org.eclipse.emf.diffmerge.patch.api.ComplexMPEFilterType
+import org.eclipse.emf.diffmerge.patch.api.IModelPatchEntryFilter
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry
+import java.util.List
+import org.eclipse.xtend.lib.annotations.Accessors
+
+import static com.google.common.base.Preconditions.*
+
+class ComplexEntryFilter implements IModelPatchEntryFilter {
+ @Accessors(PUBLIC_GETTER)
+ private ComplexMPEFilterType type
+ @Accessors(PUBLIC_GETTER)
+ private List<IModelPatchEntryFilter> subFilters
+
+ new(ComplexMPEFilterType type, IModelPatchEntryFilter... subFilters) {
+ checkNotNull(type)
+ checkNotNull(subFilters)
+ this.type = type
+ this.subFilters = subFilters
+ }
+
+ override isEntryFiltered(ModelPatchEntry entry) {
+ if(type==ComplexMPEFilterType.OR) {
+ return subFilters.exists[it.isEntryFiltered(entry)]
+ } else {
+ return subFilters.forall[it.isEntryFiltered(entry)]
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/EntryDirectionFilter.xtend b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/EntryDirectionFilter.xtend
new file mode 100644
index 0000000..e413898
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/EntryDirectionFilter.xtend
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api.filters
+
+import org.eclipse.emf.diffmerge.patch.api.IModelPatchEntryFilter
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry
+import org.eclipse.emf.diffmerge.patch.api.ChangeDirection
+import org.eclipse.xtend.lib.annotations.Accessors
+
+import static com.google.common.base.Preconditions.*
+
+class EntryDirectionFilter implements IModelPatchEntryFilter {
+ @Accessors(PUBLIC_GETTER)
+ private ChangeDirection filteredDirection
+
+ new(ChangeDirection filteredDirection) {
+ checkNotNull(filteredDirection)
+ this.filteredDirection=filteredDirection
+ }
+
+ override isEntryFiltered(ModelPatchEntry entry) {
+ return entry.direction==filteredDirection
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/EntryPropertyFilter.xtend b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/EntryPropertyFilter.xtend
new file mode 100644
index 0000000..fd090ee
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/EntryPropertyFilter.xtend
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api.filters
+
+import org.eclipse.emf.diffmerge.patch.AttributeEntry
+import org.eclipse.emf.diffmerge.patch.ElementEntry
+import org.eclipse.emf.diffmerge.patch.ReferenceEntry
+import org.eclipse.emf.diffmerge.patch.StructuralFeatureEntry
+import org.eclipse.emf.diffmerge.patch.api.IModelPatchEntryFilter
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntryProperty
+import org.eclipse.xtend.lib.annotations.Accessors
+
+import static com.google.common.base.Preconditions.*
+
+class EntryPropertyFilter implements IModelPatchEntryFilter {
+ @Accessors(PUBLIC_GETTER)
+ private ModelPatchEntryProperty filteredProperty
+ @Accessors(PUBLIC_GETTER)
+ private String filteredValue
+
+ new(ModelPatchEntryProperty filteredProperty, String filteredValue) {
+ checkNotNull(filteredProperty)
+ checkNotNull(filteredValue)
+ this.filteredProperty = filteredProperty
+ this.filteredValue = filteredValue
+ }
+
+ override isEntryFiltered(ModelPatchEntry entry) {
+ var boolean result = false
+ switch(filteredProperty) {
+ case CONTEXT: {
+ result = filteredValue==entry.context.identifier
+ }
+ case FEATURE: {
+ if(entry instanceof StructuralFeatureEntry) {
+ result = filteredValue==entry.feature.identifier
+ }
+ }
+ case TARGET: {
+ if(entry instanceof ReferenceEntry) {
+ result = filteredValue==entry.target.identifier
+ }
+ }
+ case TYPE: {
+ if(entry instanceof ElementEntry) {
+ result = filteredValue==entry.type.identifier
+ }
+ }
+ case VALUE: {
+ if(entry instanceof AttributeEntry) {
+ result = filteredValue==entry.value
+ }
+ }
+ }
+ return result
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/EntryTypeFilter.xtend b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/EntryTypeFilter.xtend
new file mode 100644
index 0000000..9443819
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/api/filters/EntryTypeFilter.xtend
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017, Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.api.filters
+
+import org.eclipse.xtend.lib.annotations.Accessors
+import org.eclipse.emf.diffmerge.patch.api.EntryType
+import java.util.List
+import org.eclipse.emf.diffmerge.patch.api.IModelPatchEntryFilter
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchEntry
+
+import static com.google.common.base.Preconditions.*
+
+class EntryTypeFilter implements IModelPatchEntryFilter {
+ @Accessors(PUBLIC_GETTER)
+ private List<EntryType> filteredTypes
+
+ new(EntryType... filteredTypes) {
+ checkNotNull(filteredTypes)
+ this.filteredTypes = filteredTypes
+ }
+
+ override isEntryFiltered(ModelPatchEntry entry) {
+ return filteredTypes.exists[it==entry.entryType]
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/serializer/IModelPatchSerializer.java b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/serializer/IModelPatchSerializer.java
new file mode 100644
index 0000000..fffa595
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/src/org/eclipse/emf/diffmerge/patch/serializer/IModelPatchSerializer.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Abel Hegedus, Tamas Borbas, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.diffmerge.patch.serializer;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.emf.diffmerge.patch.api.ModelPatch;
+import org.eclipse.emf.diffmerge.patch.api.ModelPatchException;
+
+public interface IModelPatchSerializer {
+ /**
+ * Interface for saving the model patch to a new file.
+ * In the case of an already existing file the content is overwritten.
+ *
+ *
+ * @param modelPatch
+ * an initialized ModelPatch object with properly
+ * used JsonProperty annotations
+ * @param file
+ * the file to write to
+ *
+ * @throws IOException
+ * if some error occur during the JSON serialization
+ * @throws ModelPatchException
+ */
+
+ public void serialize(ModelPatch modelPatch, File file)
+ throws ModelPatchException;
+
+ public String serialize(ModelPatch modelPatch) throws ModelPatchException;
+
+ public InputStream serializeStream(ModelPatch modelPatch) throws ModelPatchException;
+
+ public ModelPatch load(File file) throws ModelPatchException;
+
+ public ModelPatch load(String jsonSource) throws ModelPatchException;
+
+ public ModelPatch load(InputStream jsonStream) throws ModelPatchException;
+
+}
+
+
diff --git a/plugins/org.eclipse.emf.diffmerge.patch/xtend-gen/.gitignore b/plugins/org.eclipse.emf.diffmerge.patch/xtend-gen/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/plugins/org.eclipse.emf.diffmerge.patch/xtend-gen/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/plugins/pom.xml b/plugins/pom.xml
new file mode 100644
index 0000000..a83aa15
--- /dev/null
+++ b/plugins/pom.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.parent</artifactId>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ <relativePath>../releng/org.eclipse.emf.diffmerge.patch.parent</relativePath>
+ </parent>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <artifactId>org.eclipse.emf.diffmerge.patch.plugins</artifactId>
+ <name>Model Patcher Plug-ins</name>
+ <version>0.1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>org.eclipse.emf.diffmerge.patch</module>
+ <module>org.eclipse.emf.diffmerge.patch.runtime</module>
+ <module>org.eclipse.emf.diffmerge.patch.persistence.json</module>
+ <module>org.eclipse.emf.diffmerge.patch.ui</module>
+ </modules>
+
+</project> \ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..dd76616
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <artifactId>org.eclipse.emf.diffmerge.patch.root</artifactId>
+ <name>Model Patcher Root</name>
+ <version>0.1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>releng/org.eclipse.emf.diffmerge.patch.parent</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.7</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project> \ No newline at end of file
diff --git a/releng/org.eclipse.emf.diffmerge.patch.parent/.project b/releng/org.eclipse.emf.diffmerge.patch.parent/.project
new file mode 100644
index 0000000..2632efe
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.parent/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.patch.parent</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/releng/org.eclipse.emf.diffmerge.patch.parent/.settings/org.eclipse.core.resources.prefs b/releng/org.eclipse.emf.diffmerge.patch.parent/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.parent/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/releng/org.eclipse.emf.diffmerge.patch.parent/.settings/org.eclipse.core.runtime.prefs b/releng/org.eclipse.emf.diffmerge.patch.parent/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.parent/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/releng/org.eclipse.emf.diffmerge.patch.parent/header.epl.txt b/releng/org.eclipse.emf.diffmerge.patch.parent/header.epl.txt
new file mode 100644
index 0000000..0b0d600
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.parent/header.epl.txt
@@ -0,0 +1,4 @@
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
diff --git a/releng/org.eclipse.emf.diffmerge.patch.parent/pom.xml b/releng/org.eclipse.emf.diffmerge.patch.parent/pom.xml
new file mode 100644
index 0000000..1468970
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.parent/pom.xml
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (c) 2016-2017 Thales Global Services S.A.S. All rights reserved.
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html Contributors:
+ Abel Hegedus, Tamas Borbas, Balazs Grill, Daniel Segesdi (IncQuery Labs Ltd.)
+ - initial API and implementation -->
+
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <artifactId>org.eclipse.emf.diffmerge.patch.parent</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <name>Model Patcher</name>
+ <url></url>
+ <packaging>pom</packaging>
+ <properties>
+ <tycho.version>0.24.0</tycho.version>
+ <xtend.compiler.version>2.10.0</xtend.compiler.version>
+ <viatra.repository.url>http://download.eclipse.org/viatra/updates/integration</viatra.repository.url>
+ <viatra.compiler.version>1.6.0-SNAPSHOT</viatra.compiler.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <sonar.skippedModules></sonar.skippedModules>
+ <rcptt.version>2.0.0</rcptt.version>
+ <!-- Composite site related properties -->
+ <patch.updates.label>EMF DiffMerge Model Patch</patch.updates.label>
+ <patch.updates.dir>updates</patch.updates.dir>
+ <patch.download.area>target/composite</patch.download.area>
+ </properties>
+ <modules>
+ <!-- Target platform -->
+ <module>../org.eclipse.emf.diffmerge.patch.target</module>
+
+ <module>../../plugins</module>
+ <module>../../examples</module>
+ <module>../../tests</module>
+ <module>../../features</module>
+ <module>../org.eclipse.emf.diffmerge.patch.update</module>
+ </modules>
+
+ <profiles>
+ <profile>
+ <id>gui.test</id>
+ <modules>
+ <!-- Product -->
+ <module>../org.eclipse.emf.diffmerge.patch.product</module>
+ </modules>
+ </profile>
+ <profile>
+ <id>license-check</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <!-- license -->
+ <plugin>
+ <groupId>com.mycila</groupId>
+ <artifactId>license-maven-plugin</artifactId>
+ <configuration>
+ <inlineHeader>
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License
+ v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+ </inlineHeader>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <failIfMissing>true</failIfMissing>
+ <strictCheck>false</strictCheck>
+ <aggregate>true</aggregate>
+ <includes>
+ <include>**/*.java</include>
+ <include>**/*.xtend</include>
+ </includes>
+ <excludes>
+ <exclude>**/src/site/**</exclude>
+ <exclude>**/target/**</exclude>
+ <exclude>**/src-gen/**</exclude>
+ <exclude>**/xtend-gen/**</exclude>
+ </excludes>
+ <mapping>
+ <xtend>JAVADOC_STYLE</xtend>
+ </mapping>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-packaging-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <strictBinIncludes>false</strictBinIncludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <target>
+ <artifact>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <artifactId>org.eclipse.emf.diffmerge.patch.target</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <!-- TODO: What should be here? -->
+ <relativePath>org.eclipse.emf.diffmerge.patch.target/pom.xml</relativePath>
+ </artifact>
+ </target>
+ <!-- <environments> -->
+ <!-- <environment> -->
+ <!-- <os>win32</os> -->
+ <!-- <ws>win32</ws> -->
+ <!-- <arch>x86_64</arch> -->
+ <!-- </environment> -->
+ <!-- <environment> -->
+ <!-- <os>linux</os> -->
+ <!-- <ws>gtk</ws> -->
+ <!-- <arch>x86_64</arch> -->
+ <!-- </environment> -->
+ <!-- </environments> -->
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <excludes>
+ <exclude>**/queries/*.java</exclude>
+ </excludes>
+ <failIfNoTests>false</failIfNoTests>
+ <skipTests>false</skipTests>
+ </configuration>
+ <!-- <executions> <execution> <id>unit-test</id> <goals> <goal>test</goal>
+ </goals> <phase>test</phase> <configuration> <excludes> <exclude>**/IntegrationTest*.java</exclude>
+ </excludes> <includes> <include>**/*Test.java</include> </includes> </configuration>
+ </execution> </executions> -->
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.xtend</groupId>
+ <artifactId>xtend-maven-plugin</artifactId>
+ <version>${xtend.compiler.version}</version>
+ <configuration>
+ <!-- need to prefix by basedir to generate to currently built module -->
+ <outputDirectory>${basedir}/xtend-gen</outputDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ <plugin>
+ <groupId>com.mycila</groupId>
+ <artifactId>license-maven-plugin</artifactId>
+ <version>3.0</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <repositories>
+ <repository>
+ <id>viatra.update</id>
+ <layout>p2</layout>
+ <url>${viatra.repository.url}</url>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>viatra-snapshots</id>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <url>https://repo.eclipse.org/content/repositories/viatra-snapshots/</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>rcptt-releases</id>
+ <name>RCPTT Maven repository</name>
+ <url>https://repo.eclipse.org/content/repositories/rcptt-releases
+ </url>
+ <snapshots>
+ <updatePolicy>always</updatePolicy>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+</project>
diff --git a/releng/org.eclipse.emf.diffmerge.patch.product/.project b/releng/org.eclipse.emf.diffmerge.patch.product/.project
new file mode 100644
index 0000000..89cbed7
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.product/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.patch.product</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/releng/org.eclipse.emf.diffmerge.patch.product/.settings/org.eclipse.core.resources.prefs b/releng/org.eclipse.emf.diffmerge.patch.product/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.product/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/releng/org.eclipse.emf.diffmerge.patch.product/.settings/org.eclipse.core.runtime.prefs b/releng/org.eclipse.emf.diffmerge.patch.product/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.product/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/releng/org.eclipse.emf.diffmerge.patch.product/modelpatch_rcp.product b/releng/org.eclipse.emf.diffmerge.patch.product/modelpatch_rcp.product
new file mode 100644
index 0000000..c11b42b
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.product/modelpatch_rcp.product
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product name="Model Patch RCP Application" uid="org.eclipse.emf.diffmerge.patch.product.rcp" id="org.eclipse.sdk.ide" application="org.eclipse.ui.ide.workbench" version="0.1.0.qualifier" useFeatures="true" includeLaunchers="true">
+
+ <configIni use="default">
+ </configIni>
+
+ <launcherArgs>
+ <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
+ </vmArgsMac>
+ </launcherArgs>
+
+ <windowImages/>
+
+ <launcher>
+ <solaris/>
+ <win useIco="false">
+ <bmp/>
+ </win>
+ </launcher>
+
+ <vm>
+ </vm>
+
+ <license>
+ <url>http://www.eclipse.org/legal/epl-v10.html</url>
+ <text>
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ Abel Hegedus, Tamas Borbas, Balazs Grill, Peter Lunk, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ </text>
+ </license>
+
+ <plugins>
+ </plugins>
+
+ <features>
+ <feature id="org.eclipse.emf.diffmerge.patch.feature.dependencies" version="0.1.0.qualifier"/>
+ <feature id="org.eclipse.emf.diffmerge.patch.feature" version="0.1.0.qualifier"/>
+ <feature id="org.eclipse.emf"/>
+ <feature id="org.eclipse.rcp"/>
+ <feature id="org.eclipse.gmf"/>
+ <feature id="org.eclipse.e4.rcp"/>
+ <feature id="org.eclipse.platform"/>
+ <feature id="org.eclipse.jdt"/>
+ <feature id="org.eclipse.sdk"/>
+ <feature id="org.eclipse.gmf.runtime.thirdparty"/>
+ <feature id="org.eclipse.ecf.filetransfer.httpclient4.feature"/>
+ <feature id="org.eclipse.emf.mapping.ecore"/>
+ <feature id="org.eclipse.help"/>
+ <feature id="org.eclipse.help.source"/>
+ <feature id="org.eclipse.emf.codegen"/>
+ <feature id="org.eclipse.equinox.p2.core.feature"/>
+ <feature id="org.eclipse.cvs.source"/>
+ <feature id="org.eclipse.rcp.source"/>
+ <feature id="org.eclipse.ecf.core.ssl.feature"/>
+ <feature id="org.eclipse.ecf.filetransfer.ssl.feature"/>
+ <feature id="org.eclipse.gef"/>
+ <feature id="org.eclipse.draw2d"/>
+ <feature id="org.eclipse.emf.edit"/>
+ <feature id="org.eclipse.ecf.core.ssl.source.feature"/>
+ <feature id="org.eclipse.emf.transaction"/>
+ <feature id="org.eclipse.equinox.p2.user.ui.source"/>
+ <feature id="org.eclipse.emf.codegen.ui"/>
+ <feature id="org.eclipse.ecf.core.source.feature"/>
+ <feature id="org.eclipse.emf.databinding.edit"/>
+ <feature id="org.eclipse.emf.common.source"/>
+ <feature id="org.eclipse.jdt.source"/>
+ <feature id="org.eclipse.emf.codegen.ecore"/>
+ <feature id="org.eclipse.emf.converter"/>
+ <feature id="org.eclipse.emf.edit.ui"/>
+ <feature id="org.eclipse.cvs"/>
+ <feature id="org.eclipse.equinox.p2.rcp.feature"/>
+ <feature id="org.eclipse.ecf.filetransfer.feature"/>
+ <feature id="org.eclipse.emf.workspace"/>
+ <feature id="org.eclipse.equinox.p2.rcp.feature.source"/>
+ <feature id="org.eclipse.emf.ecore.source"/>
+ <feature id="org.eclipse.ecf.filetransfer.source.feature"/>
+ <feature id="org.eclipse.pde"/>
+ <feature id="org.eclipse.ecf.filetransfer.httpclient4.ssl.feature"/>
+ <feature id="org.eclipse.equinox.p2.core.feature.source"/>
+ <feature id="org.eclipse.emf.common.ui"/>
+ <feature id="org.eclipse.emf.common"/>
+ <feature id="org.eclipse.emf.mapping.ui"/>
+ <feature id="org.eclipse.platform.source"/>
+ <feature id="org.eclipse.pde.source"/>
+ <feature id="org.eclipse.emf.mapping"/>
+ <feature id="org.eclipse.ecf.filetransfer.ssl.source.feature"/>
+ <feature id="org.eclipse.emf.ecore"/>
+ <feature id="org.eclipse.equinox.p2.user.ui"/>
+ <feature id="org.eclipse.equinox.p2.extras.feature"/>
+ <feature id="org.eclipse.equinox.p2.extras.feature.source"/>
+ <feature id="org.eclipse.emf.codegen.ecore.ui"/>
+ <feature id="org.eclipse.gmf.runtime.notation"/>
+ <feature id="org.eclipse.ecf.core.feature"/>
+ <feature id="org.eclipse.emf.ecore.editor"/>
+ <feature id="org.eclipse.ecf.filetransfer.httpclient4.ssl.source.feature"/>
+ <feature id="org.eclipse.emf.mapping.ecore.editor"/>
+ <feature id="org.eclipse.ecf.filetransfer.httpclient4.source.feature"/>
+ <feature id="org.eclipse.emf.databinding"/>
+ <feature id="org.eclipse.emf.ecore.edit"/>
+ <feature id="org.eclipse.emf.validation"/>
+ <feature id="org.eclipse.e4.rcp.source"/>
+ <feature id="org.eclipse.viatra.query.runtime.feature"/>
+ <feature id="org.eclipse.viatra.transformation.runtime.emf.feature"/>
+ <feature id="org.eclipse.xtext.xbase.lib"/>
+ </features>
+
+ <configurations>
+ <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
+ <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
+ <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
+ <plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
+ <plugin id="org.eclipse.equinox.p2.reconciler.dropins" autoStart="true" startLevel="0" />
+ <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
+ </configurations>
+
+ <preferencesInfo>
+ <targetfile overwrite="false"/>
+ </preferencesInfo>
+
+ <cssInfo>
+ </cssInfo>
+
+</product>
diff --git a/releng/org.eclipse.emf.diffmerge.patch.product/pom.xml b/releng/org.eclipse.emf.diffmerge.patch.product/pom.xml
new file mode 100644
index 0000000..0c69f6a
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.product/pom.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016-2017 Thales Global Services S.A.S.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Abel Hegedus, Tamas Borbas, Daniel Segesdi (IncQuery Labs Ltd.) - initial API and implementation
+ -->
+
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.parent</artifactId>
+ <groupId>org.eclipse.emf.diffmerge.patch</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.emf.diffmerge.patch.parent</relativePath>
+ </parent>
+ <artifactId>org.eclipse.emf.diffmerge.patch.product</artifactId>
+ <packaging>eclipse-repository</packaging>
+ <version>0.1.0-SNAPSHOT</version>
+ <properties>
+ <rootPath>${basedir}/../</rootPath>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-repository-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <includeAllDependencies>true</includeAllDependencies>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-director-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <executions>
+ <execution>
+ <id>materialize-products</id>
+ <goals>
+ <goal>materialize-products</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>archive-products</id>
+ <goals>
+ <goal>archive-products</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/releng/org.eclipse.emf.diffmerge.patch.setup/.project b/releng/org.eclipse.emf.diffmerge.patch.setup/.project
new file mode 100644
index 0000000..9a31a20
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.setup/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.patch.setup</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/releng/org.eclipse.emf.diffmerge.patch.setup/.settings/org.eclipse.core.resources.prefs b/releng/org.eclipse.emf.diffmerge.patch.setup/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.setup/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/releng/org.eclipse.emf.diffmerge.patch.setup/.settings/org.eclipse.core.runtime.prefs b/releng/org.eclipse.emf.diffmerge.patch.setup/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.setup/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/releng/org.eclipse.emf.diffmerge.patch.setup/Modelpatch.setup b/releng/org.eclipse.emf.diffmerge.patch.setup/Modelpatch.setup
new file mode 100644
index 0000000..6cba333
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.setup/Modelpatch.setup
@@ -0,0 +1,451 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<setup:Project
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:git="http://www.eclipse.org/oomph/setup/git/1.0"
+ xmlns:jdt="http://www.eclipse.org/oomph/setup/jdt/1.0"
+ xmlns:predicates="http://www.eclipse.org/oomph/predicates/1.0"
+ xmlns:projects="http://www.eclipse.org/oomph/setup/projects/1.0"
+ xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
+ xmlns:setup.p2="http://www.eclipse.org/oomph/setup/p2/1.0"
+ xmlns:setup.targlets="http://www.eclipse.org/oomph/setup/targlets/1.0"
+ xmlns:setup.workingsets="http://www.eclipse.org/oomph/setup/workingsets/1.0"
+ xsi:schemaLocation="http://www.eclipse.org/oomph/setup/git/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Git.ecore http://www.eclipse.org/oomph/setup/jdt/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/JDT.ecore http://www.eclipse.org/oomph/predicates/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Predicates.ecore http://www.eclipse.org/oomph/setup/projects/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Projects.ecore http://www.eclipse.org/oomph/setup/targlets/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/SetupTarglets.ecore http://www.eclipse.org/oomph/setup/workingsets/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/SetupWorkingSets.ecore"
+ name="edm.patch"
+ label="EMF DiffMerge Model Patch">
+ <setupTask
+ xsi:type="jdt:JRETask"
+ version="JavaSE-1.7"
+ location="${jre.location-1.7}">
+ <description>Define the JRE needed to compile and run the Java projects of ${scope.project.label}</description>
+ </setupTask>
+ <setupTask
+ xsi:type="setup:EclipseIniTask"
+ option="-Xmx"
+ value="1024m"
+ vm="true">
+ <description>Set the heap space needed to work with the projects of ${scope.project.label}</description>
+ </setupTask>
+ <setupTask
+ xsi:type="setup:ResourceCreationTask"
+ excludedTriggers="STARTUP MANUAL"
+ content="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xD;&#xA;&lt;section name=&quot;Workbench&quot;>&#xD;&#xA;&#x9;&lt;section name=&quot;org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart&quot;>&#xD;&#xA;&#x9;&#x9;&lt;item value=&quot;true&quot; key=&quot;group_libraries&quot;/>&#xD;&#xA;&#x9;&#x9;&lt;item value=&quot;false&quot; key=&quot;linkWithEditor&quot;/>&#xD;&#xA;&#x9;&#x9;&lt;item value=&quot;2&quot; key=&quot;layout&quot;/>&#xD;&#xA;&#x9;&#x9;&lt;item value=&quot;2&quot; key=&quot;rootMode&quot;/>&#xD;&#xA;&#x9;&#x9;&lt;item value=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;#x0D;&amp;#x0A;&amp;lt;packageExplorer configured=&amp;quot;true&amp;quot; group_libraries=&amp;quot;1&amp;quot; layout=&amp;quot;2&amp;quot; linkWithEditor=&amp;quot;0&amp;quot; rootMode=&amp;quot;2&amp;quot; sortWorkingSets=&amp;quot;false&amp;quot; workingSetName=&amp;quot;&amp;quot;&amp;gt;&amp;#x0D;&amp;#x0A;&amp;lt;localWorkingSetManager&amp;gt;&amp;#x0D;&amp;#x0A;&amp;lt;workingSet editPageId=&amp;quot;org.eclipse.jdt.internal.ui.OthersWorkingSet&amp;quot; factoryID=&amp;quot;org.eclipse.ui.internal.WorkingSetFactory&amp;quot; id=&amp;quot;1382792884467_1&amp;quot; label=&amp;quot;Other Projects&amp;quot; name=&amp;quot;Other Projects&amp;quot;/&amp;gt;&amp;#x0D;&amp;#x0A;&amp;lt;/localWorkingSetManager&amp;gt;&amp;#x0D;&amp;#x0A;&amp;lt;activeWorkingSet workingSetName=&amp;quot;Other Projects&amp;quot;/&amp;gt;&amp;#x0D;&amp;#x0A;&amp;lt;allWorkingSets workingSetName=&amp;quot;Other Projects&amp;quot;/&amp;gt;&amp;#x0D;&amp;#x0A;&amp;lt;/packageExplorer&amp;gt;&quot; key=&quot;memento&quot;/>&#xD;&#xA;&#x9;&lt;/section>&#xD;&#xA;&lt;/section>&#xD;&#xA;"
+ targetURL="${workspace.location|uri}/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml"
+ encoding="UTF-8">
+ <description>Initialize JDT's package explorer to show working sets as its root objects</description>
+ </setupTask>
+ <setupTask
+ xsi:type="setup:CompoundTask"
+ name="Eclipse Preferences">
+ <setupTask
+ xsi:type="setup:CompoundTask"
+ name="org.eclipse.core.resources">
+ <setupTask
+ xsi:type="setup:PreferenceTask"
+ key="/instance/org.eclipse.core.resources/encoding"
+ value="UTF-8"/>
+ <setupTask
+ xsi:type="setup:PreferenceTask"
+ key="/instance/org.eclipse.core.resources/refresh.enabled"
+ value="true"/>
+ </setupTask>
+ <setupTask
+ xsi:type="setup:CompoundTask"
+ name="org.eclipse.ui.editors">
+ <setupTask
+ xsi:type="setup:PreferenceTask"
+ key="/instance/org.eclipse.ui.editors/spacesForTabs"
+ value="true"/>
+ <setupTask
+ xsi:type="setup:PreferenceTask"
+ key="/instance/org.eclipse.ui.editors/tabWidth"
+ value="2"/>
+ </setupTask>
+ <setupTask
+ xsi:type="setup:CompoundTask"
+ name="org.eclipse.jdt.core">
+ <setupTask
+ xsi:type="setup:PreferenceTask"
+ key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.codegen.targetPlatform"
+ value="1.7"/>
+ <setupTask
+ xsi:type="setup:PreferenceTask"
+ key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.compliance"
+ value="1.7"/>
+ <setupTask
+ xsi:type="setup:PreferenceTask"
+ key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.source"
+ value="1.7"/>
+ </setupTask>
+ <setupTask
+ xsi:type="setup:CompoundTask"
+ name="org.eclipse.jdt.ui">
+ <setupTask
+ xsi:type="setup:PreferenceTask"
+ key="/instance/org.eclipse.jdt.ui/formatter_profile"
+ value="_EMF-DiffMerge"/>
+ <setupTask
+ xsi:type="setup:PreferenceTask"
+ key="/instance/org.eclipse.jdt.ui/formatter_settings_version"
+ value="12"/>
+ <setupTask
+ xsi:type="setup:PreferenceTask"
+ key="/instance/org.eclipse.jdt.ui/org.eclipse.jdt.ui.formatterprofiles"
+ value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?>&#xD;&#xA;&lt;profiles version=&quot;12&quot;>&#xD;&#xA;&lt;profile kind=&quot;CodeFormatterProfile&quot; name=&quot;EMF-DiffMerge&quot; version=&quot;12&quot;>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_ellipsis&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment&quot; value=&quot;common_lines&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation&quot; value=&quot;common_lines&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.blank_lines_after_imports&quot; value=&quot;1&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement&quot; value=&quot;common_lines&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.format_javadoc_comments&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.indentation.size&quot; value=&quot;2&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration&quot; value=&quot;common_lines&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.disabling_tag&quot; value=&quot;@formatter:off&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.continuation_indentation&quot; value=&quot;2&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_enum_constants&quot; value=&quot;0&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.blank_lines_before_imports&quot; value=&quot;1&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.blank_lines_after_package&quot; value=&quot;1&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_binary_operator&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement&quot; value=&quot;common_lines&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.indent_root_tags&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.enabling_tag&quot; value=&quot;@formatter:on&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations&quot; value=&quot;1&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references&quot; value=&quot;0&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.compiler.problem.enumIdentifier&quot; value=&quot;error&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.indent_statements_compare_to_block&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration&quot; value=&quot;end_of_line&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.line_length&quot; value=&quot;80&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.use_on_off_tags&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.brace_position_for_method_declaration&quot; value=&quot;end_of_line&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body&quot; value=&quot;0&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_binary_expression&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause&quot; value=&quot;common_lines&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.brace_position_for_block&quot; value=&quot;end_of_line&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration&quot; value=&quot;end_of_line&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.brace_position_for_lambda_body&quot; value=&quot;end_of_line&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.compact_else_if&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_type_parameters&quot; value=&quot;0&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.compiler.problem.assertIdentifier&quot; value=&quot;error&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_binary_operator&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_unary_operator&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve&quot; value=&quot;1&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation&quot; value=&quot;common_lines&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_ellipsis&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.format_line_comments&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.align_type_members_on_columns&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_assignment&quot; value=&quot;0&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration&quot; value=&quot;0&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_conditional_expression&quot; value=&quot;80&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration&quot; value=&quot;end_of_line&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.brace_position_for_block_in_case&quot; value=&quot;end_of_line&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.format_header&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode&quot; value=&quot;enabled&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_method_declaration&quot; value=&quot;0&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.join_wrapped_lines&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.wrap_before_conditional_operator&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines&quot; value=&quot;2147483647&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration&quot; value=&quot;end_of_line&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_resources_in_try&quot; value=&quot;80&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause&quot; value=&quot;common_lines&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.compiler.source&quot; value=&quot;1.8&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.tabulation.size&quot; value=&quot;2&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.format_source_code&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.blank_lines_before_field&quot; value=&quot;0&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer&quot; value=&quot;2&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.blank_lines_before_method&quot; value=&quot;1&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.wrap_before_assignment_operator&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.compiler.codegen.targetPlatform&quot; value=&quot;1.8&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.brace_position_for_switch&quot; value=&quot;end_of_line&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.format_html&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration&quot; value=&quot;common_lines&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_compact_if&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.indent_empty_lines&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_type_arguments&quot; value=&quot;0&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_unary_operator&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation&quot; value=&quot;0&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk&quot; value=&quot;1&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_after_label&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.blank_lines_before_member_type&quot; value=&quot;1&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_semicolon&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.format_block_comments&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line&quot; value=&quot;false&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.indent_statements_compare_to_body&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_multiple_fields&quot; value=&quot;16&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.brace_position_for_array_initializer&quot; value=&quot;end_of_line&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.wrap_before_binary_operator&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.compiler.compliance&quot; value=&quot;1.8&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration&quot; value=&quot;common_lines&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.brace_position_for_enum_constant&quot; value=&quot;end_of_line&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.brace_position_for_type_declaration&quot; value=&quot;end_of_line&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.blank_lines_before_package&quot; value=&quot;0&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header&quot; value=&quot;0&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.join_lines_in_comments&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.comment.indent_parameter_description&quot; value=&quot;true&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.tabulation.char&quot; value=&quot;space&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.blank_lines_between_import_groups&quot; value=&quot;1&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.lineSplit&quot; value=&quot;120&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation&quot; value=&quot;do not insert&quot;/>&#xD;&#xA;&lt;setting id=&quot;org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch&quot; value=&quot;insert&quot;/>&#xD;&#xA;&lt;/profile>&#xD;&#xA;&lt;/profiles>&#xD;&#xA;"/>
+ </setupTask>
+ <description></description>
+ </setupTask>
+ <setupTask
+ xsi:type="setup.p2:P2Task">
+ <requirement
+ name="org.eclipse.emf.ecoretools.design.feature.group"/>
+ <requirement
+ name="org.eclipse.emf.sdk.feature.group"/>
+ <requirement
+ name="org.eclipse.pde.feature.group"/>
+ <requirement
+ name="org.eclipse.xtend.sdk.feature.group"/>
+ <requirement
+ name="org.eclipse.egf.sdk.feature.group"
+ versionRange="1.3.0"
+ filter=""/>
+ <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"/>
+ <repository
+ url="${eclipse.repository}"/>
+ <repository
+ url="${viatra.repository}"/>
+ <repository
+ 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
+ xsi:type="git:GitCloneTask"
+ id="git.clone.viatra.examples"
+ remoteURI="viatra/org.eclipse.viatra.examples"
+ checkoutBranch="master">
+ <annotation
+ source="http://www.eclipse.org/oomph/setup/InducedChoices">
+ <detail
+ key="inherit">
+ <value>eclipse.git.gerrit.remoteURIs</value>
+ </detail>
+ <detail
+ key="label">
+ <value>VIATRA Examples Git or Gerrit repository</value>
+ </detail>
+ <detail
+ key="target">
+ <value>remoteURI</value>
+ </detail>
+ </annotation>
+ <description>VIATRA Examples</description>
+ </setupTask>
+ <setupTask
+ xsi:type="git:GitCloneTask"
+ id="git.clone.edm"
+ remoteURI="diffmerge/org.eclipse.emf.diffmerge.core"
+ pushURI=""
+ checkoutBranch="master">
+ <annotation
+ source="http://www.eclipse.org/oomph/setup/InducedChoices">
+ <detail
+ key="inherit">
+ <value>eclipse.git.gerrit.remoteURIs</value>
+ </detail>
+ <detail
+ key="label">
+ <value>EMF Diff/Merge Core Git or Gerrit repository</value>
+ </detail>
+ <detail
+ key="target">
+ <value>remoteURI</value>
+ </detail>
+ </annotation>
+ <description>Clone sources</description>
+ </setupTask>
+ <setupTask
+ xsi:type="git:GitCloneTask"
+ id="git.clone.edm.patch"
+ remoteURI="diffmerge/org.eclipse.emf.diffmerge.patch"
+ pushURI=""
+ checkoutBranch="master">
+ <annotation
+ source="http://www.eclipse.org/oomph/setup/InducedChoices">
+ <detail
+ key="inherit">
+ <value>eclipse.git.gerrit.remoteURIs</value>
+ </detail>
+ <detail
+ key="label">
+ <value>EMF Diff/Merge Patch Git or Gerrit repository</value>
+ </detail>
+ <detail
+ key="target">
+ <value>remoteURI</value>
+ </detail>
+ </annotation>
+ <description>Clone sources</description>
+ </setupTask>
+ <setupTask
+ xsi:type="projects:ProjectsImportTask">
+ <sourceLocator
+ rootFolder="${git.clone.edm.patch.location}"
+ locateNestedProjects="true"/>
+ <sourceLocator
+ rootFolder="${git.clone.viatra.examples.location}/cps"
+ locateNestedProjects="true">
+ <predicate
+ xsi:type="predicates:OrPredicate">
+ <operand
+ xsi:type="predicates:AndPredicate">
+ <operand
+ xsi:type="predicates:LocationPredicate"
+ pattern=".*/domains/.*"/>
+ <operand
+ xsi:type="predicates:OrPredicate">
+ <operand
+ xsi:type="predicates:NamePredicate"
+ pattern=".*model"/>
+ <operand
+ xsi:type="predicates:NamePredicate"
+ pattern=".*deployment"/>
+ <operand
+ xsi:type="predicates:NamePredicate"
+ pattern=".*traceability"/>
+ </operand>
+ </operand>
+ <operand
+ xsi:type="predicates:LocationPredicate"
+ pattern=".*/generator/.*"/>
+ <operand
+ xsi:type="predicates:AndPredicate">
+ <operand
+ xsi:type="predicates:LocationPredicate"
+ pattern=".*/tests/.*"/>
+ <operand
+ xsi:type="predicates:OrPredicate">
+ <operand
+ xsi:type="predicates:NamePredicate"
+ pattern=".*cps.tests.util"/>
+ <operand
+ xsi:type="predicates:NamePredicate"
+ pattern=".*cps.generator.tests"/>
+ </operand>
+ </operand>
+ </predicate>
+ </sourceLocator>
+ <sourceLocator
+ rootFolder="${git.clone.edm.location}"
+ locateNestedProjects="true">
+ <predicate
+ xsi:type="predicates:OrPredicate">
+ <operand
+ xsi:type="predicates:LocationPredicate"
+ pattern=".*/plugins/.*"/>
+ <operand
+ xsi:type="predicates:LocationPredicate"
+ pattern=".*/releng/.*"/>
+ <operand
+ xsi:type="predicates:LocationPredicate"
+ pattern=".*/features/.*"/>
+ </predicate>
+ </sourceLocator>
+ <description></description>
+ </setupTask>
+ <setupTask
+ xsi:type="setup.targlets:TargletTask">
+ <targlet
+ name="${scope.project.label}"
+ activeRepositoryList="Repositories">
+ <annotation
+ source="http:/www.eclipse.org/oomph/targlets/TargetDefinitionGenerator">
+ <detail
+ key="location">
+ <value>${git.clone.modelpatch.location/releng/org.eclipse.emf.diffmerge.patch.target/org.eclipse.emf.diffmerge.patch.oomphgen.target}</value>
+ </detail>
+ <detail
+ key="includeAllPlatforms">
+ <value>false</value>
+ </detail>
+ <detail
+ key="includeSource">
+ <value>false</value>
+ </detail>
+ <detail
+ key="generateVersions">
+ <value>true</value>
+ </detail>
+ </annotation>
+ <requirement
+ name="org.eclipse.emf.sdk.feature.group"/>
+ <requirement
+ name="org.eclipse.equinox.executable.feature.group"/>
+ <requirement
+ name="org.eclipse.viatra.query.runtime.feature.feature.group"/>
+ <requirement
+ name="org.eclipse.viatra.transformation.runtime.emf.feature.feature.group"/>
+ <requirement
+ name="org.eclipse.sdk.feature.group"/>
+ <requirement
+ name="org.junit"
+ versionRange="4.11.0"/>
+ <requirement
+ name="org.eclipse.emf.diffmerge.sdk.feature.feature.group"/>
+ <requirement
+ name="org.eclipse.equinox.concurrent"/>
+ <requirement
+ name="com.google.gson"/>
+ <requirement
+ name="com.google.gson.source"/>
+ <repositoryList
+ name="Repositories">
+ <repository
+ url="${orbit.repository}"/>
+ <repository
+ url="${eclipse.repository}"/>
+ <repository
+ url="${viatra.repository}"/>
+ <repository
+ url="${diffmerge.repository}"/>
+ </repositoryList>
+ </targlet>
+ <targlet
+ name="EMF Diff/Merge Core">
+ <requirement
+ name="org.polarion.eclipse.team.svn.connector.feature.group"/>
+ <requirement
+ name="org.polarion.eclipse.team.svn.connector.svnkit18.feature.group"/>
+ <requirement
+ name="org.eclipse.team.svn.feature.group"/>
+ <requirement
+ name="org.eclipse.egit.feature.group"/>
+ <requirement
+ name="org.eclipse.gmf.feature.group"
+ filter=""/>
+ <requirement
+ name="org.eclipse.egf.sdk.feature.group"
+ versionRange="1.3.0"
+ filter=""/>
+ <repositoryList>
+ <repository
+ url="${eclipse.repository}"/>
+ <repository
+ url="http://community.polarion.com/projects/subversive/download/eclipse/5.0/update-site/"/>
+ </repositoryList>
+ </targlet>
+ </setupTask>
+ <setupTask
+ xsi:type="setup.workingsets:WorkingSetTask">
+ <workingSet
+ name="Model Patch">
+ <predicate
+ xsi:type="predicates:AndPredicate">
+ <operand
+ xsi:type="predicates:RepositoryPredicate"
+ project="org.eclipse.emf.diffmerge.patch"/>
+ <operand
+ xsi:type="predicates:NamePredicate"
+ pattern="org\.eclipse\.emf\.diffmerge\.patch.*"/>
+ <operand
+ xsi:type="predicates:NotPredicate">
+ <operand
+ xsi:type="predicates:NamePredicate"
+ pattern=".*\.tests.*"/>
+ </operand>
+ </predicate>
+ </workingSet>
+ <workingSet
+ name="Model Patch Tests">
+ <predicate
+ xsi:type="predicates:AndPredicate">
+ <operand
+ xsi:type="predicates:RepositoryPredicate"
+ project="org.eclipse.emf.diffmerge.patch"/>
+ <operand
+ xsi:type="predicates:NamePredicate"
+ pattern="org\.eclipse\.emf\.diffmerge\.patch.*\.tests.*"/>
+ </predicate>
+ </workingSet>
+ <workingSet
+ name="CPS Example">
+ <predicate
+ xsi:type="predicates:AndPredicate">
+ <operand
+ xsi:type="predicates:NamePredicate"
+ pattern=".*examples.cps.*"/>
+ </predicate>
+ </workingSet>
+ <workingSet
+ name="EMF Diff/Merge Core">
+ <predicate
+ xsi:type="predicates:AndPredicate">
+ <operand
+ xsi:type="predicates:RepositoryPredicate"
+ project="org.eclipse.emf.diffmerge"/>
+ <operand
+ xsi:type="predicates:OrPredicate">
+ <operand
+ xsi:type="predicates:NamePredicate"
+ pattern="org.eclipse.emf.diffmerge"/>
+ <operand
+ xsi:type="predicates:NamePredicate"
+ pattern="org.eclipse.emf.diffmerge.*"/>
+ </operand>
+ </predicate>
+ </workingSet>
+ </setupTask>
+ <setupTask
+ xsi:type="setup:VariableTask"
+ name="diffmerge.repository"
+ value="http://download.eclipse.org/diffmerge/updates/oxygen/official">
+ <description>DiffMerge</description>
+ </setupTask>
+ <setupTask
+ xsi:type="setup:VariableTask"
+ name="eclipse.repository"
+ value="http://download.eclipse.org/releases/mars/">
+ <description>Eclipse</description>
+ </setupTask>
+ <setupTask
+ xsi:type="setup:VariableTask"
+ name="viatra.repository"
+ value="http://download.eclipse.org/viatra/updates/integration">
+ <description>Patterns</description>
+ </setupTask>
+ <setupTask
+ xsi:type="setup:VariableTask"
+ name="orbit.repository"
+ value="http://download.eclipse.org/tools/orbit/downloads/drops/R20140525021250/repository">
+ <description>Orbit</description>
+ </setupTask>
+ <setupTask
+ xsi:type="setup:VariableTask"
+ name="xtext.repository"
+ value="http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases">
+ <description>Patterns</description>
+ </setupTask>
+ <stream name="master"
+ label="master">
+ <setupTask
+ xsi:type="setup:EclipseIniTask"
+ option="-Doomph.redirection.edm.patch"
+ value="=https://git.eclipse.org/c/diffmerge/org.eclipse.emf.diffmerge.patch/plain/releng/org.eclipse.emf.diffmerge.patch.setup/Modelpatch.setup->${git.clone.edm.patch.location|uri}/releng/org.eclipse.emf.diffmerge.patch.setup/Modelpatch.setup"
+ vm="true">
+ <description></description>
+ </setupTask>
+ </stream>
+ <logicalProjectContainer
+ xsi:type="setup:ProjectCatalog"
+ href="index:/org.eclipse.setup#//@projectCatalogs[name='org.eclipse']"/>
+ <description>Model Patch is an EMF Diff/Merge component to record, view, filter and apply patches on EMF models.</description>
+</setup:Project>
diff --git a/releng/org.eclipse.emf.diffmerge.patch.target/.gitignore b/releng/org.eclipse.emf.diffmerge.patch.target/.gitignore
new file mode 100644
index 0000000..9f254e8
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.target/.gitignore
@@ -0,0 +1 @@
+/org.eclipse.emf.diffmerge.patch.oomphgen.target
diff --git a/releng/org.eclipse.emf.diffmerge.patch.target/.project b/releng/org.eclipse.emf.diffmerge.patch.target/.project
new file mode 100644
index 0000000..6c51d97
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.target/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.patch.target</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/releng/org.eclipse.emf.diffmerge.patch.target/.settings/org.eclipse.core.resources.prefs b/releng/org.eclipse.emf.diffmerge.patch.target/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.target/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/releng/org.eclipse.emf.diffmerge.patch.target/.settings/org.eclipse.core.runtime.prefs b/releng/org.eclipse.emf.diffmerge.patch.target/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.target/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/releng/org.eclipse.emf.diffmerge.patch.target/org.eclipse.emf.diffmerge.patch.target.target b/releng/org.eclipse.emf.diffmerge.patch.target/org.eclipse.emf.diffmerge.patch.target.target
new file mode 100644
index 0000000..a9f6de7
--- /dev/null
+++ b/releng/org.eclipse.emf.diffmerge.patch.target/org.eclipse.emf.diffmerge.patch.target.target
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde?>
+<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
+<target name="EMF DiffMerge Model Patch" sequenceNumber="1485178630">
+ <locations>
+ <location includeMode="planner" includeAllPlatforms="false" includeSource="false" includeConfigurePhase="false" type="InstallableUnit">
+ <unit id="org.eclipse.equinox.executable.feature.group" version="3.6.200.v20150602-1417"/>
+ <unit id="org.eclipse.platform.sdk" version="4.5.2.M20160212-1500"/>
+ <unit id="org.eclipse.jdt.feature.group" version="3.11.2.v20160212-1500"/>
+ <unit id="org.eclipse.pde.feature.group" version="3.11.2.v20160212-1500"/>
+ <unit id="org.eclipse.sdk.feature.group" version="4.5.2.v20160212-1500"/>
+ <unit id="org.eclipse.platform.feature.group" version="4.5.2.v20160212-1500"/>
+ <unit id="org.eclipse.emf.sdk.feature.gr