home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 July / PCO_07_97.ISO / NET_COM / cc32e40.exe / nav40.z / java40.jar / netscape / applet / Console.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-06-07  |  1.5 KB  |  57 lines

  1. package netscape.applet;
  2.  
  3. import java.io.BufferedOutputStream;
  4. import java.io.InputStream;
  5. import java.io.PrintStream;
  6.  
  7. class Console {
  8.    ConsoleFrame frame;
  9.    private InputStream realIn;
  10.    private PrintStream realOut;
  11.    private PrintStream realErr;
  12.  
  13.    Console() {
  14.       SecurityManager.enablePrivilege("UniversalTopLevelWindow");
  15.       this.frame = new ConsoleFrame(this);
  16.       SecurityManager.revertPrivilege();
  17.       ConsoleInputStream var1 = new ConsoleInputStream(this);
  18.       PrintStream var2 = new PrintStream(new BufferedOutputStream(new ConsoleOutputStream(this), 128), true);
  19.       setSystemIO(var1, var2, var2);
  20.       System.err.flush();
  21.    }
  22.  
  23.    private static native void setSystemIO(InputStream var0, PrintStream var1, PrintStream var2);
  24.  
  25.    static native void dumpNSPRInfo();
  26.  
  27.    static native void dumpMemory(boolean var0);
  28.  
  29.    static native void dumpMemorySummary();
  30.  
  31.    static native void checkpointMemory();
  32.  
  33.    static native void dumpApplicationHeaps();
  34.  
  35.    static native void debugWrite(String var0);
  36.  
  37.    void reset() {
  38.       this.frame.reset();
  39.    }
  40.  
  41.    void show() {
  42.       if (!this.frame.isVisible()) {
  43.          this.frame.show();
  44.          MozillaAppletContext.setConsoleState(1);
  45.       }
  46.  
  47.    }
  48.  
  49.    void hide() {
  50.       if (this.frame.isVisible()) {
  51.          this.frame.hide();
  52.          MozillaAppletContext.setConsoleState(0);
  53.       }
  54.  
  55.    }
  56. }
  57.