From 68fea6f3baaa196c062dfa5c9267702cef599b44 Mon Sep 17 00:00:00 2001 From: "igor%mir2.org" Date: Fri, 24 Sep 2004 16:46:50 +0000 Subject: [PATCH] Make sure that all functionality that Main.(main|mainEmbedded) use to initialize debug GUI is available for applications through public methods. --- .../javascript/tools/debugger/Main.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/Main.java b/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/Main.java index 43e3f793a21..5dd2b1a1460 100644 --- a/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/Main.java +++ b/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/Main.java @@ -163,11 +163,16 @@ public class Main { return debugGui.isVisible(); } + public void enableForAllNewContexts() + { + dim.enableForAllNewContexts(); + } + public static void main(String[] args) throws Exception { Main main = new Main("Rhino JavaScript Debugger"); - main.dim.breakFlag = true; + main.doBreak(); main.setExitAction(new Runnable() { public void run() { System.exit(0); @@ -176,16 +181,16 @@ public class Main { System.setIn(main.getIn()); System.setOut(main.getOut()); System.setErr(main.getErr()); - main.dim.enableForAllNewContexts(); + main.enableForAllNewContexts(); main.setScopeProvider(new ScopeProvider() { public Scriptable getScope() { return org.mozilla.javascript.tools.shell.Main.getScope(); } }); - main.debugGui.pack(); - main.debugGui.setSize(600, 460); - main.debugGui.setVisible(true); + main.pack(); + main.setSize(600, 460); + main.setVisible(true); org.mozilla.javascript.tools.shell.Main.exec(args); } @@ -197,23 +202,23 @@ public class Main { title = "Rhino JavaScript Debugger (embedded usage)"; } Main main = new Main(title); - main.dim.breakFlag = true; + main.doBreak(); main.setExitAction(new Runnable() { public void run() { System.exit(0); } }); - main.dim.enableForAllNewContexts(); + main.enableForAllNewContexts(); main.setScopeProvider(new ScopeProvider() { public Scriptable getScope() { return org.mozilla.javascript.tools.shell.Main.getScope(); } }); - main.debugGui.pack(); - main.debugGui.setSize(600, 460); - main.debugGui.setVisible(true); + main.pack(); + main.setSize(600, 460); + main.setVisible(true); } }