From: Reino Ruusu Date: Wed, 19 Jun 2019 08:26:47 +0000 (+0300) Subject: Fix issue with updates of SCL module outline views. X-Git-Tag: v1.43.0~136^2~135 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=03086ec6c478e636f33299e4e374506eaf4b31b2;p=simantics%2Fplatform.git Fix issue with updates of SCL module outline views. gitlab #317 Change-Id: Ia749729d4410f6deee9176d01f572768f959b88e --- 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