author | wenzelm |
Fri, 25 Apr 2014 12:51:08 +0200 | |
changeset 56715 | 52125652e82a |
parent 56385 | 76acce58aeab |
child 57612 | 990ffb84489b |
permissions | -rw-r--r-- |
43282
5d294220ca43
moved sources -- eliminated Netbeans artifact of jedit package directory;
wenzelm
parents:
39588
diff
changeset
|
1 |
/* Title: Tools/jEdit/src/raw_output_dockable.scala |
37065
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
3 |
|
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
4 |
Dockable window for raw process output (stdout). |
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
5 |
*/ |
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
6 |
|
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
7 |
package isabelle.jedit |
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
8 |
|
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
9 |
|
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
10 |
import isabelle._ |
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
11 |
|
37067 | 12 |
import scala.swing.{TextArea, ScrollPane} |
37065
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
13 |
|
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
14 |
import org.gjt.sp.jedit.View |
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
15 |
|
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
16 |
|
49559 | 17 |
class Raw_Output_Dockable(view: View, position: String) extends Dockable(view, position) |
37065
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
18 |
{ |
37067 | 19 |
private val text_area = new TextArea |
20 |
set_content(new ScrollPane(text_area)) |
|
37065
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
21 |
|
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
22 |
|
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56385
diff
changeset
|
23 |
/* main */ |
37065
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
24 |
|
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56385
diff
changeset
|
25 |
private val main = |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56385
diff
changeset
|
26 |
Session.Consumer[Prover.Output](getClass.getName) { |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56385
diff
changeset
|
27 |
case output: Prover.Output => |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56385
diff
changeset
|
28 |
Swing_Thread.later { |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56385
diff
changeset
|
29 |
text_area.append(XML.content(output.message)) |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56385
diff
changeset
|
30 |
if (!output.is_stdout && !output.is_stderr) text_area.append("\n") |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56385
diff
changeset
|
31 |
} |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56385
diff
changeset
|
32 |
} |
37065
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
33 |
|
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56385
diff
changeset
|
34 |
override def init() { PIDE.session.raw_output_messages += main } |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56385
diff
changeset
|
35 |
override def exit() { PIDE.session.raw_output_messages -= main } |
37065
2a73253b5898
separate event bus and dockable for raw output (stdout);
wenzelm
parents:
diff
changeset
|
36 |
} |