src/Tools/jEdit/src/protocol_dockable.scala
author wenzelm
Wed Jul 23 11:19:24 2014 +0200 (2014-07-23)
changeset 57612 990ffb84489b
parent 56715 52125652e82a
child 60074 38a64cc17403
permissions -rw-r--r--
clarified module name: facilitate alternative GUI frameworks;
     1 /*  Title:      Tools/jEdit/src/protocol_dockable.scala
     2     Author:     Makarius
     3 
     4 Dockable window for protocol messages.
     5 */
     6 
     7 package isabelle.jedit
     8 
     9 
    10 import isabelle._
    11 
    12 import scala.swing.{TextArea, ScrollPane}
    13 
    14 import org.gjt.sp.jedit.View
    15 
    16 
    17 class Protocol_Dockable(view: View, position: String) extends Dockable(view, position)
    18 {
    19   private val text_area = new TextArea
    20   set_content(new ScrollPane(text_area))
    21 
    22 
    23   /* main */
    24 
    25   private val main =
    26     Session.Consumer[Prover.Message](getClass.getName) {
    27       case input: Prover.Input =>
    28         GUI_Thread.later { text_area.append(input.toString + "\n\n") }
    29 
    30       case output: Prover.Output =>
    31         GUI_Thread.later { text_area.append(output.message.toString + "\n\n") }
    32     }
    33 
    34   override def init() { PIDE.session.all_messages += main }
    35   override def exit() { PIDE.session.all_messages -= main }
    36 }