author | wenzelm |
Tue, 18 Sep 2012 13:18:45 +0200 | |
changeset 49414 | d7b5fb2e9ca2 |
parent 49411 | 1da54e9bda68 |
child 49418 | c451856129cd |
permissions | -rw-r--r-- |
43282
5d294220ca43
moved sources -- eliminated Netbeans artifact of jedit package directory;
wenzelm
parents:
42978
diff
changeset
|
1 |
/* Title: Tools/jEdit/src/output_dockable.scala |
36760 | 2 |
Author: Makarius |
3 |
||
4 |
Dockable window with result message output. |
|
5 |
*/ |
|
34408 | 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 |
|
34760 | 9 |
|
36015 | 10 |
import isabelle._ |
11 |
||
34768
d8d321af1478
back to low-level JPanel, required for addNotify/removeNotify;
wenzelm
parents:
34765
diff
changeset
|
12 |
import scala.actors.Actor._ |
34760 | 13 |
|
37017
cf6625012282
try CheckBox instead of ToggleButton, which is visually confusing without window focus, e.g. in a floating instance (problem of MacOS look-and-feel);
wenzelm
parents:
37014
diff
changeset
|
14 |
import scala.swing.{FlowPanel, Button, CheckBox} |
36988 | 15 |
import scala.swing.event.ButtonClicked |
16 |
||
43520
cec9b95fa35d
explicit import java.lang.System to prevent odd scope problems;
wenzelm
parents:
43419
diff
changeset
|
17 |
import java.lang.System |
37067 | 18 |
import java.awt.BorderLayout |
37014 | 19 |
import java.awt.event.{ComponentEvent, ComponentAdapter} |
34748 | 20 |
|
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
21 |
import org.gjt.sp.jedit.View |
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
22 |
|
34765 | 23 |
|
37067 | 24 |
class Output_Dockable(view: View, position: String) extends Dockable(view, position) |
34760 | 25 |
{ |
38223 | 26 |
Swing_Thread.require() |
37130
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
27 |
|
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
28 |
|
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
29 |
/* component state -- owned by Swing thread */ |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
30 |
|
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
31 |
private var zoom_factor = 100 |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
32 |
private var show_tracing = false |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
33 |
private var do_update = true |
49414 | 34 |
private var current_state = Command.empty.init_state |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
35 |
private var current_body: XML.Body = Nil |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
36 |
|
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
37 |
|
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
38 |
/* HTML panel */ |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
39 |
|
39592 | 40 |
private val html_panel = |
43661
39fdbd814c7f
quasi-static Isabelle_System -- reduced tendency towards "functorial style";
wenzelm
parents:
43520
diff
changeset
|
41 |
new HTML_Panel(Isabelle.font_family(), scala.math.round(Isabelle.font_size())) |
42978
6b41a075251f
adhoc event handler to insert 'sendback' text into the buffer, replacing the original command
krauss
parents:
39592
diff
changeset
|
42 |
{ |
47542
26d0a76fef0a
more robust Sendback handling: JVM/jEdit paranoia for case matching, treat Pretty body not just XML.Text, replace proper_range only (without trailing whitespace);
wenzelm
parents:
47027
diff
changeset
|
43 |
override val handler: PartialFunction[HTML_Panel.Event, Unit] = |
26d0a76fef0a
more robust Sendback handling: JVM/jEdit paranoia for case matching, treat Pretty body not just XML.Text, replace proper_range only (without trailing whitespace);
wenzelm
parents:
47027
diff
changeset
|
44 |
{ |
26d0a76fef0a
more robust Sendback handling: JVM/jEdit paranoia for case matching, treat Pretty body not just XML.Text, replace proper_range only (without trailing whitespace);
wenzelm
parents:
47027
diff
changeset
|
45 |
case HTML_Panel.Mouse_Click(elem, event) |
26d0a76fef0a
more robust Sendback handling: JVM/jEdit paranoia for case matching, treat Pretty body not just XML.Text, replace proper_range only (without trailing whitespace);
wenzelm
parents:
47027
diff
changeset
|
46 |
if Protocol.Sendback.unapply(elem.getUserData(Markup.Data.name)).isDefined => |
26d0a76fef0a
more robust Sendback handling: JVM/jEdit paranoia for case matching, treat Pretty body not just XML.Text, replace proper_range only (without trailing whitespace);
wenzelm
parents:
47027
diff
changeset
|
47 |
val sendback = Protocol.Sendback.unapply(elem.getUserData(Markup.Data.name)).get |
42978
6b41a075251f
adhoc event handler to insert 'sendback' text into the buffer, replacing the original command
krauss
parents:
39592
diff
changeset
|
48 |
Document_View(view.getTextArea) match { |
6b41a075251f
adhoc event handler to insert 'sendback' text into the buffer, replacing the original command
krauss
parents:
39592
diff
changeset
|
49 |
case Some(doc_view) => |
49411 | 50 |
doc_view.rich_text_area.robust_body() { |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
51 |
val cmd = current_state.command |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
52 |
val model = doc_view.model |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
53 |
val buffer = model.buffer |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
54 |
val snapshot = model.snapshot() |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
55 |
snapshot.node.command_start(cmd) match { |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
56 |
case Some(start) if !snapshot.is_outdated => |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
57 |
val text = Pretty.string_of(sendback) |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
58 |
try { |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
59 |
buffer.beginCompoundEdit() |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
60 |
buffer.remove(start, cmd.proper_range.length) |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
61 |
buffer.insert(start, text) |
47542
26d0a76fef0a
more robust Sendback handling: JVM/jEdit paranoia for case matching, treat Pretty body not just XML.Text, replace proper_range only (without trailing whitespace);
wenzelm
parents:
47027
diff
changeset
|
62 |
} |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
63 |
finally { buffer.endCompoundEdit() } |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
64 |
case _ => |
47542
26d0a76fef0a
more robust Sendback handling: JVM/jEdit paranoia for case matching, treat Pretty body not just XML.Text, replace proper_range only (without trailing whitespace);
wenzelm
parents:
47027
diff
changeset
|
65 |
} |
26d0a76fef0a
more robust Sendback handling: JVM/jEdit paranoia for case matching, treat Pretty body not just XML.Text, replace proper_range only (without trailing whitespace);
wenzelm
parents:
47027
diff
changeset
|
66 |
} |
42978
6b41a075251f
adhoc event handler to insert 'sendback' text into the buffer, replacing the original command
krauss
parents:
39592
diff
changeset
|
67 |
case None => |
6b41a075251f
adhoc event handler to insert 'sendback' text into the buffer, replacing the original command
krauss
parents:
39592
diff
changeset
|
68 |
} |
47542
26d0a76fef0a
more robust Sendback handling: JVM/jEdit paranoia for case matching, treat Pretty body not just XML.Text, replace proper_range only (without trailing whitespace);
wenzelm
parents:
47027
diff
changeset
|
69 |
} |
42978
6b41a075251f
adhoc event handler to insert 'sendback' text into the buffer, replacing the original command
krauss
parents:
39592
diff
changeset
|
70 |
} |
6b41a075251f
adhoc event handler to insert 'sendback' text into the buffer, replacing the original command
krauss
parents:
39592
diff
changeset
|
71 |
|
39518 | 72 |
set_content(html_panel) |
34768
d8d321af1478
back to low-level JPanel, required for addNotify/removeNotify;
wenzelm
parents:
34765
diff
changeset
|
73 |
|
d8d321af1478
back to low-level JPanel, required for addNotify/removeNotify;
wenzelm
parents:
34765
diff
changeset
|
74 |
|
37131 | 75 |
private def handle_resize() |
76 |
{ |
|
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
77 |
Swing_Thread.require() |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
78 |
|
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
79 |
html_panel.resize(Isabelle.font_family(), |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
80 |
scala.math.round(Isabelle.font_size() * zoom_factor / 100)) |
37131 | 81 |
} |
36988 | 82 |
|
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
83 |
private def handle_update(follow: Boolean, restriction: Option[Set[Command]]) |
37130
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
84 |
{ |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
85 |
Swing_Thread.require() |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
86 |
|
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
87 |
val new_state = |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
88 |
if (follow) { |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
89 |
Document_View(view.getTextArea) match { |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
90 |
case Some(doc_view) => |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
91 |
val snapshot = doc_view.model.snapshot() |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
92 |
snapshot.node.command_at(doc_view.text_area.getCaretPosition).map(_._1) match { |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
93 |
case Some(cmd) => snapshot.state.command_state(snapshot.version, cmd) |
49414 | 94 |
case None => Command.empty.init_state |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
95 |
} |
49414 | 96 |
case None => Command.empty.init_state |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
97 |
} |
37130
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
98 |
} |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
99 |
else current_state |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
100 |
|
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
101 |
val new_body = |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
102 |
if (!restriction.isDefined || restriction.get.contains(new_state.command)) |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
103 |
new_state.results.iterator.map(_._2).filter( |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
104 |
{ // FIXME not scalable |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
105 |
case XML.Elem(Markup(Isabelle_Markup.TRACING, _), _) => show_tracing |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
106 |
case _ => true |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
107 |
}).toList |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
108 |
else current_body |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
109 |
|
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
110 |
if (new_body != current_body) html_panel.render(new_body) |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
111 |
|
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
112 |
current_state = new_state |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
113 |
current_body = new_body |
37130
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
114 |
} |
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
115 |
|
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
116 |
|
37067 | 117 |
/* main actor */ |
34768
d8d321af1478
back to low-level JPanel, required for addNotify/removeNotify;
wenzelm
parents:
34765
diff
changeset
|
118 |
|
37067 | 119 |
private val main_actor = actor { |
34768
d8d321af1478
back to low-level JPanel, required for addNotify/removeNotify;
wenzelm
parents:
34765
diff
changeset
|
120 |
loop { |
d8d321af1478
back to low-level JPanel, required for addNotify/removeNotify;
wenzelm
parents:
34765
diff
changeset
|
121 |
react { |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
122 |
case Session.Global_Settings => |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
123 |
Swing_Thread.later { handle_resize() } |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
124 |
case changed: Session.Commands_Changed => |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
125 |
Swing_Thread.later { handle_update(do_update, Some(changed.commands)) } |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
126 |
case Session.Caret_Focus => |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
127 |
Swing_Thread.later { handle_update(do_update, None) } |
37067 | 128 |
case bad => System.err.println("Output_Dockable: ignoring bad message " + bad) |
34768
d8d321af1478
back to low-level JPanel, required for addNotify/removeNotify;
wenzelm
parents:
34765
diff
changeset
|
129 |
} |
d8d321af1478
back to low-level JPanel, required for addNotify/removeNotify;
wenzelm
parents:
34765
diff
changeset
|
130 |
} |
d8d321af1478
back to low-level JPanel, required for addNotify/removeNotify;
wenzelm
parents:
34765
diff
changeset
|
131 |
} |
34428
d69fd18f37f9
basic setup of anti-aliasing, according to jEdit property;
wenzelm
parents:
34424
diff
changeset
|
132 |
|
37067 | 133 |
override def init() |
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
34775
diff
changeset
|
134 |
{ |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
135 |
Swing_Thread.require() |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
136 |
|
37849 | 137 |
Isabelle.session.global_settings += main_actor |
37129 | 138 |
Isabelle.session.commands_changed += main_actor |
44805 | 139 |
Isabelle.session.caret_focus += main_actor |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
140 |
handle_update(true, None) |
34768
d8d321af1478
back to low-level JPanel, required for addNotify/removeNotify;
wenzelm
parents:
34765
diff
changeset
|
141 |
} |
d8d321af1478
back to low-level JPanel, required for addNotify/removeNotify;
wenzelm
parents:
34765
diff
changeset
|
142 |
|
37067 | 143 |
override def exit() |
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
34775
diff
changeset
|
144 |
{ |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
145 |
Swing_Thread.require() |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
146 |
|
37849 | 147 |
Isabelle.session.global_settings -= main_actor |
37129 | 148 |
Isabelle.session.commands_changed -= main_actor |
44805 | 149 |
Isabelle.session.caret_focus -= main_actor |
49195 | 150 |
delay_resize.revoke() |
34768
d8d321af1478
back to low-level JPanel, required for addNotify/removeNotify;
wenzelm
parents:
34765
diff
changeset
|
151 |
} |
36988 | 152 |
|
153 |
||
37014 | 154 |
/* resize */ |
155 |
||
46740
852baa599351
explicitly revoke delay, to avoid spurious timer events after deactivation of related components;
wenzelm
parents:
46571
diff
changeset
|
156 |
private val delay_resize = |
49288 | 157 |
Swing_Thread.delay_first( |
158 |
Time.seconds(Isabelle.options.real("editor_update_delay"))) { handle_resize() } |
|
46740
852baa599351
explicitly revoke delay, to avoid spurious timer events after deactivation of related components;
wenzelm
parents:
46571
diff
changeset
|
159 |
|
37014 | 160 |
addComponentListener(new ComponentAdapter { |
49195 | 161 |
override def componentResized(e: ComponentEvent) { delay_resize.invoke() } |
37014 | 162 |
}) |
163 |
||
164 |
||
37130
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
165 |
/* controls */ |
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
166 |
|
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
167 |
private val zoom = new Library.Zoom_Box(factor => { zoom_factor = factor; handle_resize() }) |
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
168 |
zoom.tooltip = "Zoom factor for basic font size" |
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
169 |
|
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
170 |
private val tracing = new CheckBox("Tracing") { |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
171 |
reactions += { |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
172 |
case ButtonClicked(_) => show_tracing = this.selected; handle_update(do_update, None) } |
37130
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
173 |
} |
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
174 |
tracing.selected = show_tracing |
37372 | 175 |
tracing.tooltip = "Indicate output of tracing messages" |
37130
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
176 |
|
37131 | 177 |
private val auto_update = new CheckBox("Auto update") { |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
178 |
reactions += { |
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
179 |
case ButtonClicked(_) => do_update = this.selected; handle_update(do_update, None) } |
37130
7f18edbbf618
more reactive message handling, notably for follow_caret mode;
wenzelm
parents:
37129
diff
changeset
|
180 |
} |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
181 |
auto_update.selected = do_update |
37372 | 182 |
auto_update.tooltip = "Indicate automatic update following cursor movement" |
36988 | 183 |
|
37131 | 184 |
private val update = new Button("Update") { |
49359
c1262d7389fb
refined output panel: more value-oriented approach to update and caret focus;
wenzelm
parents:
49288
diff
changeset
|
185 |
reactions += { case ButtonClicked(_) => handle_update(true, None) } |
37131 | 186 |
} |
37372 | 187 |
update.tooltip = "Update display according to the command at cursor position" |
37131 | 188 |
|
39592 | 189 |
private val controls = new FlowPanel(FlowPanel.Alignment.Right)(zoom, tracing, auto_update, update) |
37039 | 190 |
add(controls.peer, BorderLayout.NORTH) |
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
191 |
} |