src/Tools/jEdit/src/protocol_dockable.scala
changeset 56715 52125652e82a
parent 56391 b33df9837850
child 57612 990ffb84489b
     1.1 --- a/src/Tools/jEdit/src/protocol_dockable.scala	Fri Apr 25 12:27:18 2014 +0200
     1.2 +++ b/src/Tools/jEdit/src/protocol_dockable.scala	Fri Apr 25 12:51:08 2014 +0200
     1.3 @@ -9,7 +9,6 @@
     1.4  
     1.5  import isabelle._
     1.6  
     1.7 -import scala.actors.Actor._
     1.8  import scala.swing.{TextArea, ScrollPane}
     1.9  
    1.10  import org.gjt.sp.jedit.View
    1.11 @@ -21,22 +20,17 @@
    1.12    set_content(new ScrollPane(text_area))
    1.13  
    1.14  
    1.15 -  /* main actor */
    1.16 +  /* main */
    1.17  
    1.18 -  private val main_actor = actor {
    1.19 -    loop {
    1.20 -      react {
    1.21 -        case input: Prover.Input =>
    1.22 -          Swing_Thread.later { text_area.append(input.toString + "\n\n") }
    1.23 +  private val main =
    1.24 +    Session.Consumer[Prover.Message](getClass.getName) {
    1.25 +      case input: Prover.Input =>
    1.26 +        Swing_Thread.later { text_area.append(input.toString + "\n\n") }
    1.27  
    1.28 -        case output: Prover.Output =>
    1.29 -          Swing_Thread.later { text_area.append(output.message.toString + "\n\n") }
    1.30 -
    1.31 -        case bad => System.err.println("Protocol_Dockable: ignoring bad message " + bad)
    1.32 -      }
    1.33 +      case output: Prover.Output =>
    1.34 +        Swing_Thread.later { text_area.append(output.message.toString + "\n\n") }
    1.35      }
    1.36 -  }
    1.37  
    1.38 -  override def init() { PIDE.session.all_messages += main_actor }
    1.39 -  override def exit() { PIDE.session.all_messages -= main_actor }
    1.40 +  override def init() { PIDE.session.all_messages += main }
    1.41 +  override def exit() { PIDE.session.all_messages -= main }
    1.42  }