basic setup for prover session panel;
authorwenzelm
Sat Sep 18 14:28:42 2010 +0200 (2010-09-18)
changeset 3951557ceabb0bb8e
parent 39514 d9cf3f833318
child 39516 8a70e91650a6
basic setup for prover session panel;
src/Tools/jEdit/dist-template/properties/jedit.props
src/Tools/jEdit/plugin/Isabelle.props
src/Tools/jEdit/plugin/actions.xml
src/Tools/jEdit/plugin/dockables.xml
src/Tools/jEdit/src/jedit/plugin.scala
src/Tools/jEdit/src/jedit/session_dockable.scala
     1.1 --- a/src/Tools/jEdit/dist-template/properties/jedit.props	Fri Sep 17 22:42:07 2010 +0200
     1.2 +++ b/src/Tools/jEdit/dist-template/properties/jedit.props	Sat Sep 18 14:28:42 2010 +0200
     1.3 @@ -183,6 +183,7 @@
     1.4  insert-newline.shortcut=ENTER
     1.5  isabelle-output.dock-position=bottom
     1.6  isabelle-raw-output.dock-position=bottom
     1.7 +isabelle-session.dock-position=bottom
     1.8  isabelle.activate.shortcut=CS+ENTER
     1.9  line-end.shortcut=END
    1.10  line-home.shortcut=HOME
     2.1 --- a/src/Tools/jEdit/plugin/Isabelle.props	Fri Sep 17 22:42:07 2010 +0200
     2.2 +++ b/src/Tools/jEdit/plugin/Isabelle.props	Sat Sep 18 14:28:42 2010 +0200
     2.3 @@ -1,6 +1,6 @@
     2.4  ## Isabelle plugin properties
     2.5  ##
     2.6 -##:encoding=ISO-8859-1:
     2.7 +##:encoding=ISO-8859-1:wrap=soft:maxLineLen=100:
     2.8  
     2.9  #identification
    2.10  plugin.isabelle.jedit.Plugin.name=Isabelle
    2.11 @@ -35,13 +35,15 @@
    2.12  
    2.13  #menu actions
    2.14  plugin.isabelle.jedit.Plugin.menu.label=Isabelle
    2.15 -plugin.isabelle.jedit.Plugin.menu=isabelle.activate isabelle.show-output isabelle.show-raw-output isabelle.show-protocol
    2.16 +plugin.isabelle.jedit.Plugin.menu=isabelle.activate isabelle.session-panel isabelle.show-output isabelle.show-raw-output isabelle.show-protocol
    2.17  isabelle.activate.label=Activate current buffer
    2.18 +isabelle.session-panel.label=Prover session panel
    2.19  isabelle.show-output.label=Show Output
    2.20  isabelle.show-raw-output.label=Show Raw Output
    2.21  isabelle.show-protocol.label=Show Protocol
    2.22  
    2.23  #dockables
    2.24 +isabelle-session.title=Session
    2.25  isabelle-output.title=Output
    2.26  isabelle-raw-output.title=Raw Output
    2.27  isabelle-protocol.title=Protocol
     3.1 --- a/src/Tools/jEdit/plugin/actions.xml	Fri Sep 17 22:42:07 2010 +0200
     3.2 +++ b/src/Tools/jEdit/plugin/actions.xml	Sat Sep 18 14:28:42 2010 +0200
     3.3 @@ -10,6 +10,11 @@
     3.4  			return isabelle.jedit.Isabelle.is_active(view);
     3.5  		</IS_SELECTED>
     3.6  	</ACTION>
     3.7 +	<ACTION NAME="isabelle.session-panel">
     3.8 +		<CODE>
     3.9 +			wm.addDockableWindow("isabelle-session");
    3.10 +		</CODE>
    3.11 +	</ACTION>
    3.12  	<ACTION NAME="isabelle.show-output">
    3.13  		<CODE>
    3.14  			wm.addDockableWindow("isabelle-output");
     4.1 --- a/src/Tools/jEdit/plugin/dockables.xml	Fri Sep 17 22:42:07 2010 +0200
     4.2 +++ b/src/Tools/jEdit/plugin/dockables.xml	Sat Sep 18 14:28:42 2010 +0200
     4.3 @@ -2,6 +2,9 @@
     4.4  <!DOCTYPE DOCKABLES SYSTEM "dockables.dtd">
     4.5  
     4.6  <DOCKABLES>
     4.7 +	<DOCKABLE NAME="isabelle-session" MOVABLE="TRUE">
     4.8 +		new isabelle.jedit.Session_Dockable(view, position);
     4.9 +	</DOCKABLE>
    4.10  	<DOCKABLE NAME="isabelle-output" MOVABLE="TRUE">
    4.11  		new isabelle.jedit.Output_Dockable(view, position);
    4.12  	</DOCKABLE>
     5.1 --- a/src/Tools/jEdit/src/jedit/plugin.scala	Fri Sep 17 22:42:07 2010 +0200
     5.2 +++ b/src/Tools/jEdit/src/jedit/plugin.scala	Sat Sep 18 14:28:42 2010 +0200
     5.3 @@ -170,6 +170,12 @@
     5.4  
     5.5    private def wm(view: View): DockableWindowManager = view.getDockableWindowManager
     5.6  
     5.7 +  def docked_session(view: View): Option[Session_Dockable] =
     5.8 +    wm(view).getDockableWindow("isabelle-session") match {
     5.9 +      case dockable: Session_Dockable => Some(dockable)
    5.10 +      case _ => None
    5.11 +    }
    5.12 +
    5.13    def docked_output(view: View): Option[Output_Dockable] =
    5.14      wm(view).getDockableWindow("isabelle-output") match {
    5.15        case dockable: Output_Dockable => Some(dockable)
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/src/Tools/jEdit/src/jedit/session_dockable.scala	Sat Sep 18 14:28:42 2010 +0200
     6.3 @@ -0,0 +1,36 @@
     6.4 +/*  Title:      Tools/jEdit/src/jedit/session_dockable.scala
     6.5 +    Author:     Makarius
     6.6 +
     6.7 +Dockable window for prover session management.
     6.8 +*/
     6.9 +
    6.10 +package isabelle.jedit
    6.11 +
    6.12 +
    6.13 +import isabelle._
    6.14 +
    6.15 +import scala.actors.Actor._
    6.16 +import scala.swing.{TextArea, ScrollPane}
    6.17 +
    6.18 +import org.gjt.sp.jedit.View
    6.19 +
    6.20 +
    6.21 +class Session_Dockable(view: View, position: String) extends Dockable(view: View, position: String)
    6.22 +{
    6.23 +  private val text_area = new TextArea("Isabelle session")
    6.24 +  set_content(new ScrollPane(text_area))
    6.25 +
    6.26 +
    6.27 +  /* main actor */
    6.28 +
    6.29 +  private val main_actor = actor {
    6.30 +    loop {
    6.31 +      react {
    6.32 +        case bad => System.err.println("Session_Dockable: ignoring bad message " + bad)
    6.33 +      }
    6.34 +    }
    6.35 +  }
    6.36 +
    6.37 +  override def init() { }
    6.38 +  override def exit() { }
    6.39 +}