java.lang.Object
org.mozilla.javascript.tools.debugger.Main

public class Main extends Object
Rhino script debugger main class. This class links together a debugger object (Dim) and a debugger GUI object (SwingGui).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Main(String title)
    Creates a new Main.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    attachTo(org.mozilla.javascript.ContextFactory factory)
    Attaches the debugger to the given ContextFactory.
    void
    Removes all breakpoints.
    void
    contextCreated(org.mozilla.javascript.Context cx)
    Deprecated.
    The method is only present for compatibility and should not be called.
    void
    contextEntered(org.mozilla.javascript.Context cx)
    Deprecated.
    The method is only present for compatibility and should not be called.
    void
    contextExited(org.mozilla.javascript.Context cx)
    Deprecated.
    The method is only present for compatibility and should not be called.
    void
    contextReleased(org.mozilla.javascript.Context cx)
    Deprecated.
    The method is only present for compatibility and should not be called.
    void
    Detaches from the current ContextFactory.
    void
    Frees any resources held by the debugger.
    void
    Breaks execution of the script.
    Returns the debugger window JFrame.
    Returns a PrintStream for stderr in the Debugger's internal Console window.
    Returns an InputStream for stdin from the debugger's internal Console window.
    Returns a PrintStream for stdout to the debugger's internal Console window.
    void
    go()
    Resumes execution of the script.
    boolean
    Returns whether the debugger GUI frame is visible.
    static void
    main(String[] args)
    Main entry point.
    static Main
    Entry point for embedded applications.
    static Main
    mainEmbedded(org.mozilla.javascript.ContextFactory factory, org.mozilla.javascript.Scriptable scope, String title)
    Entry point for embedded applications.
    static Main
    mainEmbedded(org.mozilla.javascript.ContextFactory factory, ScopeProvider scopeProvider, String title)
    Entry point for embedded applications.
    void
    Packs the debugger GUI frame.
    void
    setBreakOnEnter(boolean value)
    Sets whether execution should break when a function is entered.
    void
    setBreakOnExceptions(boolean value)
    Sets whether execution should break when a script exception is thrown.
    void
    setBreakOnReturn(boolean value)
    Sets whether execution should break when a function is left.
    void
    Assign a Runnable object that will be invoked when the user selects "Exit..." or closes the Debugger main window.
    void
    Deprecated.
    The method does nothing and is only present for compatibility.
    void
    setScope(org.mozilla.javascript.Scriptable scope)
    Sets the scope to be used for script evaluation.
    void
    Sets the ScopeProvider that provides a scope to be used for script evaluation.
    void
    setSize(int w, int h)
    Sets the debugger GUI frame dimensions.
    void
    setSize(Dimension dimension)
    Deprecated.
    Use setSize(int, int) instead.
    void
    Sets the SourceProvider that provides the source to be displayed for script evaluation.
    void
    setVisible(boolean flag)
    Sets the visibility of the debugger GUI frame.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Main

      public Main(String title)
      Creates a new Main.
  • Method Details

    • getDebugFrame

      public JFrame getDebugFrame()
      Returns the debugger window JFrame.
    • doBreak

      public void doBreak()
      Breaks execution of the script.
    • setBreakOnExceptions

      public void setBreakOnExceptions(boolean value)
      Sets whether execution should break when a script exception is thrown.
    • setBreakOnEnter

      public void setBreakOnEnter(boolean value)
      Sets whether execution should break when a function is entered.
    • setBreakOnReturn

      public void setBreakOnReturn(boolean value)
      Sets whether execution should break when a function is left.
    • clearAllBreakpoints

      public void clearAllBreakpoints()
      Removes all breakpoints.
    • go

      public void go()
      Resumes execution of the script.
    • setScope

      public void setScope(org.mozilla.javascript.Scriptable scope)
      Sets the scope to be used for script evaluation.
    • setScopeProvider

      public void setScopeProvider(ScopeProvider p)
      Sets the ScopeProvider that provides a scope to be used for script evaluation.
    • setSourceProvider

      public void setSourceProvider(SourceProvider sourceProvider)
      Sets the SourceProvider that provides the source to be displayed for script evaluation.
    • setExitAction

      public void setExitAction(Runnable r)
      Assign a Runnable object that will be invoked when the user selects "Exit..." or closes the Debugger main window.
    • getIn

      public InputStream getIn()
      Returns an InputStream for stdin from the debugger's internal Console window.
    • getOut

      public PrintStream getOut()
      Returns a PrintStream for stdout to the debugger's internal Console window.
    • getErr

      public PrintStream getErr()
      Returns a PrintStream for stderr in the Debugger's internal Console window.
    • pack

      public void pack()
      Packs the debugger GUI frame.
    • setSize

      public void setSize(int w, int h)
      Sets the debugger GUI frame dimensions.
    • setVisible

      public void setVisible(boolean flag)
      Sets the visibility of the debugger GUI frame.
    • isVisible

      public boolean isVisible()
      Returns whether the debugger GUI frame is visible.
    • dispose

      public void dispose()
      Frees any resources held by the debugger.
    • attachTo

      public void attachTo(org.mozilla.javascript.ContextFactory factory)
      Attaches the debugger to the given ContextFactory.
    • detach

      public void detach()
      Detaches from the current ContextFactory.
    • main

      public static void main(String[] args)
      Main entry point. Creates a debugger attached to a Rhino Main shell session.
    • mainEmbedded

      public static Main mainEmbedded(String title)
      Entry point for embedded applications. This method attaches to the global ContextFactory with a scope of a newly created Global object. No I/O redirection is performed as with main(String[]).
    • mainEmbedded

      public static Main mainEmbedded(org.mozilla.javascript.ContextFactory factory, org.mozilla.javascript.Scriptable scope, String title)
      Entry point for embedded applications. This method attaches to the given ContextFactory with the given scope. No I/O redirection is performed as with main(String[]).
    • mainEmbedded

      public static Main mainEmbedded(org.mozilla.javascript.ContextFactory factory, ScopeProvider scopeProvider, String title)
      Entry point for embedded applications. This method attaches to the given ContextFactory with the given scope. No I/O redirection is performed as with main(String[]).
    • setSize

      @Deprecated public void setSize(Dimension dimension)
      Deprecated.
      Use setSize(int, int) instead.
    • setOptimizationLevel

      @Deprecated public void setOptimizationLevel(int level)
      Deprecated.
      The method does nothing and is only present for compatibility.
    • contextEntered

      @Deprecated public void contextEntered(org.mozilla.javascript.Context cx)
      Deprecated.
      The method is only present for compatibility and should not be called.
    • contextExited

      @Deprecated public void contextExited(org.mozilla.javascript.Context cx)
      Deprecated.
      The method is only present for compatibility and should not be called.
    • contextCreated

      @Deprecated public void contextCreated(org.mozilla.javascript.Context cx)
      Deprecated.
      The method is only present for compatibility and should not be called.
    • contextReleased

      @Deprecated public void contextReleased(org.mozilla.javascript.Context cx)
      Deprecated.
      The method is only present for compatibility and should not be called.