Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Faltermeier2017-11-14 08:44:12 -0500
committerJohannes Faltermeier2017-11-14 08:56:46 -0500
commitc037d51f2745ff09f036384fb4dbfcc8f52d3b55 (patch)
treeff65a10aa3f6059655a281e22050206680e15e64
parent81ce27ce6513d446b7db300fdda12d0cf6b8061e (diff)
downloadorg.eclipse.emf.edapt-c037d51f2745ff09f036384fb4dbfcc8f52d3b55.tar.gz
org.eclipse.emf.edapt-c037d51f2745ff09f036384fb4dbfcc8f52d3b55.tar.xz
org.eclipse.emf.edapt-c037d51f2745ff09f036384fb4dbfcc8f52d3b55.zip
Bug 520365 - Eclipse hangs on startup with .ecore editor with history
file * Do not fork but ensure UI responsiveness via readAndDispatch Change-Id: I8f9a24cdfd0d50fd31abbbc1051ee6dbb3153480 Signed-off-by: Johannes Faltermeier <jfaltermeier@eclipsesource.com>
-rw-r--r--plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/recorder/ui/EcoreEditorDetector.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/recorder/ui/EcoreEditorDetector.java b/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/recorder/ui/EcoreEditorDetector.java
index 54060d8..f4addfd 100644
--- a/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/recorder/ui/EcoreEditorDetector.java
+++ b/plugins/org.eclipse.emf.edapt.history.editor/src/org/eclipse/emf/edapt/history/recorder/ui/EcoreEditorDetector.java
@@ -95,18 +95,27 @@ public class EcoreEditorDetector extends PartAdapter implements
final IRunnableWithProgress attachRunnable = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ ensureUIResponsive();
EditingDomainListener listener = getListener(editor);
-
+ ensureUIResponsive();
if (listener == null) {
listener = new EditingDomainListener(editor.getEditingDomain());
+ ensureUIResponsive();
}
if (listener.loadHistory()) {
+ ensureUIResponsive();
validateListener(editor, listener);
+ ensureUIResponsive();
+ }
+ }
+
+ private void ensureUIResponsive() {
+ while (editor.getSite().getShell().getDisplay().readAndDispatch()) {
}
}
};
try {
- new ProgressMonitorDialog(editor.getSite().getShell()).run(true, false, attachRunnable);
+ new ProgressMonitorDialog(editor.getSite().getShell()).run(false, false, attachRunnable);
} catch (final InvocationTargetException ex) {
LoggingUtils.logError(HistoryEditorPlugin.getPlugin(), ex);
} catch (final InterruptedException ex) {

Back to the top