src/Tools/jEdit/src/jedit/plugin.scala
changeset 34821 ba83272dc4ca
parent 34820 a8ba6cde13e9
child 34822 8c31275868cc
equal deleted inserted replaced
34820:a8ba6cde13e9 34821:ba83272dc4ca
    11 
    11 
    12 import isabelle.proofdocument.Session
    12 import isabelle.proofdocument.Session
    13 
    13 
    14 import java.io.{FileInputStream, IOException}
    14 import java.io.{FileInputStream, IOException}
    15 import java.awt.Font
    15 import java.awt.Font
    16 import javax.swing.JScrollPane
    16 import javax.swing.{JScrollPane, JOptionPane}
    17 
    17 
    18 import scala.collection.mutable
    18 import scala.collection.mutable
    19 
    19 
    20 import org.gjt.sp.jedit.{jEdit, EBMessage, EBPlugin, Buffer, EditPane, ServiceManager, View}
    20 import org.gjt.sp.jedit.{jEdit, EBMessage, EBPlugin, Buffer, EditPane, ServiceManager, View}
    21 import org.gjt.sp.jedit.buffer.JEditBuffer
    21 import org.gjt.sp.jedit.buffer.JEditBuffer
    22 import org.gjt.sp.jedit.textarea.JEditTextArea
    22 import org.gjt.sp.jedit.textarea.JEditTextArea
    23 import org.gjt.sp.jedit.msg.{EditPaneUpdate, PropertiesChanged}
    23 import org.gjt.sp.jedit.msg.{EditPaneUpdate, PropertiesChanged}
    24 import org.gjt.sp.jedit.gui.EnhancedDialog
       
    25 
    24 
    26 
    25 
    27 object Isabelle
    26 object Isabelle
    28 {
    27 {
    29   /* plugin instance */
    28   /* plugin instance */
   103   private def prover_started(view: View): Boolean =
   102   private def prover_started(view: View): Boolean =
   104   {
   103   {
   105     val timeout = Int_Property("startup-timeout") max 1000
   104     val timeout = Int_Property("startup-timeout") max 1000
   106     session.start(timeout, Isabelle.isabelle_args()) match {
   105     session.start(timeout, Isabelle.isabelle_args()) match {
   107       case Some(err) =>
   106       case Some(err) =>
   108         // FIXME proper dialog
   107         JOptionPane.showMessageDialog(
   109         val dialog = new EnhancedDialog(view, "Failed to start prover:\n" + err, true) {
   108           view, err, "Failed to start prover", JOptionPane.ERROR_MESSAGE)
   110           def ok { dispose }
       
   111           def cancel { dispose }
       
   112         }
       
   113         dialog.setVisible(true)
       
   114         false
   109         false
   115       case None => true
   110       case None => true
   116     }
   111     }
   117   }
   112   }
   118 
   113