src/Pure/System/main.scala
changeset 47663 20e0865ae9e7
child 47664 3f9681ca7040
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/Pure/System/main.scala	Sun Apr 22 15:50:29 2012 +0200
     1.3 @@ -0,0 +1,33 @@
     1.4 +/*  Title:      Pure/System/main.scala
     1.5 +    Author:     Makarius
     1.6 +
     1.7 +Default Isabelle application wrapper.
     1.8 +*/
     1.9 +
    1.10 +package isabelle
    1.11 +
    1.12 +import scala.swing.TextArea
    1.13 +
    1.14 +
    1.15 +object Main
    1.16 +{
    1.17 +  def main(args: Array[String]) =
    1.18 +  {
    1.19 +    val (out, rc) =
    1.20 +      try {
    1.21 +        Platform.init_laf()
    1.22 +        Isabelle_System.init()
    1.23 +        Isabelle_System.isabelle_tool("jedit", args: _*)
    1.24 +      }
    1.25 +      catch { case exn: Throwable => (Exn.message(exn), 2) }
    1.26 +
    1.27 +    if (rc != 0) {
    1.28 +      val text = new TextArea(out)
    1.29 +      text.editable = false
    1.30 +      Library.dialog(null, "Isabelle", "Isabelle output", text)
    1.31 +    }
    1.32 +
    1.33 +    System.exit(rc)
    1.34 +  }
    1.35 +}
    1.36 +