src/Tools/jEdit/src/simplifier_trace_dockable.scala
changeset 60748 6d718fda8215
parent 57612 990ffb84489b
child 65195 ffab6f460a82
equal deleted inserted replaced
60747:4ced3c6ad807 60748:6d718fda8215
    20 
    20 
    21 class Simplifier_Trace_Dockable(view: View, position: String) extends Dockable(view, position)
    21 class Simplifier_Trace_Dockable(view: View, position: String) extends Dockable(view, position)
    22 {
    22 {
    23   GUI_Thread.require {}
    23   GUI_Thread.require {}
    24 
    24 
       
    25 
    25   /* component state -- owned by GUI thread */
    26   /* component state -- owned by GUI thread */
    26 
    27 
    27   private var current_snapshot = Document.State.init.snapshot()
    28   private var current_snapshot = Document.State.init.snapshot()
    28   private var current_command = Command.empty
    29   private var current_command = Command.empty
    29   private var current_results = Command.Results.empty
    30   private var current_results = Command.Results.empty
    34   private val text_area = new Pretty_Text_Area(view)
    35   private val text_area = new Pretty_Text_Area(view)
    35   set_content(text_area)
    36   set_content(text_area)
    36 
    37 
    37   private def update_contents()
    38   private def update_contents()
    38   {
    39   {
    39 
       
    40     GUI_Thread.require {}
       
    41 
       
    42     val snapshot = current_snapshot
    40     val snapshot = current_snapshot
    43     val context = Simplifier_Trace.handle_results(PIDE.session, current_id, current_results)
    41     val context = Simplifier_Trace.handle_results(PIDE.session, current_id, current_results)
    44 
    42 
    45     answers.contents.clear()
    43     answers.contents.clear()
    46     context.questions.values.toList match {
    44     context.questions.values.toList match {
   123         GUI_Thread.later { handle_update(do_update) }
   121         GUI_Thread.later { handle_update(do_update) }
   124     }
   122     }
   125 
   123 
   126   override def init()
   124   override def init()
   127   {
   125   {
   128     GUI_Thread.require {}
       
   129 
       
   130     PIDE.session.global_options += main
   126     PIDE.session.global_options += main
   131     PIDE.session.commands_changed += main
   127     PIDE.session.commands_changed += main
   132     PIDE.session.caret_focus += main
   128     PIDE.session.caret_focus += main
   133     PIDE.session.trace_events += main
   129     PIDE.session.trace_events += main
   134     handle_update(true)
   130     handle_update(true)
   135   }
   131   }
   136 
   132 
   137   override def exit()
   133   override def exit()
   138   {
   134   {
   139     GUI_Thread.require {}
       
   140 
       
   141     PIDE.session.global_options -= main
   135     PIDE.session.global_options -= main
   142     PIDE.session.commands_changed -= main
   136     PIDE.session.commands_changed -= main
   143     PIDE.session.caret_focus -= main
   137     PIDE.session.caret_focus -= main
   144     PIDE.session.trace_events -= main
   138     PIDE.session.trace_events -= main
   145     delay_resize.revoke()
   139     delay_resize.revoke()