equal
deleted
inserted
replaced
8 |
8 |
9 |
9 |
10 import isabelle._ |
10 import isabelle._ |
11 |
11 |
12 import javax.swing.JOptionPane |
12 import javax.swing.JOptionPane |
|
13 |
|
14 import java.io.{File => JFile} |
13 |
15 |
14 import scala.swing.{ListView, ScrollPane} |
16 import scala.swing.{ListView, ScrollPane} |
15 |
17 |
16 import org.gjt.sp.jedit.{jEdit, EBMessage, EBPlugin, Buffer, View, Debug, PerspectiveManager} |
18 import org.gjt.sp.jedit.{jEdit, EBMessage, EBPlugin, Buffer, View, Debug, PerspectiveManager} |
17 import org.gjt.sp.jedit.gui.AboutDialog |
19 import org.gjt.sp.jedit.gui.AboutDialog |
40 def options_changed() { if (plugin != null) plugin.options_changed() } |
42 def options_changed() { if (plugin != null) plugin.options_changed() } |
41 def deps_changed() { if (plugin != null) plugin.deps_changed() } |
43 def deps_changed() { if (plugin != null) plugin.deps_changed() } |
42 |
44 |
43 def resources(): JEdit_Resources = |
45 def resources(): JEdit_Resources = |
44 session.resources.asInstanceOf[JEdit_Resources] |
46 session.resources.asInstanceOf[JEdit_Resources] |
|
47 |
|
48 def file_watcher(): File_Watcher = |
|
49 if (plugin == null) File_Watcher.none else plugin.file_watcher |
45 |
50 |
46 lazy val editor = new JEdit_Editor |
51 lazy val editor = new JEdit_Editor |
47 |
52 |
48 |
53 |
49 /* popups */ |
54 /* popups */ |
231 } |
236 } |
232 |
237 |
233 private lazy val delay_load = |
238 private lazy val delay_load = |
234 GUI_Thread.delay_last(PIDE.options.seconds("editor_load_delay")) { delay_load_action() } |
239 GUI_Thread.delay_last(PIDE.options.seconds("editor_load_delay")) { delay_load_action() } |
235 |
240 |
|
241 private def file_watcher_action(changed: Set[JFile]): Unit = |
|
242 if (Document_Model.sync_files(changed)) PIDE.editor.invoke_generated() |
|
243 |
|
244 lazy val file_watcher: File_Watcher = |
|
245 File_Watcher(file_watcher_action _, PIDE.options.seconds("editor_load_delay")) |
|
246 |
236 |
247 |
237 /* session phase */ |
248 /* session phase */ |
238 |
249 |
239 private val session_phase = |
250 private val session_phase = |
240 Session.Consumer[Session.Phase](getClass.getName) { |
251 Session.Consumer[Session.Phase](getClass.getName) { |
417 } |
428 } |
418 |
429 |
419 PIDE.session.phase_changed -= session_phase |
430 PIDE.session.phase_changed -= session_phase |
420 PIDE.exit_models(JEdit_Lib.jedit_buffers().toList) |
431 PIDE.exit_models(JEdit_Lib.jedit_buffers().toList) |
421 PIDE.session.stop() |
432 PIDE.session.stop() |
|
433 PIDE.file_watcher.shutdown() |
422 } |
434 } |
423 } |
435 } |