зеркало из https://github.com/mozilla/gecko-dev.git
exitAction is moved to DebugGui
This commit is contained in:
Родитель
cd63019db8
Коммит
7fe01ad6bc
|
@ -1918,6 +1918,7 @@ class LoadFile implements Runnable
|
|||
class DebugGui extends JFrame implements GuiCallback
|
||||
{
|
||||
Main main;
|
||||
Runnable exitAction;
|
||||
JDesktopPane desk;
|
||||
ContextWindow context;
|
||||
Menubar menubar;
|
||||
|
@ -2081,11 +2082,19 @@ class DebugGui extends JFrame implements GuiCallback
|
|||
dlg.addChoosableFileFilter(filter);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent e) {
|
||||
main.Exit();
|
||||
exit();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void exit()
|
||||
{
|
||||
if (exitAction != null) {
|
||||
SwingUtilities.invokeLater(exitAction);
|
||||
}
|
||||
main.setReturnValue(Main.EXIT);
|
||||
}
|
||||
|
||||
FileWindow getFileWindow(String url) {
|
||||
if (url == null || url.equals("<stdin>")) {
|
||||
return null;
|
||||
|
@ -2407,7 +2416,7 @@ class DebugGui extends JFrame implements GuiCallback
|
|||
} else if (cmd.equals("Break")) {
|
||||
main.doBreak();
|
||||
} else if (cmd.equals("Exit")) {
|
||||
main.Exit();
|
||||
exit();
|
||||
} else if (cmd.equals("Open")) {
|
||||
String fileName = chooseFile("Select a file to compile");
|
||||
if (fileName != null) {
|
||||
|
|
|
@ -399,7 +399,6 @@ public class Main {
|
|||
boolean breakFlag = false;
|
||||
|
||||
ScopeProvider scopeProvider;
|
||||
Runnable exitAction;
|
||||
|
||||
int frameIndex = -1;
|
||||
|
||||
|
@ -731,11 +730,6 @@ public class Main {
|
|||
}
|
||||
}
|
||||
|
||||
static void swingInvokeLater(Runnable f)
|
||||
{
|
||||
SwingUtilities.invokeLater(f);
|
||||
}
|
||||
|
||||
void contextSwitch (int frameIndex) {
|
||||
this.frameIndex = frameIndex;
|
||||
}
|
||||
|
@ -1043,15 +1037,6 @@ public class Main {
|
|||
return resultString;
|
||||
}
|
||||
|
||||
void Exit() {
|
||||
// stop handling events
|
||||
this.returnValue = EXIT;
|
||||
// call the exit handler if any
|
||||
if (exitAction != null) {
|
||||
swingInvokeLater(exitAction);
|
||||
}
|
||||
}
|
||||
|
||||
private static java.awt.EventQueue awtEventQueue = null;
|
||||
|
||||
private static void dispatchNextAwtEvent()
|
||||
|
@ -1149,7 +1134,7 @@ public class Main {
|
|||
* selects "Exit..." or closes the Debugger main window
|
||||
*/
|
||||
public void setExitAction(Runnable r) {
|
||||
exitAction = r;
|
||||
debugGui.exitAction = r;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче