author | wenzelm |
Thu, 10 Dec 2009 22:15:19 +0100 | |
changeset 34777 | 91d6089cef88 |
parent 34773 | bb5d68f7fd5e |
child 34791 | b97d5b38dea4 |
permissions | -rw-r--r-- |
34408 | 1 |
/* |
2 |
* Dockable window for raw process output |
|
3 |
* |
|
34772 | 4 |
* @author Makarius |
34408 | 5 |
*/ |
6 |
||
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
7 |
package isabelle.jedit |
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
8 |
|
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
9 |
|
34772 | 10 |
import scala.actors.Actor._ |
11 |
||
12 |
import java.awt.{Dimension, Graphics, BorderLayout} |
|
34424 | 13 |
import javax.swing.{JPanel, JTextArea, JScrollPane} |
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
14 |
|
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
15 |
import org.gjt.sp.jedit.View |
34424 | 16 |
import org.gjt.sp.jedit.gui.DockableWindowManager |
17 |
||
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
18 |
|
34773 | 19 |
class Protocol_Dockable(view: View, position: String) extends JPanel |
34760 | 20 |
{ |
34772 | 21 |
// outer panel |
22 |
||
34424 | 23 |
if (position == DockableWindowManager.FLOATING) |
24 |
setPreferredSize(new Dimension(500, 250)) |
|
25 |
||
34772 | 26 |
setLayout(new BorderLayout) |
27 |
||
28 |
||
29 |
// text area |
|
30 |
||
31 |
private val text_area = new JTextArea |
|
32 |
add(new JScrollPane(text_area), BorderLayout.CENTER) |
|
33 |
||
34 |
||
35 |
/* actor wiring */ |
|
34671 | 36 |
|
34772 | 37 |
private val raw_actor = actor { |
38 |
loop { |
|
39 |
react { |
|
40 |
case result: Isabelle_Process.Result => |
|
41 |
Swing_Thread.now { text_area.append(result.toString + "\n") } |
|
42 |
||
43 |
case bad => System.err.println("raw_actor: ignoring bad message " + bad) |
|
44 |
} |
|
45 |
} |
|
46 |
} |
|
47 |
||
48 |
override def addNotify() |
|
49 |
{ |
|
50 |
super.addNotify() |
|
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
34773
diff
changeset
|
51 |
Isabelle.session.raw_results += raw_actor |
34772 | 52 |
} |
53 |
||
54 |
override def removeNotify() |
|
55 |
{ |
|
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
34773
diff
changeset
|
56 |
Isabelle.session.raw_results -= raw_actor |
34772 | 57 |
super.removeNotify() |
34671 | 58 |
} |
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
59 |
} |