explicit jEdit actions -- to enable key mappings, for example;
authorwenzelm
Sat, 10 Sep 2011 14:48:06 +0200
changeset 44864 e50557cb0eb6
parent 44863 49ea566cb3b4
child 44865 679f0d57e831
explicit jEdit actions -- to enable key mappings, for example;
src/Tools/jEdit/src/actions.xml
src/Tools/jEdit/src/plugin.scala
src/Tools/jEdit/src/session_dockable.scala
--- a/src/Tools/jEdit/src/actions.xml	Sat Sep 10 14:28:07 2011 +0200
+++ b/src/Tools/jEdit/src/actions.xml	Sat Sep 10 14:48:06 2011 +0200
@@ -57,5 +57,14 @@
 	    isabelle.jedit.Isabelle.input_bold(textArea);
 	  </CODE>
 	</ACTION>
-
+	<ACTION NAME="isabelle.check-buffer">
+	  <CODE>
+	    isabelle.jedit.Isabelle.check_buffer(buffer);
+	  </CODE>
+	</ACTION>
+	<ACTION NAME="isabelle.cancel-execution">
+	  <CODE>
+	    isabelle.jedit.Isabelle.cancel_execution();
+	  </CODE>
+	</ACTION>
 </ACTIONS>
\ No newline at end of file
--- a/src/Tools/jEdit/src/plugin.scala	Sat Sep 10 14:28:07 2011 +0200
+++ b/src/Tools/jEdit/src/plugin.scala	Sat Sep 10 14:48:06 2011 +0200
@@ -343,6 +343,16 @@
   def input_bsub(text_area: JEditTextArea): Unit = user_input(text_area, Symbol.bsub_decoded, Symbol.esub_decoded)
   def input_bsup(text_area: JEditTextArea): Unit = user_input(text_area, Symbol.bsup_decoded, Symbol.esup_decoded)
   def input_bold(text_area: JEditTextArea): Unit = user_input(text_area, Symbol.bold_decoded)
+
+  def check_buffer(buffer: Buffer)
+  {
+    document_model(buffer) match {
+      case None =>
+      case Some(model) => model.full_perspective()
+    }
+  }
+
+  def cancel_execution() { session.cancel_execution() }
 }
 
 
--- a/src/Tools/jEdit/src/session_dockable.scala	Sat Sep 10 14:28:07 2011 +0200
+++ b/src/Tools/jEdit/src/session_dockable.scala	Sat Sep 10 14:48:06 2011 +0200
@@ -62,19 +62,12 @@
   session_phase.tooltip = "Prover status"
 
   private val cancel = new Button("Cancel") {
-    reactions += { case ButtonClicked(_) => Isabelle.session.cancel_execution }
+    reactions += { case ButtonClicked(_) => Isabelle.cancel_execution() }
   }
   cancel.tooltip = "Cancel current proof checking process"
 
   private val check = new Button("Check") {
-    reactions +=
-    {
-      case ButtonClicked(_) =>
-        Isabelle.document_model(view.getBuffer) match {
-          case None =>
-          case Some(model) => model.full_perspective()
-        }
-    }
+    reactions += { case ButtonClicked(_) => Isabelle.check_buffer(view.getBuffer) }
   }
   check.tooltip = "Commence full proof checking of current buffer"