access statically typed dockable windows;
authorwenzelm
Sat, 22 May 2010 22:30:37 +0200
changeset 37068 07936a4efe93
parent 37067 31093f3687b5
child 37069 7d796b72099f
access statically typed dockable windows;
src/Tools/jEdit/src/jedit/plugin.scala
--- a/src/Tools/jEdit/src/jedit/plugin.scala	Sat May 22 22:05:41 2010 +0200
+++ b/src/Tools/jEdit/src/jedit/plugin.scala	Sat May 22 22:30:37 2010 +0200
@@ -21,6 +21,7 @@
 import org.gjt.sp.jedit.buffer.JEditBuffer
 import org.gjt.sp.jedit.textarea.JEditTextArea
 import org.gjt.sp.jedit.msg.{EditPaneUpdate, PropertiesChanged}
+import org.gjt.sp.jedit.gui.DockableWindowManager
 
 
 object Isabelle
@@ -112,6 +113,29 @@
     jedit_text_areas().filter(_.getBuffer == buffer)
 
 
+  /* dockable windows */
+
+  private def wm(view: View): DockableWindowManager = view.getDockableWindowManager
+
+  def docked_output(view: View): Option[Output_Dockable] =
+    wm(view).getDockableWindow("isabelle-output") match {
+      case dockable: Output_Dockable => Some(dockable)
+      case _ => None
+    }
+
+  def docked_raw_output(view: View): Option[Raw_Output_Dockable] =
+    wm(view).getDockableWindow("isabelle-raw-output") match {
+      case dockable: Raw_Output_Dockable => Some(dockable)
+      case _ => None
+    }
+
+  def docked_protocol(view: View): Option[Protocol_Dockable] =
+    wm(view).getDockableWindow("isabelle-protocol") match {
+      case dockable: Protocol_Dockable => Some(dockable)
+      case _ => None
+    }
+
+
   /* manage prover */
 
   private def prover_started(view: View): Boolean =