equal
deleted
inserted
replaced
|
1 /* Title: Tools/jEdit/src/jedit/raw_output_dockable.scala |
|
2 Author: Makarius |
|
3 |
|
4 Dockable window for raw process output (stdout). |
|
5 */ |
|
6 |
|
7 package isabelle.jedit |
|
8 |
|
9 |
|
10 import isabelle._ |
|
11 |
|
12 import scala.actors.Actor._ |
|
13 |
|
14 import java.awt.{Dimension, Graphics, BorderLayout} |
|
15 import javax.swing.{JPanel, JTextArea, JScrollPane} |
|
16 |
|
17 import org.gjt.sp.jedit.View |
|
18 import org.gjt.sp.jedit.gui.DockableWindowManager |
|
19 |
|
20 |
|
21 class Raw_Output_Dockable(view: View, position: String) extends JPanel(new BorderLayout) |
|
22 { |
|
23 if (position == DockableWindowManager.FLOATING) |
|
24 setPreferredSize(new Dimension(500, 250)) |
|
25 |
|
26 private val text_area = new JTextArea |
|
27 add(new JScrollPane(text_area), BorderLayout.CENTER) |
|
28 |
|
29 |
|
30 /* actor wiring */ |
|
31 |
|
32 private val raw_output_actor = actor { |
|
33 loop { |
|
34 react { |
|
35 case result: Isabelle_Process.Result => |
|
36 Swing_Thread.now { text_area.append(XML.content(result.message).mkString) } |
|
37 |
|
38 case bad => System.err.println("raw_output_actor: ignoring bad message " + bad) |
|
39 } |
|
40 } |
|
41 } |
|
42 |
|
43 override def addNotify() |
|
44 { |
|
45 super.addNotify() |
|
46 Isabelle.session.raw_output += raw_output_actor |
|
47 } |
|
48 |
|
49 override def removeNotify() |
|
50 { |
|
51 Isabelle.session.raw_output -= raw_output_actor |
|
52 super.removeNotify() |
|
53 } |
|
54 } |