| 1 | /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
| 2 | * |
| 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
| 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 6 | package org.mozilla.javascript.tools.debugger; |
| 7 | |
| 8 | /** |
| 9 | * Interface for communication between the debugger and its GUI. This |
| 10 | * should be implemented by the GUI. |
| 11 | */ |
| 12 | public interface GuiCallback { |
| 13 | |
| 14 | /** |
| 15 | * Called when the source text of some script has been changed. |
| 16 | */ |
| 17 | void updateSourceText(Dim.SourceInfo sourceInfo); |
| 18 | |
| 19 | /** |
| 20 | * Called when the interrupt loop has been entered. |
| 21 | */ |
| 22 | void enterInterrupt(Dim.StackFrame lastFrame, |
| 23 | String threadTitle, |
| 24 | String alertMessage); |
| 25 | |
| 26 | /** |
| 27 | * Returns whether the current thread is the GUI's event thread. |
| 28 | * This information is required to avoid blocking the event thread |
| 29 | * from the debugger. |
| 30 | */ |
| 31 | boolean isGuiEventThread(); |
| 32 | |
| 33 | /** |
| 34 | * Processes the next GUI event. This manual pumping of GUI events |
| 35 | * is necessary when the GUI event thread itself has been stopped. |
| 36 | */ |
| 37 | void dispatchNextGuiEvent() throws InterruptedException; |
| 38 | } |