diff options
author | Eike Stepper | 2015-09-11 11:22:27 +0000 |
---|---|---|
committer | Eike Stepper | 2015-09-11 11:22:27 +0000 |
commit | 62f47b8f5caa343c73354b38f50a5bf1ed5f863e (patch) | |
tree | ac486c8553dab747878aa6b3f54315f41fbfabda | |
parent | fc424c0b899deb1184452177e2476af7f6fbd6c0 (diff) | |
download | cdo-62f47b8f5caa343c73354b38f50a5bf1ed5f863e.tar.gz cdo-62f47b8f5caa343c73354b38f50a5bf1ed5f863e.tar.xz cdo-62f47b8f5caa343c73354b38f50a5bf1ed5f863e.zip |
477128: Support interactive merging in CDOWorkspace.update()
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=477128
-rw-r--r-- | plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/compare/CDOCompareEditorUtil.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/compare/CDOCompareEditorUtil.java b/plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/compare/CDOCompareEditorUtil.java index 2a4873be75..f6af02feae 100644 --- a/plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/compare/CDOCompareEditorUtil.java +++ b/plugins/org.eclipse.emf.cdo.ui.compare/src/org/eclipse/emf/cdo/ui/compare/CDOCompareEditorUtil.java @@ -37,6 +37,8 @@ import org.eclipse.net4j.util.lifecycle.LifecycleUtil; import org.eclipse.net4j.util.registry.IRegistry; import org.eclipse.net4j.util.ui.UIUtil; +import org.eclipse.emf.common.CommonPlugin; +import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.util.BasicEList; import org.eclipse.emf.common.util.EList; @@ -47,6 +49,7 @@ import org.eclipse.emf.compare.Match; import org.eclipse.emf.compare.domain.ICompareEditingDomain; import org.eclipse.emf.compare.domain.impl.EMFCompareEditingDomain; import org.eclipse.emf.compare.scope.IComparisonScope; +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.edit.EMFEditPlugin; @@ -64,6 +67,7 @@ import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Shell; +import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -475,10 +479,37 @@ public class CDOCompareEditorUtil Input input = new Input(rightView, configuration, comparison, editingDomain, adapterFactory); input.setTitle(title); + + workaroundEMFCompareBug(leftView, leftLabel); + workaroundEMFCompareBug(rightView, rightLabel); + return input; } /** + * See https://git.eclipse.org/r/#/c/55404/ + */ + private static void workaroundEMFCompareBug(CDOView view, String label) + { + try + { + Class<?> c = CommonPlugin.loadClass("org.eclipse.emf.compare.ide", + "org.eclipse.emf.compare.ide.internal.utils.StoragePathAdapter"); + Constructor<?> constructor = c.getConstructor(String.class, boolean.class); + Adapter adapter = (Adapter)constructor.newInstance(label, false); + + for (Resource resource : view.getResourceSet().getResources()) + { + resource.eAdapters().add(adapter); + } + } + catch (Throwable ex) + { + //$FALL-THROUGH$ + } + } + + /** * @since 4.4 */ public static void runWithTitle(String title, Runnable runnable) |