more robust Doc.view invocation: avoid executing process on GUI thread, but show errors as dialog;
authorwenzelm
Tue, 25 Jun 2013 19:13:37 +0200
changeset 52447 9a74000426e2
parent 52446 c4a70058ff20
child 52448 082a1c8c2c89
more robust Doc.view invocation: avoid executing process on GUI thread, but show errors as dialog;
src/Tools/jEdit/src/documentation_dockable.scala
--- a/src/Tools/jEdit/src/documentation_dockable.scala	Tue Jun 25 17:14:50 2013 +0200
+++ b/src/Tools/jEdit/src/documentation_dockable.scala	Tue Jun 25 19:13:37 2013 +0200
@@ -49,7 +49,14 @@
         tree.getLastSelectedPathComponent match {
           case node: DefaultMutableTreeNode =>
             node.getUserObject match {
-              case Documentation(name, _) => Doc.view(name)
+              case Documentation(name, _) =>
+                default_thread_pool.submit(() =>
+                  try { Doc.view(name) }
+                  catch {
+                    case exn: Throwable =>
+                      GUI.error_dialog(view,
+                        "Documentation error", GUI.scrollable_text(Exn.message(exn)))
+                  })
               case _ =>
             }
           case _ =>