src/Tools/jEdit/src/jedit_editor.scala
changeset 56729 1da2272a06a4
parent 56662 f373fb77e0a4
child 56770 e160ae47db94
equal deleted inserted replaced
56728:6dc97c5aaf5e 56729:1da2272a06a4
   160   /* hyperlinks */
   160   /* hyperlinks */
   161 
   161 
   162   def hyperlink_url(name: String): Hyperlink =
   162   def hyperlink_url(name: String): Hyperlink =
   163     new Hyperlink {
   163     new Hyperlink {
   164       val external = true
   164       val external = true
   165       def follow(view: View) =
   165       def follow(view: View): Unit =
   166         default_thread_pool.submit(() =>
   166         Future.fork {
   167           try { Isabelle_System.open(name) }
   167           try { Isabelle_System.open(name) }
   168           catch {
   168           catch {
   169             case exn: Throwable =>
   169             case exn: Throwable =>
   170               GUI.error_dialog(view, "System error", GUI.scrollable_text(Exn.message(exn)))
   170               GUI.error_dialog(view, "System error", GUI.scrollable_text(Exn.message(exn)))
   171           })
   171           }
       
   172         }
   172       override def toString: String = "URL " + quote(name)
   173       override def toString: String = "URL " + quote(name)
   173     }
   174     }
   174 
   175 
   175   def hyperlink_file(name: String, line: Int = 0, column: Int = 0): Hyperlink =
   176   def hyperlink_file(name: String, line: Int = 0, column: Int = 0): Hyperlink =
   176     new Hyperlink {
   177     new Hyperlink {
   177       val external = false
   178       val external = false
   178       def follow(view: View) = goto_file(view, name, line, column)
   179       def follow(view: View): Unit = goto_file(view, name, line, column)
   179       override def toString: String = "file " + quote(name)
   180       override def toString: String = "file " + quote(name)
   180     }
   181     }
   181 
   182 
   182   def hyperlink_source_file(source_name: String, line: Int, offset: Symbol.Offset)
   183   def hyperlink_source_file(source_name: String, line: Int, offset: Symbol.Offset)
   183     : Option[Hyperlink] =
   184     : Option[Hyperlink] =