From 03086ec6c478e636f33299e4e374506eaf4b31b2 Mon Sep 17 00:00:00 2001 From: Reino Ruusu Date: Wed, 19 Jun 2019 11:26:47 +0300 Subject: [PATCH] Fix issue with updates of SCL module outline views. gitlab #317 Change-Id: Ia749729d4410f6deee9176d01f572768f959b88e --- .../scl/ui/outline/SCLModuleOutlinePage.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/outline/SCLModuleOutlinePage.java b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/outline/SCLModuleOutlinePage.java index 80e34c374..f19081754 100644 --- a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/outline/SCLModuleOutlinePage.java +++ b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/outline/SCLModuleOutlinePage.java @@ -30,6 +30,7 @@ import org.simantics.scl.osgi.SCLOsgi; import org.simantics.scl.ui.Activator; import org.simantics.scl.ui.editor2.SCLModuleEditor2; import org.simantics.scl.ui.editor2.SCLModuleEditorInput; +import org.simantics.utils.ui.SWTUtils; public class SCLModuleOutlinePage extends ContentOutlinePage { @@ -69,16 +70,20 @@ public class SCLModuleOutlinePage extends ContentOutlinePage { @Override public void notifyAboutUpdate() { - parent.getDisplay().asyncExec(() -> { + if (parent.isDisposed()) + return; + + Failable module = SCLOsgi.MODULE_REPOSITORY.getModule(moduleSource.getModuleName(), updateListener); + SWTUtils.asyncExec(parent, () -> { if (!outlineViewer.getControl().isDisposed()) { + outlineViewer.setInput(module.didSucceed() ? module.getResult() : null); outlineViewer.refresh(); } }); } }; - Failable module = SCLOsgi.MODULE_REPOSITORY.getModule(moduleSource.getModuleName(), updateListener); - Module result = module.getResult(); - outlineViewer.setInput(result); + + updateListener.notifyAboutUpdate(); } @Override -- 2.47.1