Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Richard2015-01-06 09:15:44 +0000
committerLaurent Goubet2015-02-09 09:01:34 +0000
commit7bef0360ceddd9f3852000d01b8dfdf2b23b45e7 (patch)
tree82c9ef1c502403705841924a9ff1c0193a950fa6
parent68535877b2e21a4c6fc4d61d53e416d94f209280 (diff)
downloadorg.eclipse.emf.compare-7bef0360ceddd9f3852000d01b8dfdf2b23b45e7.tar.gz
org.eclipse.emf.compare-7bef0360ceddd9f3852000d01b8dfdf2b23b45e7.tar.xz
org.eclipse.emf.compare-7bef0360ceddd9f3852000d01b8dfdf2b23b45e7.zip
[413038] Fix Properties View: edit a value changes selection
Only refresh the content viewers if the command is a compare command. This avoid to synchronize the selection between structure merge viewer and content merge viewers after editing value in the properties view. Bug: 413038 Change-Id: Ie21e94d3e9f48b1168937c6063e300fde7847116 Signed-off-by: Axel Richard <axel.richard@obeo.fr>
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java10
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewer.java10
2 files changed, 15 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java
index 75b0eb086..b4b76745a 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2014 Obeo.
+ * Copyright (c) 2012, 2015 Obeo.
* 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
@@ -23,9 +23,12 @@ import org.eclipse.compare.contentmergeviewer.ContentMergeViewer;
import org.eclipse.compare.internal.CompareHandlerService;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.common.command.CommandStackListener;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.command.ICompareCopyCommand;
import org.eclipse.emf.compare.domain.ICompareEditingDomain;
import org.eclipse.emf.compare.ide.ui.internal.configuration.EMFCompareConfiguration;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.DynamicObject;
@@ -369,7 +372,10 @@ public abstract class EMFCompareContentMergeViewer extends ContentMergeViewer im
setRightDirty(getCompareConfiguration().getEditingDomain().getCommandStack().isRightSaveNeeded());
}
- SWTUtil.safeRefresh(this, true, false);
+ Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand instanceof ICompareCopyCommand) {
+ SWTUtil.safeRefresh(this, true, false);
+ }
}
/**
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewer.java
index c32ef4d33..52b27f4e8 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/tree/TreeContentMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2014 Obeo.
+ * Copyright (c) 2012, 2015 Obeo.
* 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
@@ -49,7 +49,6 @@ import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
@@ -241,7 +240,7 @@ public class TreeContentMergeViewer extends EMFCompareContentMergeViewer {
}
};
mergeTreeViewer.setContentProvider(contentProvider);
- ILabelProvider labelProvider = new AdapterFactoryLabelProvider(fAdapterFactory) {
+ AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(fAdapterFactory) {
/**
* {@inheritDoc}
*
@@ -295,6 +294,11 @@ public class TreeContentMergeViewer extends EMFCompareContentMergeViewer {
return super.getImage(object);
}
};
+
+ // FIXME: a better solution will be that MergeViewerItem have ItemProviders (on the same principle
+ // than TreeNodes).
+ labelProvider.setFireLabelUpdateNotifications(true);
+
mergeTreeViewer.setLabelProvider(labelProvider);
mergeTreeViewer.getStructuredViewer().getTree().addListener(SWT.Collapse,

Back to the top