src/Pure/System/main.scala
author wenzelm
Fri May 04 15:58:27 2012 +0200 (2012-05-04)
changeset 47867 dd9cbe708e6b
parent 47664 3f9681ca7040
child 48192 07a32140ce0d
permissions -rw-r--r--
some attempts to make critical errors fit on screen;
wenzelm@47663
     1
/*  Title:      Pure/System/main.scala
wenzelm@47663
     2
    Author:     Makarius
wenzelm@47663
     3
wenzelm@47663
     4
Default Isabelle application wrapper.
wenzelm@47663
     5
*/
wenzelm@47663
     6
wenzelm@47663
     7
package isabelle
wenzelm@47663
     8
wenzelm@47663
     9
import scala.swing.TextArea
wenzelm@47663
    10
wenzelm@47663
    11
wenzelm@47663
    12
object Main
wenzelm@47663
    13
{
wenzelm@47663
    14
  def main(args: Array[String]) =
wenzelm@47663
    15
  {
wenzelm@47663
    16
    val (out, rc) =
wenzelm@47663
    17
      try {
wenzelm@47663
    18
        Platform.init_laf()
wenzelm@47663
    19
        Isabelle_System.init()
wenzelm@47663
    20
        Isabelle_System.isabelle_tool("jedit", args: _*)
wenzelm@47663
    21
      }
wenzelm@47663
    22
      catch { case exn: Throwable => (Exn.message(exn), 2) }
wenzelm@47663
    23
wenzelm@47867
    24
    if (rc != 0)
wenzelm@47867
    25
      Library.dialog(null, "Isabelle", "Isabelle output",
wenzelm@47867
    26
        Library.scrollable_text(out + "\nReturn code: " + rc))
wenzelm@47663
    27
wenzelm@47663
    28
    System.exit(rc)
wenzelm@47663
    29
  }
wenzelm@47663
    30
}
wenzelm@47663
    31