src/Tools/jEdit/src/simplifier_trace_dockable.scala
changeset 56662 f373fb77e0a4
parent 56299 8201790fdeb9
child 56715 52125652e82a
equal deleted inserted replaced
56661:ef623f6f036b 56662:f373fb77e0a4
    19 import org.gjt.sp.jedit.View
    19 import org.gjt.sp.jedit.View
    20 
    20 
    21 
    21 
    22 class Simplifier_Trace_Dockable(view: View, position: String) extends Dockable(view, position)
    22 class Simplifier_Trace_Dockable(view: View, position: String) extends Dockable(view, position)
    23 {
    23 {
    24   Swing_Thread.require()
    24   Swing_Thread.require {}
    25 
    25 
    26   /* component state -- owned by Swing thread */
    26   /* component state -- owned by Swing thread */
    27 
    27 
    28   private var current_snapshot = Document.State.init.snapshot()
    28   private var current_snapshot = Document.State.init.snapshot()
    29   private var current_command = Command.empty
    29   private var current_command = Command.empty
    59     XML.Elem(Markup(Markup.TEXT_FOLD, Nil), List(Pretty.block(all)))
    59     XML.Elem(Markup(Markup.TEXT_FOLD, Nil), List(Pretty.block(all)))
    60   }
    60   }
    61 
    61 
    62   private def set_context(snapshot: Document.Snapshot, context: Simplifier_Trace.Context)
    62   private def set_context(snapshot: Document.Snapshot, context: Simplifier_Trace.Context)
    63   {
    63   {
    64     Swing_Thread.require()
    64     Swing_Thread.require {}
    65     val questions = context.questions.values
    65     val questions = context.questions.values
    66     if (do_auto_reply && !questions.isEmpty)
    66     if (do_auto_reply && !questions.isEmpty)
    67     {
    67     {
    68       questions.foreach(q => Simplifier_Trace.send_reply(PIDE.session, q.data.serial, q.default_answer))
    68       questions.foreach(q => Simplifier_Trace.send_reply(PIDE.session, q.data.serial, q.default_answer))
    69       handle_update(do_update)
    69       handle_update(do_update)
   145     }
   145     }
   146   }
   146   }
   147 
   147 
   148   override def init()
   148   override def init()
   149   {
   149   {
   150     Swing_Thread.require()
   150     Swing_Thread.require {}
   151 
   151 
   152     PIDE.session.global_options += main_actor
   152     PIDE.session.global_options += main_actor
   153     PIDE.session.commands_changed += main_actor
   153     PIDE.session.commands_changed += main_actor
   154     PIDE.session.caret_focus += main_actor
   154     PIDE.session.caret_focus += main_actor
   155     PIDE.session.trace_events += main_actor
   155     PIDE.session.trace_events += main_actor
   156     handle_update(true)
   156     handle_update(true)
   157   }
   157   }
   158 
   158 
   159   override def exit()
   159   override def exit()
   160   {
   160   {
   161     Swing_Thread.require()
   161     Swing_Thread.require {}
   162 
   162 
   163     PIDE.session.global_options -= main_actor
   163     PIDE.session.global_options -= main_actor
   164     PIDE.session.commands_changed -= main_actor
   164     PIDE.session.commands_changed -= main_actor
   165     PIDE.session.caret_focus -= main_actor
   165     PIDE.session.caret_focus -= main_actor
   166     PIDE.session.trace_events -= main_actor
   166     PIDE.session.trace_events -= main_actor