Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Langer2017-09-15 12:29:41 +0000
committerLaurent Goubet2018-04-30 12:28:43 +0000
commite5eb0a15d381185ba271cef529cfb1e13d96f4f9 (patch)
tree5012d38d8baa112584277cb30ba7df1eae5e542e
parentf66cbbfb467d2364bb5c3d03f3007a762c61f180 (diff)
downloadorg.eclipse.emf.compare-e5eb0a15d381185ba271cef529cfb1e13d96f4f9.tar.gz
org.eclipse.emf.compare-e5eb0a15d381185ba271cef529cfb1e13d96f4f9.tar.xz
org.eclipse.emf.compare-e5eb0a15d381185ba271cef529cfb1e13d96f4f9.zip
Avoid expensive notifications processing after compare editor is closed
The notifications come because the Comparison's adapter list is cleared. That notifies all the adapters, and those result in viewer refreshes. But at this point the viewer input is null and a viewer with null input shows nothing and hence needs no refreshes. Change-Id: I92329bd591a93718d9686c2e2921fbfbc0d755d1 Signed-off-by: Philip Langer <planger@eclipsesource.com>
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java
index e8947e8a2..2b797be53 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2016 Obeo and others.
+ * Copyright (c) 2012, 2017 Obeo and others.
* 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
@@ -508,7 +508,8 @@ public class EMFCompareStructureMergeViewerContentProvider extends AdapterFactor
*/
@Override
public void notifyChanged(Notification notification) {
- if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
+ if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()
+ && viewer.getInput() != null) {
if (notification instanceof IViewerNotification) {
if (viewerRefresh == null) {
viewerRefresh = new ViewerRefresh(viewer) {

Back to the top