Class SwingGui

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, GuiCallback

public class SwingGui extends JFrame implements GuiCallback
GUI for the Rhino debugger.
See Also:
  • Constructor Details

    • SwingGui

      public SwingGui(Dim dim, String title)
      Creates a new SwingGui.
  • Method Details

    • getMenubar

      public org.mozilla.javascript.tools.debugger.Menubar getMenubar()
      Returns the Menubar of this debugger frame.
    • setExitAction

      public void setExitAction(Runnable r)
      Sets the Runnable that will be run when the "Exit" menu item is chosen.
    • getConsole

      public org.mozilla.javascript.tools.debugger.JSInternalConsole getConsole()
      Returns the debugger console component.
    • setVisible

      public void setVisible(boolean b)
      Sets the visibility of the debugger GUI.
      Overrides:
      setVisible in class Window
    • showFileWindow

      protected void showFileWindow(String sourceUrl, int lineNumber)
      Shows a FileWindow for the given source, creating it if it doesn't exist yet. if lineNumber is greater than -1, it indicates the line number to select and display.
      Parameters:
      sourceUrl - the source URL
      lineNumber - the line number to select, or -1
    • createFileWindow

      protected void createFileWindow(Dim.SourceInfo sourceInfo, int line)
      Creates and shows a new FileWindow for the given source.
    • updateFileWindow

      protected boolean updateFileWindow(Dim.SourceInfo sourceInfo)
      Update the source text for sourceInfo. This returns true if a FileWindow for the given source exists and could be updated. Otherwise, this does nothing and returns false.
      Parameters:
      sourceInfo - the source info
      Returns:
      true if a FileWindow for the given source exists and could be updated, false otherwise.
    • updateSourceText

      public void updateSourceText(Dim.SourceInfo sourceInfo)
      Called when the source text for a script has been updated.
      Specified by:
      updateSourceText in interface GuiCallback
    • enterInterrupt

      public void enterInterrupt(Dim.StackFrame lastFrame, String threadTitle, String alertMessage)
      Called when the interrupt loop has been entered.
      Specified by:
      enterInterrupt in interface GuiCallback
    • isGuiEventThread

      public boolean isGuiEventThread()
      Returns whether the current thread is the GUI event thread.
      Specified by:
      isGuiEventThread in interface GuiCallback
    • dispatchNextGuiEvent

      public void dispatchNextGuiEvent() throws InterruptedException
      Processes the next GUI event.
      Specified by:
      dispatchNextGuiEvent in interface GuiCallback
      Throws:
      InterruptedException
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Performs an action from the menu or toolbar.