m.setVisible(true);
/** * Helper method for {@link #mainEmbedded(String)}, etc. */ private static Main mainEmbeddedImpl(ContextFactory factory, Object scopeProvider, String title) { if (title == null) { title = "Rhino JavaScript Debugger (embedded usage)"; } Main main = new Main(title); main.doBreak(); main.setExitAction(new IProxy(IProxy.EXIT_ACTION)); main.attachTo(factory); if (scopeProvider instanceof ScopeProvider) { main.setScopeProvider((ScopeProvider)scopeProvider); } else { Scriptable scope = (Scriptable)scopeProvider; if (scope instanceof Global) { Global global = (Global)scope; global.setIn(main.getIn()); global.setOut(main.getOut()); global.setErr(main.getErr()); } main.setScope(scope); } main.pack(); main.setSize(600, 460); main.setVisible(true); return main; }
static synchronized Main getDebugger() { if (debugger == null) { final Main db = new Main("Cocoon Flow Debugger"); db.pack(); Dimension size = Toolkit.getDefaultToolkit().getScreenSize(); size.width *= 0.75; size.height *= 0.75; db.setSize(size.width, size.height); db.setExitAction(new Runnable() { public void run() { db.setVisible(false); } }); db.setOptimizationLevel(OPTIMIZATION_LEVEL); db.setVisible(true); debugger = db; ContextFactory.getGlobal().addListener(debugger); } return debugger; }
public class Main extends JFrame { public static void main(String[] args) { Main main = new Main(); main.setBackground(Color.WHITE); main.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); main.setSize(640, 480); Container contentPane = main.getContentPane(); ButtonRollover buttonRollover = new ButtonRollover("/bt_normal.png", "/bt_hover.png"); JButton btn = new JButton(); buttonRollover.apply(btn); contentPane.add(btn); main.setVisible(true); } }
/** * Entry point for embedded applications. This method attaches * to the global {@link ContextFactory} with a scope of a newly * created {@link Global} object. No I/O redirection is performed * as with {@link #main(String[])}. */ public static Dim mainEmbedded(String title) { ContextFactory factory = ContextFactory.getGlobal(); Global global = new Global(); global.init(factory); return mainEmbedded(factory, global, title); }
frame.setTitle("SUPTODO Employee"); frame.setSize(800, 800); frame.getContentPane().add(topPanel); JTabbedPane jTabbedPane = new JTabbedPane(); frame.setVisible(true); frame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) {
m.setSize(600, 600); m.setVisible(true);
if (!getDebugger().isVisible()) { getDebugger().setVisible(true);
/** * Frees any resources held by the debugger. */ public void dispose() { clearAllBreakpoints(); dim.go(); debugGui.dispose(); dim = null; }
public void initialize() throws Exception { if (enableDebugger) { if (getLogger().isDebugEnabled()) { getLogger().debug("Flow debugger enabled, creating"); } getDebugger().doBreak(); } Context context = Context.enter(); context.setOptimizationLevel(OPTIMIZATION_LEVEL); context.setCompileFunctionsWithDynamicScope(true); context.setGeneratingDebug(true); // add support for Rhino objects to JXPath JXPathIntrospector.registerDynamicClass(Scriptable.class, ScriptablePropertyHandler.class); JXPathContextReferenceImpl.addNodePointerFactory(new ScriptablePointerFactory()); try { scope = new Global(context); // Access to Cocoon internal objects FOM_Cocoon.init(scope); } catch (Exception e) { Context.exit(); throw e; } }
/** * Helper method for {@link #mainEmbedded(String)}, etc. */ private static Main mainEmbeddedImpl(ContextFactory factory, Object scopeProvider, String title) { if (title == null) { title = "Rhino JavaScript Debugger (embedded usage)"; } Main main = new Main(title); main.doBreak(); main.setExitAction(new IProxy(IProxy.EXIT_ACTION)); main.attachTo(factory); if (scopeProvider instanceof ScopeProvider) { main.setScopeProvider((ScopeProvider)scopeProvider); } else { Scriptable scope = (Scriptable)scopeProvider; if (scope instanceof Global) { Global global = (Global)scope; global.setIn(main.getIn()); global.setOut(main.getOut()); global.setErr(main.getErr()); } main.setScope(scope); } main.pack(); main.setSize(600, 460); main.setVisible(true); return main; }
public class Main extends JFrame { public static void main(String[] args) { Main main = new Main(); main.setBackground(Color.WHITE); main.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); main.setSize(640, 480); Container contentPane = main.getContentPane(); ButtonRollover buttonRollover = new ButtonRollover("/bt_normal.png", "/bt_hover.png"); JButton btn = new JButton(); buttonRollover.apply(btn); contentPane.add(btn); main.setVisible(true); } }
/** * Entry point for embedded applications. This method attaches * to the global {@link ContextFactory} with a scope of a newly * created {@link Global} object. No I/O redirection is performed * as with {@link #main(String[])}. */ public static Main mainEmbedded(String title) { ContextFactory factory = ContextFactory.getGlobal(); Global global = new Global(); global.init(factory); return mainEmbedded(factory, global, title); }
/** * Frees any resources held by the debugger. */ public void dispose() { clearAllBreakpoints(); dim.go(); debugGui.dispose(); dim = null; }
/** * Helper method for {@link #mainEmbedded(String)}, etc. */ private static Dim mainEmbeddedImpl(ContextFactory factory, Object scopeProvider, String title) { if (title == null) { title = "Rhino JavaScript Debugger (embedded usage)"; } Main main = new Main(title); main.doBreak(); main.setExitAction(new IProxy(IProxy.EXIT_ACTION)); main.attachTo(factory); if (scopeProvider instanceof ScopeProvider) { main.setScopeProvider((ScopeProvider)scopeProvider); } else { Scriptable scope = (Scriptable)scopeProvider; if (scope instanceof Global) { Global global = (Global)scope; global.setIn(main.getIn()); global.setOut(main.getOut()); global.setErr(main.getErr()); } main.setScope(scope); } main.pack(); main.setSize(600, 460); main.setVisible(true); return main.dim; }
/** * Entry point for embedded applications. This method attaches * to the global {@link ContextFactory} with a scope of a newly * created {@link Global} object. No I/O redirection is performed * as with {@link #main(String[])}. */ public static Main mainEmbedded(String title) { ContextFactory factory = ContextFactory.getGlobal(); Global global = new Global(); global.init(factory); return mainEmbedded(factory, global, title); }
public void run() { db.setVisible(false); } });
/** * Frees any resources held by the debugger. */ public void dispose() { clearAllBreakpoints(); dim.go(); debugGui.dispose(); dim = null; }
/** * Main entry point. Creates a debugger attached to a Rhino * {@link org.mozilla.javascript.tools.shell.Main} shell session. */ public static void main(String[] args) { Main main = new Main("Rhino JavaScript Debugger"); main.doBreak(); main.setExitAction(new IProxy(IProxy.EXIT_ACTION)); System.setIn(main.getIn()); System.setOut(main.getOut()); System.setErr(main.getErr()); Global global = org.mozilla.javascript.tools.shell.Main.getGlobal(); global.setIn(main.getIn()); global.setOut(main.getOut()); global.setErr(main.getErr()); main.attachTo( org.mozilla.javascript.tools.shell.Main.shellContextFactory); main.setScope(global); main.pack(); main.setSize(600, 460); main.setVisible(true); org.mozilla.javascript.tools.shell.Main.exec(args); }