author | wenzelm |
Sat, 07 Jan 2017 20:44:37 +0100 | |
changeset 64826 | c97296294f6d |
parent 64817 | 0bb6b582bb4f |
child 64854 | f5aa712e6250 |
permissions | -rw-r--r-- |
50299 | 1 |
/* Title: Tools/jEdit/src/theories_dockable.scala |
39515 | 2 |
Author: Makarius |
3 |
||
50299 | 4 |
Dockable window for theories managed by prover. |
39515 | 5 |
*/ |
6 |
||
7 |
package isabelle.jedit |
|
8 |
||
9 |
||
10 |
import isabelle._ |
|
11 |
||
53711
8ce7795256e1
improved FlowLayout for wrapping of components over multiple lines;
wenzelm
parents:
53178
diff
changeset
|
12 |
import scala.swing.{Button, TextArea, Label, ListView, Alignment, |
52815
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
13 |
ScrollPane, Component, CheckBox, BorderPanel} |
53715 | 14 |
import scala.swing.event.{MouseClicked, MouseMoved} |
39593 | 15 |
|
53178 | 16 |
import java.awt.{BorderLayout, Graphics2D, Color, Point, Dimension} |
56389 | 17 |
import javax.swing.{JList, BorderFactory, UIManager} |
18 |
import javax.swing.border.{BevelBorder, SoftBevelBorder} |
|
39515 | 19 |
|
44865 | 20 |
import org.gjt.sp.jedit.{View, jEdit} |
39515 | 21 |
|
22 |
||
50299 | 23 |
class Theories_Dockable(view: View, position: String) extends Dockable(view, position) |
39515 | 24 |
{ |
48021
d899be1cfe6d
separate syslog dockable -- discontinued tendency of sub-window management via tabs;
wenzelm
parents:
48018
diff
changeset
|
25 |
/* status */ |
39591 | 26 |
|
48021
d899be1cfe6d
separate syslog dockable -- discontinued tendency of sub-window management via tabs;
wenzelm
parents:
48018
diff
changeset
|
27 |
private val status = new ListView(Nil: List[Document.Node.Name]) { |
56389 | 28 |
background = |
29 |
{ |
|
30 |
// enforce default value |
|
31 |
val c = UIManager.getDefaults.getColor("Panel.background") |
|
32 |
new Color(c.getRed, c.getGreen, c.getBlue, c.getAlpha) |
|
33 |
} |
|
44991 | 34 |
listenTo(mouse.clicks) |
52817 | 35 |
listenTo(mouse.moves) |
44991 | 36 |
reactions += { |
52816
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
37 |
case MouseClicked(_, point, _, clicks, _) => |
44991 | 38 |
val index = peer.locationToIndex(point) |
52817 | 39 |
if (index >= 0) { |
40 |
if (in_checkbox(peer.indexToLocation(index), point)) { |
|
64817 | 41 |
if (clicks == 1) Document_Model.node_required(listData(index), toggle = true) |
52816
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
42 |
} |
60893 | 43 |
else if (clicks == 2) PIDE.editor.goto_file(true, view, listData(index).node) |
52816
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
44 |
} |
52817 | 45 |
case MouseMoved(_, point, _) => |
46 |
val index = peer.locationToIndex(point) |
|
47 |
if (index >= 0 && in_checkbox(peer.indexToLocation(index), point)) |
|
48 |
tooltip = "Mark as required for continuous checking" |
|
49 |
else |
|
50 |
tooltip = null |
|
44991 | 51 |
} |
52 |
} |
|
50250 | 53 |
status.peer.setLayoutOrientation(JList.HORIZONTAL_WRAP) |
54 |
status.peer.setVisibleRowCount(0) |
|
44609 | 55 |
status.selection.intervalMode = ListView.IntervalMode.Single |
56 |
||
49038 | 57 |
set_content(new ScrollPane(status)) |
39515 | 58 |
|
59 |
||
39593 | 60 |
/* controls */ |
61 |
||
50299 | 62 |
def phase_text(phase: Session.Phase): String = |
56599 | 63 |
"Prover: " + Word.lowercase(phase.toString) |
50299 | 64 |
|
65 |
private val session_phase = new Label(phase_text(PIDE.session.phase)) |
|
39697 | 66 |
session_phase.border = new SoftBevelBorder(BevelBorder.LOWERED) |
50299 | 67 |
session_phase.tooltip = "Status of prover session" |
39635 | 68 |
|
48018
b941dd7df92a
make double sure that GUI components are up-to-date after init;
wenzelm
parents:
48014
diff
changeset
|
69 |
private def handle_phase(phase: Session.Phase) |
b941dd7df92a
make double sure that GUI components are up-to-date after init;
wenzelm
parents:
48014
diff
changeset
|
70 |
{ |
57612
990ffb84489b
clarified module name: facilitate alternative GUI frameworks;
wenzelm
parents:
56715
diff
changeset
|
71 |
GUI_Thread.require {} |
53177
dcac8d837b9c
more uniform treatment of Swing_Thread context switch: prefer asynchronous Swing_Thread.later from actor;
wenzelm
parents:
53176
diff
changeset
|
72 |
session_phase.text = " " + phase_text(phase) + " " |
48018
b941dd7df92a
make double sure that GUI components are up-to-date after init;
wenzelm
parents:
48014
diff
changeset
|
73 |
} |
b941dd7df92a
make double sure that GUI components are up-to-date after init;
wenzelm
parents:
48014
diff
changeset
|
74 |
|
53715 | 75 |
private val continuous_checking = new Isabelle.Continuous_Checking |
54652
07ee041537a5
non-focusable button, to avoid second interpretation of SPACE in C+e SPACE (isabelle.set-node-required);
wenzelm
parents:
53715
diff
changeset
|
76 |
continuous_checking.focusable = false |
44776
47e8c8daccae
added "check" button: adhoc change to full buffer perspective;
wenzelm
parents:
44775
diff
changeset
|
77 |
|
62973 | 78 |
private val logic = JEdit_Sessions.logic_selector(true) |
39702 | 79 |
|
44775
27930cf6f0f7
added "cancel" button based on cancel_execution, not interrupt (cf. 156be0e43336);
wenzelm
parents:
44734
diff
changeset
|
80 |
private val controls = |
53711
8ce7795256e1
improved FlowLayout for wrapping of components over multiple lines;
wenzelm
parents:
53178
diff
changeset
|
81 |
new Wrap_Panel(Wrap_Panel.Alignment.Right)(continuous_checking, session_phase, logic) |
39593 | 82 |
add(controls.peer, BorderLayout.NORTH) |
83 |
||
84 |
||
57612
990ffb84489b
clarified module name: facilitate alternative GUI frameworks;
wenzelm
parents:
56715
diff
changeset
|
85 |
/* component state -- owned by GUI thread */ |
44609 | 86 |
|
45709
87017fcbad83
clarified modules (again) -- NB: both Document and Protocol are specific to this particular prover;
wenzelm
parents:
45672
diff
changeset
|
87 |
private var nodes_status: Map[Document.Node.Name, Protocol.Node_Status] = Map.empty |
64817 | 88 |
private var nodes_required: Set[Document.Node.Name] = Document_Model.required_nodes() |
52815
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
89 |
|
52817 | 90 |
private def in_checkbox(loc0: Point, p: Point): Boolean = |
91 |
Node_Renderer_Component != null && |
|
92 |
(Node_Renderer_Component.checkbox_geometry match { |
|
93 |
case Some((loc, size)) => |
|
94 |
loc0.x + loc.x <= p.x && p.x < loc0.x + size.width && |
|
95 |
loc0.y + loc.y <= p.y && p.y < loc0.y + size.height |
|
96 |
case None => false |
|
97 |
}) |
|
98 |
||
52815
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
99 |
private object Node_Renderer_Component extends BorderPanel |
44866 | 100 |
{ |
56389 | 101 |
opaque = true |
53176 | 102 |
border = BorderFactory.createEmptyBorder(2, 2, 2, 2) |
44957
098dd95349e7
more elaborate Node_Renderer, which paints node_name.theory only;
wenzelm
parents:
44867
diff
changeset
|
103 |
|
098dd95349e7
more elaborate Node_Renderer, which paints node_name.theory only;
wenzelm
parents:
44867
diff
changeset
|
104 |
var node_name = Document.Node.Name.empty |
52816
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
105 |
|
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
106 |
var checkbox_geometry: Option[(Point, Dimension)] = None |
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
107 |
val checkbox = new CheckBox { |
52819 | 108 |
opaque = false |
52816
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
109 |
override def paintComponent(gfx: Graphics2D) |
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
110 |
{ |
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
111 |
super.paintComponent(gfx) |
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
112 |
if (location != null && size != null) |
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
113 |
checkbox_geometry = Some((location, size)) |
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
114 |
} |
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
115 |
} |
52815
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
116 |
|
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
117 |
val label = new Label { |
56389 | 118 |
background = view.getTextArea.getPainter.getBackground |
119 |
foreground = view.getTextArea.getPainter.getForeground |
|
120 |
border = |
|
121 |
BorderFactory.createCompoundBorder( |
|
122 |
BorderFactory.createLineBorder(foreground, 1), |
|
123 |
BorderFactory.createEmptyBorder(1, 1, 1, 1)) |
|
52815
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
124 |
opaque = false |
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
125 |
xAlignment = Alignment.Leading |
52809
e750169a5884
paint unassigned/unchanged nodes as unprocessed -- relevant for editor_continuous_checking = false;
wenzelm
parents:
52807
diff
changeset
|
126 |
|
52815
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
127 |
override def paintComponent(gfx: Graphics2D) |
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
128 |
{ |
53178 | 129 |
def paint_segment(x: Int, w: Int, color: Color) |
130 |
{ |
|
131 |
gfx.setColor(color) |
|
132 |
gfx.fillRect(x, 0, w, size.height) |
|
133 |
} |
|
50900
6d80709ab862
separate color ranges by 1px to improve discernment of overall theory status;
wenzelm
parents:
50895
diff
changeset
|
134 |
|
56389 | 135 |
paint_segment(0, size.width, background) |
52815
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
136 |
nodes_status.get(node_name) match { |
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
137 |
case Some(st) if st.total > 0 => |
53178 | 138 |
val segments = |
139 |
List( |
|
140 |
(st.unprocessed, PIDE.options.color_value("unprocessed1_color")), |
|
141 |
(st.running, PIDE.options.color_value("running_color")), |
|
142 |
(st.warned, PIDE.options.color_value("warning_color")), |
|
143 |
(st.failed, PIDE.options.color_value("error_color")) |
|
144 |
).filter(_._1 > 0) |
|
52815
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
145 |
|
56407
8e7ebc4b30f1
tuned rendering -- take 1px line border into account;
wenzelm
parents:
56389
diff
changeset
|
146 |
((size.width - 1) /: segments)({ case (last, (n, color)) => |
8e7ebc4b30f1
tuned rendering -- take 1px line border into account;
wenzelm
parents:
56389
diff
changeset
|
147 |
val w = (n * ((size.width - 2) - segments.length) / st.total) max 4 |
53178 | 148 |
paint_segment(last - w, w, color) |
149 |
last - w - 1 |
|
150 |
}) |
|
151 |
||
52815
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
152 |
case _ => |
53178 | 153 |
paint_segment(0, size.width, PIDE.options.color_value("unprocessed1_color")) |
52815
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
154 |
} |
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
155 |
super.paintComponent(gfx) |
44866 | 156 |
} |
157 |
} |
|
52815
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
158 |
|
52816
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
159 |
layout(checkbox) = BorderPanel.Position.West |
52815
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
160 |
layout(label) = BorderPanel.Position.Center |
44866 | 161 |
} |
162 |
||
44990 | 163 |
private class Node_Renderer extends ListView.Renderer[Document.Node.Name] |
44957
098dd95349e7
more elaborate Node_Renderer, which paints node_name.theory only;
wenzelm
parents:
44867
diff
changeset
|
164 |
{ |
64443 | 165 |
def componentFor(list: ListView[_], isSelected: Boolean, |
64442 | 166 |
focused: Boolean, name: Document.Node.Name, index: Int): Component = |
44957
098dd95349e7
more elaborate Node_Renderer, which paints node_name.theory only;
wenzelm
parents:
44867
diff
changeset
|
167 |
{ |
44990 | 168 |
val component = Node_Renderer_Component |
44957
098dd95349e7
more elaborate Node_Renderer, which paints node_name.theory only;
wenzelm
parents:
44867
diff
changeset
|
169 |
component.node_name = name |
52816
c608e0ade554
home-grown mouse handling to pretend that the painted checkbox is actually a Swing component;
wenzelm
parents:
52815
diff
changeset
|
170 |
component.checkbox.selected = nodes_required.contains(name) |
52815
eaad5fe7bb1b
actions and shortcuts to change node_required status, with painter that looks like CheckBox (non-clickable);
wenzelm
parents:
52809
diff
changeset
|
171 |
component.label.text = name.theory |
44990 | 172 |
component |
44957
098dd95349e7
more elaborate Node_Renderer, which paints node_name.theory only;
wenzelm
parents:
44867
diff
changeset
|
173 |
} |
098dd95349e7
more elaborate Node_Renderer, which paints node_name.theory only;
wenzelm
parents:
44867
diff
changeset
|
174 |
} |
098dd95349e7
more elaborate Node_Renderer, which paints node_name.theory only;
wenzelm
parents:
44867
diff
changeset
|
175 |
status.renderer = new Node_Renderer |
44609 | 176 |
|
45011
436ea69d5d37
more careful treatment of initial update, similar to output panel;
wenzelm
parents:
44991
diff
changeset
|
177 |
private def handle_update(restriction: Option[Set[Document.Node.Name]] = None) |
44609 | 178 |
{ |
62052
8bcbf1c93119
node_status update is back on GUI thread (reverting 3ad2b2055ffc) -- avoid potential deadlock of GUI_Thread.now during shutdown, when GUI thread is already terminated;
wenzelm
parents:
61716
diff
changeset
|
179 |
GUI_Thread.require {} |
53177
dcac8d837b9c
more uniform treatment of Swing_Thread context switch: prefer asynchronous Swing_Thread.later from actor;
wenzelm
parents:
53176
diff
changeset
|
180 |
|
62052
8bcbf1c93119
node_status update is back on GUI thread (reverting 3ad2b2055ffc) -- avoid potential deadlock of GUI_Thread.now during shutdown, when GUI thread is already terminated;
wenzelm
parents:
61716
diff
changeset
|
181 |
val snapshot = PIDE.session.snapshot() |
57619 | 182 |
val nodes = snapshot.version.nodes |
44613 | 183 |
|
53177
dcac8d837b9c
more uniform treatment of Swing_Thread context switch: prefer asynchronous Swing_Thread.later from actor;
wenzelm
parents:
53176
diff
changeset
|
184 |
val iterator = |
57615
df1b3452d71c
more explicit discrimination of empty nodes -- suppress from Theories panel;
wenzelm
parents:
57612
diff
changeset
|
185 |
restriction match { |
57619 | 186 |
case Some(names) => names.iterator.map(name => (name, nodes(name))) |
187 |
case None => nodes.iterator |
|
57615
df1b3452d71c
more explicit discrimination of empty nodes -- suppress from Theories panel;
wenzelm
parents:
57612
diff
changeset
|
188 |
} |
53177
dcac8d837b9c
more uniform treatment of Swing_Thread context switch: prefer asynchronous Swing_Thread.later from actor;
wenzelm
parents:
53176
diff
changeset
|
189 |
val nodes_status1 = |
62052
8bcbf1c93119
node_status update is back on GUI thread (reverting 3ad2b2055ffc) -- avoid potential deadlock of GUI_Thread.now during shutdown, when GUI thread is already terminated;
wenzelm
parents:
61716
diff
changeset
|
190 |
(nodes_status /: iterator)({ case (status, (name, node)) => |
57619 | 191 |
if (!name.is_theory || PIDE.resources.loaded_theories(name.theory) || node.is_empty) |
192 |
status |
|
53177
dcac8d837b9c
more uniform treatment of Swing_Thread context switch: prefer asynchronous Swing_Thread.later from actor;
wenzelm
parents:
53176
diff
changeset
|
193 |
else status + (name -> Protocol.node_status(snapshot.state, snapshot.version, node)) }) |
44672 | 194 |
|
57619 | 195 |
val nodes_status2 = |
196 |
nodes_status1 -- nodes_status1.keysIterator.filter(nodes.is_hidden(_)) |
|
197 |
||
62052
8bcbf1c93119
node_status update is back on GUI thread (reverting 3ad2b2055ffc) -- avoid potential deadlock of GUI_Thread.now during shutdown, when GUI thread is already terminated;
wenzelm
parents:
61716
diff
changeset
|
198 |
if (nodes_status != nodes_status2) { |
8bcbf1c93119
node_status update is back on GUI thread (reverting 3ad2b2055ffc) -- avoid potential deadlock of GUI_Thread.now during shutdown, when GUI thread is already terminated;
wenzelm
parents:
61716
diff
changeset
|
199 |
nodes_status = nodes_status2 |
8bcbf1c93119
node_status update is back on GUI thread (reverting 3ad2b2055ffc) -- avoid potential deadlock of GUI_Thread.now during shutdown, when GUI thread is already terminated;
wenzelm
parents:
61716
diff
changeset
|
200 |
status.listData = nodes.topological_order.filter(nodes_status.isDefinedAt(_)) |
8bcbf1c93119
node_status update is back on GUI thread (reverting 3ad2b2055ffc) -- avoid potential deadlock of GUI_Thread.now during shutdown, when GUI thread is already terminated;
wenzelm
parents:
61716
diff
changeset
|
201 |
} |
44609 | 202 |
} |
203 |
||
204 |
||
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
205 |
/* main */ |
39515 | 206 |
|
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
207 |
private val main = |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
208 |
Session.Consumer[Any](getClass.getName) { |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
209 |
case phase: Session.Phase => |
57612
990ffb84489b
clarified module name: facilitate alternative GUI frameworks;
wenzelm
parents:
56715
diff
changeset
|
210 |
GUI_Thread.later { handle_phase(phase) } |
39635 | 211 |
|
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
212 |
case _: Session.Global_Options => |
57612
990ffb84489b
clarified module name: facilitate alternative GUI frameworks;
wenzelm
parents:
56715
diff
changeset
|
213 |
GUI_Thread.later { |
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
214 |
continuous_checking.load() |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
215 |
logic.load () |
64817 | 216 |
nodes_required = Document_Model.required_nodes() |
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
217 |
status.repaint() |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
218 |
} |
49247 | 219 |
|
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
220 |
case changed: Session.Commands_Changed => |
62052
8bcbf1c93119
node_status update is back on GUI thread (reverting 3ad2b2055ffc) -- avoid potential deadlock of GUI_Thread.now during shutdown, when GUI thread is already terminated;
wenzelm
parents:
61716
diff
changeset
|
221 |
GUI_Thread.later { handle_update(Some(changed.nodes)) } |
39515 | 222 |
} |
223 |
||
48018
b941dd7df92a
make double sure that GUI components are up-to-date after init;
wenzelm
parents:
48014
diff
changeset
|
224 |
override def init() |
b941dd7df92a
make double sure that GUI components are up-to-date after init;
wenzelm
parents:
48014
diff
changeset
|
225 |
{ |
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
226 |
PIDE.session.phase_changed += main |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
227 |
PIDE.session.global_options += main |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
228 |
PIDE.session.commands_changed += main |
53177
dcac8d837b9c
more uniform treatment of Swing_Thread context switch: prefer asynchronous Swing_Thread.later from actor;
wenzelm
parents:
53176
diff
changeset
|
229 |
|
dcac8d837b9c
more uniform treatment of Swing_Thread context switch: prefer asynchronous Swing_Thread.later from actor;
wenzelm
parents:
53176
diff
changeset
|
230 |
handle_phase(PIDE.session.phase) |
dcac8d837b9c
more uniform treatment of Swing_Thread context switch: prefer asynchronous Swing_Thread.later from actor;
wenzelm
parents:
53176
diff
changeset
|
231 |
handle_update() |
39635 | 232 |
} |
233 |
||
48018
b941dd7df92a
make double sure that GUI components are up-to-date after init;
wenzelm
parents:
48014
diff
changeset
|
234 |
override def exit() |
b941dd7df92a
make double sure that GUI components are up-to-date after init;
wenzelm
parents:
48014
diff
changeset
|
235 |
{ |
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
236 |
PIDE.session.phase_changed -= main |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
237 |
PIDE.session.global_options -= main |
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56662
diff
changeset
|
238 |
PIDE.session.commands_changed -= main |
39635 | 239 |
} |
39515 | 240 |
} |