author | wenzelm |
Sat, 15 Aug 2015 17:38:20 +0200 | |
changeset 60932 | 13ee73f57c85 |
parent 60910 | 79abcf48c377 |
child 60936 | 2751f7f31be2 |
permissions | -rw-r--r-- |
60749 | 1 |
/* Title: Tools/jEdit/src/debugger_dockable.scala |
2 |
Author: Makarius |
|
3 |
||
4 |
Dockable window for Isabelle/ML debugger. |
|
5 |
*/ |
|
6 |
||
7 |
package isabelle.jedit |
|
8 |
||
9 |
||
10 |
import isabelle._ |
|
11 |
||
60848 | 12 |
import java.awt.{BorderLayout, Dimension} |
60901 | 13 |
import java.awt.event.{ComponentEvent, ComponentAdapter, KeyEvent, FocusAdapter, FocusEvent} |
60883 | 14 |
import javax.swing.{JTree, JMenuItem} |
60850 | 15 |
import javax.swing.tree.{DefaultMutableTreeNode, DefaultTreeModel, TreeSelectionModel} |
60848 | 16 |
import javax.swing.event.{TreeSelectionEvent, TreeSelectionListener} |
60832 | 17 |
|
60883 | 18 |
import scala.swing.{Button, Label, Component, ScrollPane, SplitPane, Orientation, |
19 |
CheckBox, BorderPanel} |
|
60832 | 20 |
import scala.swing.event.ButtonClicked |
60749 | 21 |
|
60875 | 22 |
import org.gjt.sp.jedit.{jEdit, View} |
60878
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
23 |
import org.gjt.sp.jedit.menu.EnhancedMenuItem |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
24 |
import org.gjt.sp.jedit.textarea.JEditTextArea |
60749 | 25 |
|
26 |
||
60848 | 27 |
object Debugger_Dockable |
28 |
{ |
|
60878
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
29 |
/* state entries */ |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
30 |
|
60851 | 31 |
sealed case class Thread_Entry(thread_name: String, debug_states: List[Debugger.Debug_State]) |
60848 | 32 |
{ |
33 |
override def toString: String = thread_name |
|
34 |
} |
|
60851 | 35 |
|
36 |
sealed case class Stack_Entry(debug_state: Debugger.Debug_State, index: Int) |
|
37 |
{ |
|
38 |
override def toString: String = debug_state.function |
|
39 |
} |
|
60878
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
40 |
|
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
41 |
|
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
42 |
/* breakpoints */ |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
43 |
|
60880
fa958e24ff24
set breakpoint state on ML side, relying on stable situation within the PIDE editing queue;
wenzelm
parents:
60878
diff
changeset
|
44 |
def toggle_breakpoint(command: Command, breakpoint: Long) |
60878
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
45 |
{ |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
46 |
GUI_Thread.require {} |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
47 |
|
60880
fa958e24ff24
set breakpoint state on ML side, relying on stable situation within the PIDE editing queue;
wenzelm
parents:
60878
diff
changeset
|
48 |
Debugger.toggle_breakpoint(command, breakpoint) |
60878
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
49 |
jEdit.propertiesChanged() |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
50 |
} |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
51 |
|
60880
fa958e24ff24
set breakpoint state on ML side, relying on stable situation within the PIDE editing queue;
wenzelm
parents:
60878
diff
changeset
|
52 |
def get_breakpoint(text_area: JEditTextArea, offset: Text.Offset): Option[(Command, Long)] = |
60878
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
53 |
{ |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
54 |
GUI_Thread.require {} |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
55 |
|
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
56 |
PIDE.document_view(text_area) match { |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
57 |
case Some(doc_view) => |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
58 |
val rendering = doc_view.get_rendering() |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
59 |
val range = JEdit_Lib.point_range(text_area.getBuffer, offset) |
60880
fa958e24ff24
set breakpoint state on ML side, relying on stable situation within the PIDE editing queue;
wenzelm
parents:
60878
diff
changeset
|
60 |
rendering.breakpoint(range) |
60878
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
61 |
case None => None |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
62 |
} |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
63 |
} |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
64 |
|
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
65 |
|
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
66 |
/* context menu */ |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
67 |
|
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
68 |
def context_menu(text_area: JEditTextArea, offset: Text.Offset): List[JMenuItem] = |
60890 | 69 |
if (Debugger.is_active() && get_breakpoint(text_area, offset).isDefined) { |
60878
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
70 |
val context = jEdit.getActionContext() |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
71 |
val name = "isabelle.toggle-breakpoint" |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
72 |
List(new EnhancedMenuItem(context.getAction(name).getLabel, name, context)) |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
73 |
} |
1f0d2bbcf38b
added action to toggle breakpoints (on editor side);
wenzelm
parents:
60876
diff
changeset
|
74 |
else Nil |
60848 | 75 |
} |
76 |
||
60749 | 77 |
class Debugger_Dockable(view: View, position: String) extends Dockable(view, position) |
78 |
{ |
|
79 |
GUI_Thread.require {} |
|
80 |
||
81 |
||
82 |
/* component state -- owned by GUI thread */ |
|
83 |
||
84 |
private var current_snapshot = Document.Snapshot.init |
|
60848 | 85 |
private var current_threads: Map[String, List[Debugger.Debug_State]] = Map.empty |
60749 | 86 |
private var current_output: List[XML.Tree] = Nil |
87 |
||
88 |
||
60848 | 89 |
/* pretty text area */ |
90 |
||
91 |
val pretty_text_area = new Pretty_Text_Area(view) |
|
92 |
||
93 |
override def detach_operation = pretty_text_area.detach_operation |
|
94 |
||
95 |
private def handle_resize() |
|
96 |
{ |
|
97 |
GUI_Thread.require {} |
|
98 |
||
99 |
pretty_text_area.resize( |
|
100 |
Font_Info.main(PIDE.options.real("jedit_font_scale") * zoom.factor / 100)) |
|
101 |
} |
|
102 |
||
103 |
private def handle_update() |
|
104 |
{ |
|
105 |
GUI_Thread.require {} |
|
106 |
||
107 |
val new_snapshot = PIDE.editor.current_node_snapshot(view).getOrElse(current_snapshot) |
|
60898 | 108 |
val new_threads = Debugger.threads() |
60851 | 109 |
val new_output = |
110 |
{ |
|
60898 | 111 |
val output = Debugger.output() |
60859 | 112 |
val current_thread_selection = thread_selection() |
60851 | 113 |
(for { |
60898 | 114 |
(thread_name, results) <- output |
60859 | 115 |
if current_thread_selection.isEmpty || current_thread_selection.get == thread_name |
60851 | 116 |
(_, tree) <- results.iterator |
117 |
} yield tree).toList |
|
118 |
} |
|
60848 | 119 |
|
120 |
if (new_threads != current_threads) { |
|
60851 | 121 |
val thread_entries = |
60848 | 122 |
(for ((a, b) <- new_threads.iterator) |
60851 | 123 |
yield Debugger_Dockable.Thread_Entry(a, b)).toList.sortBy(_.thread_name) |
124 |
update_tree(thread_entries) |
|
60848 | 125 |
} |
126 |
||
127 |
if (new_output != current_output) |
|
128 |
pretty_text_area.update(new_snapshot, Command.Results.empty, Pretty.separate(new_output)) |
|
129 |
||
130 |
current_snapshot = new_snapshot |
|
131 |
current_threads = new_threads |
|
132 |
current_output = new_output |
|
133 |
} |
|
134 |
||
135 |
||
136 |
/* tree view */ |
|
137 |
||
138 |
private val root = new DefaultMutableTreeNode("Threads") |
|
139 |
||
140 |
val tree = new JTree(root) |
|
141 |
tree.setRowHeight(0) |
|
142 |
tree.getSelectionModel.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION) |
|
143 |
||
60854 | 144 |
def tree_selection(): Option[(Debugger_Dockable.Thread_Entry, Option[Int])] = |
60851 | 145 |
tree.getSelectionPath match { |
146 |
case null => None |
|
147 |
case path => |
|
148 |
path.getPath.toList.map(n => n.asInstanceOf[DefaultMutableTreeNode].getUserObject) match { |
|
149 |
case List(_, t: Debugger_Dockable.Thread_Entry) => |
|
60854 | 150 |
Some((t, None)) |
60851 | 151 |
case List(_, t: Debugger_Dockable.Thread_Entry, s: Debugger_Dockable.Stack_Entry) => |
60854 | 152 |
Some((t, Some(s.index))) |
60851 | 153 |
case _ => None |
154 |
} |
|
155 |
} |
|
156 |
||
60859 | 157 |
def thread_selection(): Option[String] = tree_selection().map(sel => sel._1.thread_name) |
158 |
||
60901 | 159 |
def focus_selection(): Option[Position.T] = |
60875 | 160 |
tree_selection() match { |
161 |
case Some((t, opt_index)) => |
|
162 |
val i = opt_index getOrElse 0 |
|
60901 | 163 |
if (i < t.debug_states.length) Some(t.debug_states(i).pos) else None |
60875 | 164 |
case _ => None |
165 |
} |
|
166 |
||
60851 | 167 |
private def update_tree(thread_entries: List[Debugger_Dockable.Thread_Entry]) |
60848 | 168 |
{ |
60906 | 169 |
val new_thread_selection = |
170 |
thread_selection() match { |
|
171 |
case Some(thread_name) if thread_entries.exists(t => t.thread_name == thread_name) => |
|
172 |
Some(thread_name) |
|
173 |
case _ => thread_entries.headOption.map(_.thread_name) |
|
174 |
} |
|
60860 | 175 |
|
60848 | 176 |
tree.clearSelection |
177 |
root.removeAllChildren |
|
178 |
||
60859 | 179 |
for (thread_entry <- thread_entries) { |
180 |
val thread_node = new DefaultMutableTreeNode(thread_entry) |
|
60851 | 181 |
for ((debug_state, i) <- thread_entry.debug_states.zipWithIndex) { |
60859 | 182 |
val stack_node = |
183 |
new DefaultMutableTreeNode(Debugger_Dockable.Stack_Entry(debug_state, i)) |
|
184 |
thread_node.add(stack_node) |
|
60848 | 185 |
} |
60859 | 186 |
root.add(thread_node) |
60848 | 187 |
} |
188 |
||
60859 | 189 |
tree.getModel.asInstanceOf[DefaultTreeModel].reload(root) |
60860 | 190 |
|
60905 | 191 |
tree.expandRow(0) |
192 |
for (i <- Range.inclusive(tree.getRowCount - 1, 1, -1)) tree.expandRow(i) |
|
193 |
||
60906 | 194 |
new_thread_selection match { |
195 |
case Some(thread_name) => |
|
60860 | 196 |
val i = |
197 |
(for (t <- thread_entries.iterator.takeWhile(t => t.thread_name != thread_name)) |
|
198 |
yield 1 + t.debug_states.length).sum |
|
199 |
tree.addSelectionRow(i + 1) |
|
60906 | 200 |
case None => |
60860 | 201 |
} |
202 |
||
60848 | 203 |
tree.revalidate() |
204 |
} |
|
205 |
||
60901 | 206 |
def update_vals() |
207 |
{ |
|
208 |
tree_selection() match { |
|
209 |
case Some((t, None)) => |
|
210 |
Debugger.clear_output(t.thread_name) |
|
211 |
case Some((t, Some(i))) if i < t.debug_states.length => |
|
212 |
Debugger.print_vals(t.thread_name, i, sml_button.selected, context_field.getText) |
|
213 |
case _ => |
|
214 |
} |
|
215 |
} |
|
216 |
||
60875 | 217 |
tree.addTreeSelectionListener( |
218 |
new TreeSelectionListener { |
|
60901 | 219 |
override def valueChanged(e: TreeSelectionEvent) { |
220 |
update_focus(focus_selection()) |
|
221 |
update_vals() |
|
222 |
} |
|
60875 | 223 |
}) |
60848 | 224 |
|
60883 | 225 |
private val tree_pane = new ScrollPane(Component.wrap(tree)) |
226 |
tree_pane.horizontalScrollBarPolicy = ScrollPane.BarPolicy.Always |
|
227 |
tree_pane.verticalScrollBarPolicy = ScrollPane.BarPolicy.Always |
|
228 |
tree_pane.minimumSize = new Dimension(200, 100) |
|
60848 | 229 |
|
230 |
||
231 |
/* controls */ |
|
60832 | 232 |
|
60932
13ee73f57c85
allow to break running threads at next possible breakpoint (simplified version of former option, see f3039309702e);
wenzelm
parents:
60910
diff
changeset
|
233 |
private val break_button = new CheckBox("Break") { |
13ee73f57c85
allow to break running threads at next possible breakpoint (simplified version of former option, see f3039309702e);
wenzelm
parents:
60910
diff
changeset
|
234 |
tooltip = "Break running threads at next possible breakpoint" |
13ee73f57c85
allow to break running threads at next possible breakpoint (simplified version of former option, see f3039309702e);
wenzelm
parents:
60910
diff
changeset
|
235 |
selected = Debugger.is_break() |
13ee73f57c85
allow to break running threads at next possible breakpoint (simplified version of former option, see f3039309702e);
wenzelm
parents:
60910
diff
changeset
|
236 |
reactions += { case ButtonClicked(_) => Debugger.set_break(selected) } |
13ee73f57c85
allow to break running threads at next possible breakpoint (simplified version of former option, see f3039309702e);
wenzelm
parents:
60910
diff
changeset
|
237 |
} |
13ee73f57c85
allow to break running threads at next possible breakpoint (simplified version of former option, see f3039309702e);
wenzelm
parents:
60910
diff
changeset
|
238 |
|
60907 | 239 |
private val continue_button = new Button("Continue") { |
240 |
tooltip = "Continue program on current thread, until next breakpoint" |
|
241 |
reactions += { case ButtonClicked(_) => thread_selection().map(Debugger.continue(_)) } |
|
242 |
} |
|
243 |
||
244 |
private val step_button = new Button("Step") { |
|
245 |
tooltip = "Single-step in depth-first order" |
|
246 |
reactions += { case ButtonClicked(_) => thread_selection().map(Debugger.step(_)) } |
|
247 |
} |
|
248 |
||
249 |
private val step_over_button = new Button("Step over") { |
|
250 |
tooltip = "Single-step within this function" |
|
251 |
reactions += { case ButtonClicked(_) => thread_selection().map(Debugger.step_over(_)) } |
|
252 |
} |
|
253 |
||
254 |
private val step_out_button = new Button("Step out") { |
|
255 |
tooltip = "Single-step outside this function" |
|
256 |
reactions += { case ButtonClicked(_) => thread_selection().map(Debugger.step_out(_)) } |
|
257 |
} |
|
258 |
||
60862 | 259 |
private val context_label = new Label("Context:") { |
260 |
tooltip = "Isabelle/ML context: type theory, Proof.context, Context.generic" |
|
261 |
} |
|
60832 | 262 |
private val context_field = |
263 |
new Completion_Popup.History_Text_Field("isabelle-debugger-context") |
|
264 |
{ |
|
265 |
setColumns(20) |
|
266 |
setToolTipText(context_label.tooltip) |
|
267 |
setFont(GUI.imitate_font(getFont, Font_Info.main_family(), 1.2)) |
|
268 |
} |
|
269 |
||
60862 | 270 |
private val expression_label = new Label("ML:") { |
271 |
tooltip = "Isabelle/ML or Standard ML expression" |
|
272 |
} |
|
60832 | 273 |
private val expression_field = |
274 |
new Completion_Popup.History_Text_Field("isabelle-debugger-expression") |
|
275 |
{ |
|
276 |
override def processKeyEvent(evt: KeyEvent) |
|
277 |
{ |
|
278 |
if (evt.getID == KeyEvent.KEY_PRESSED && evt.getKeyCode == KeyEvent.VK_ENTER) |
|
279 |
eval_expression() |
|
280 |
super.processKeyEvent(evt) |
|
281 |
} |
|
282 |
{ val max = getPreferredSize; max.width = Integer.MAX_VALUE; setMaximumSize(max) } |
|
283 |
setColumns(40) |
|
284 |
setToolTipText(expression_label.tooltip) |
|
285 |
setFont(GUI.imitate_font(getFont, Font_Info.main_family(), 1.2)) |
|
286 |
} |
|
287 |
||
288 |
private val eval_button = new Button("<html><b>Eval</b></html>") { |
|
60862 | 289 |
tooltip = "Evaluate ML expression within optional context" |
60832 | 290 |
reactions += { case ButtonClicked(_) => eval_expression() } |
291 |
} |
|
292 |
||
293 |
private def eval_expression() |
|
294 |
{ |
|
60861 | 295 |
context_field.addCurrentToHistory() |
296 |
expression_field.addCurrentToHistory() |
|
60856 | 297 |
tree_selection() match { |
60857 | 298 |
case Some((t, opt_index)) if t.debug_states.nonEmpty => |
299 |
Debugger.eval(t.thread_name, opt_index getOrElse 0, |
|
300 |
sml_button.selected, context_field.getText, expression_field.getText) |
|
60856 | 301 |
case _ => |
302 |
} |
|
60832 | 303 |
} |
304 |
||
60907 | 305 |
private val sml_button = new CheckBox("SML") { |
306 |
tooltip = "Official Standard ML instead of Isabelle/ML" |
|
307 |
selected = false |
|
60869 | 308 |
} |
309 |
||
60832 | 310 |
private val zoom = new Font_Info.Zoom_Box { def changed = handle_resize() } |
311 |
||
60848 | 312 |
private val controls = |
313 |
new Wrap_Panel(Wrap_Panel.Alignment.Right)( |
|
60932
13ee73f57c85
allow to break running threads at next possible breakpoint (simplified version of former option, see f3039309702e);
wenzelm
parents:
60910
diff
changeset
|
314 |
break_button, continue_button, step_button, step_over_button, step_out_button, |
60848 | 315 |
context_label, Component.wrap(context_field), |
60907 | 316 |
expression_label, Component.wrap(expression_field), eval_button, sml_button, |
60889 | 317 |
pretty_text_area.search_label, pretty_text_area.search_field, zoom) |
60848 | 318 |
add(controls.peer, BorderLayout.NORTH) |
60749 | 319 |
|
320 |
||
60875 | 321 |
/* focus */ |
322 |
||
323 |
override def focusOnDefaultComponent { eval_button.requestFocus } |
|
324 |
||
325 |
addFocusListener(new FocusAdapter { |
|
326 |
override def focusGained(e: FocusEvent) { update_focus(focus_selection()) } |
|
327 |
override def focusLost(e: FocusEvent) { update_focus(None) } |
|
328 |
}) |
|
329 |
||
330 |
private def update_focus(focus: Option[Position.T]) |
|
331 |
{ |
|
332 |
if (Debugger.focus(focus) && focus.isDefined) |
|
60893 | 333 |
PIDE.editor.hyperlink_position(false, current_snapshot, focus.get).foreach(_.follow(view)) |
60875 | 334 |
} |
335 |
||
336 |
||
60848 | 337 |
/* main panel */ |
60749 | 338 |
|
60848 | 339 |
val main_panel = new SplitPane(Orientation.Vertical) { |
340 |
oneTouchExpandable = true |
|
60883 | 341 |
leftComponent = tree_pane |
60848 | 342 |
rightComponent = Component.wrap(pretty_text_area) |
60749 | 343 |
} |
60848 | 344 |
set_content(main_panel) |
60749 | 345 |
|
346 |
||
347 |
/* main */ |
|
348 |
||
349 |
private val main = |
|
350 |
Session.Consumer[Any](getClass.getName) { |
|
351 |
case _: Session.Global_Options => |
|
60889 | 352 |
GUI_Thread.later { handle_resize() } |
60749 | 353 |
|
60900 | 354 |
case Debugger.Update => |
60932
13ee73f57c85
allow to break running threads at next possible breakpoint (simplified version of former option, see f3039309702e);
wenzelm
parents:
60910
diff
changeset
|
355 |
GUI_Thread.later { |
13ee73f57c85
allow to break running threads at next possible breakpoint (simplified version of former option, see f3039309702e);
wenzelm
parents:
60910
diff
changeset
|
356 |
break_button.selected = Debugger.is_break() |
13ee73f57c85
allow to break running threads at next possible breakpoint (simplified version of former option, see f3039309702e);
wenzelm
parents:
60910
diff
changeset
|
357 |
handle_update() |
13ee73f57c85
allow to break running threads at next possible breakpoint (simplified version of former option, see f3039309702e);
wenzelm
parents:
60910
diff
changeset
|
358 |
} |
60749 | 359 |
} |
360 |
||
361 |
override def init() |
|
362 |
{ |
|
363 |
PIDE.session.global_options += main |
|
60835 | 364 |
PIDE.session.debugger_updates += main |
60910 | 365 |
Debugger.init() |
60749 | 366 |
handle_update() |
60876 | 367 |
jEdit.propertiesChanged() |
60749 | 368 |
} |
369 |
||
370 |
override def exit() |
|
371 |
{ |
|
372 |
PIDE.session.global_options -= main |
|
60835 | 373 |
PIDE.session.debugger_updates -= main |
60749 | 374 |
delay_resize.revoke() |
60875 | 375 |
update_focus(None) |
60910 | 376 |
Debugger.exit() |
60876 | 377 |
jEdit.propertiesChanged() |
60749 | 378 |
} |
379 |
||
380 |
||
381 |
/* resize */ |
|
382 |
||
383 |
private val delay_resize = |
|
384 |
GUI_Thread.delay_first(PIDE.options.seconds("editor_update_delay")) { handle_resize() } |
|
385 |
||
386 |
addComponentListener(new ComponentAdapter { |
|
387 |
override def componentResized(e: ComponentEvent) { delay_resize.invoke() } |
|
60750 | 388 |
override def componentShown(e: ComponentEvent) { delay_resize.invoke() } |
60749 | 389 |
}) |
390 |
} |