manipulate document within Swing thread only -- potentially slow;
authorwenzelm
Tue, 08 Dec 2009 12:10:55 +0100
changeset 34757 adf4e0f27d54
parent 34756 c4818d907ca0
child 34758 710e3a9a4c95
manipulate document within Swing thread only -- potentially slow;
src/Tools/jEdit/src/jedit/StateViewDockable.scala
--- a/src/Tools/jEdit/src/jedit/StateViewDockable.scala	Tue Dec 08 12:09:17 2009 +0100
+++ b/src/Tools/jEdit/src/jedit/StateViewDockable.scala	Tue Dec 08 12:10:55 2009 +0100
@@ -94,15 +94,15 @@
   Isabelle.plugin.state_update += (cmd => {
     val theory_view = Isabelle.prover_setup(view.getBuffer).get.theory_view
 
-    val node =
-      if (cmd == null) empty_body
-      else {
-        val xml = XML.elem(HTML.BODY,
-          cmd.results(theory_view.current_document).
-            map((t: XML.Tree) => XML.elem(HTML.PRE, HTML.spans(t))))
-        XML.document_node(doc, xml)
-      }
     Swing_Thread.later {
+      val node =
+        if (cmd == null) empty_body
+        else {
+          val xml = XML.elem(HTML.BODY,
+            cmd.results(theory_view.current_document).
+              map((t: XML.Tree) => XML.elem(HTML.PRE, HTML.spans(t))))
+          XML.document_node(doc, xml)
+        }
       doc.removeChild(doc.getLastChild())
       doc.appendChild(node)
       panel.delayedRelayout(node.asInstanceOf[NodeImpl])