src/Tools/jEdit/src/document_dockable.scala
changeset 76719 2c8632c746fe
parent 76718 3f50b24909df
child 76720 37f7b2965e02
equal deleted inserted replaced
76718:3f50b24909df 76719:2c8632c746fe
   116         }
   116         }
   117     }
   117     }
   118 
   118 
   119 
   119 
   120   /* document build process */
   120   /* document build process */
   121 
       
   122   private def document_theories(): List[Document.Node.Name] =
       
   123     PIDE.editor.document_theories()
       
   124 
   121 
   125   private def init_state(): Unit =
   122   private def init_state(): Unit =
   126     current_state.change { _ => Document_Dockable.State(progress = log_progress()) }
   123     current_state.change { _ => Document_Dockable.State(progress = log_progress()) }
   127 
   124 
   128   private def cancel_process(): Unit =
   125   private def cancel_process(): Unit =
   161             options, session, dirs = JEdit_Sessions.session_dirs)
   158             options, session, dirs = JEdit_Sessions.session_dirs)
   162         PIDE.editor.document_setup(Some(session_background))
   159         PIDE.editor.document_setup(Some(session_background))
   163 
   160 
   164         finish_process(Nil)
   161         finish_process(Nil)
   165         GUI_Thread.later {
   162         GUI_Thread.later {
   166           theories.update(domain = Some(document_theories().toSet), trim = true)
   163           val domain = PIDE.editor.document_theories().toSet
       
   164           theories.update(domain = Some(domain), trim = true, force = true)
   167           show_state()
   165           show_state()
   168           show_page(theories_page)
   166           show_page(theories_page)
   169         }
   167         }
   170       }
   168       }
   171       catch {
   169       catch {
   288           handle_resize()
   286           handle_resize()
   289           theories.refresh()
   287           theories.refresh()
   290         }
   288         }
   291       case changed: Session.Commands_Changed =>
   289       case changed: Session.Commands_Changed =>
   292         GUI_Thread.later {
   290         GUI_Thread.later {
   293           val domain = document_theories().filter(changed.nodes).toSet
   291           val domain = PIDE.editor.document_theories().filter(changed.nodes).toSet
   294           if (domain.nonEmpty) theories.update(domain = Some(domain))
   292           if (domain.nonEmpty) theories.update(domain = Some(domain))
   295         }
   293         }
   296     }
   294     }
   297 
   295 
   298   override def init(): Unit = {
   296   override def init(): Unit = {
   299     PIDE.editor.document_init(dockable)
   297     PIDE.editor.document_init(dockable)
   300     init_state()
   298     init_state()
   301     PIDE.session.global_options += main
   299     PIDE.session.global_options += main
   302     PIDE.session.commands_changed += main
   300     PIDE.session.commands_changed += main
   303     theories.update(domain = Some(document_theories().toSet), force = true)
       
   304     handle_resize()
   301     handle_resize()
   305     delay_load.invoke()
   302     delay_load.invoke()
   306   }
   303   }
   307 
   304 
   308   override def exit(): Unit = {
   305   override def exit(): Unit = {