home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 January / PCO0198.ISO / browser / net_linx / java40.jar / netscape / applet / Console.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-11-03  |  2.0 KB  |  61 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.       SecurityManager.enablePrivilege("UniversalPropertyRead");
  21.       var2.println(System.getProperty("java.vendor") + " -- Java " + System.getProperty("java.version"));
  22.       SecurityManager.revertPrivilege();
  23.       var2.println("Type '?' for options.");
  24.       var2.flush();
  25.    }
  26.  
  27.    private static native void setSystemIO(InputStream var0, PrintStream var1, PrintStream var2);
  28.  
  29.    static native void dumpNSPRInfo();
  30.  
  31.    static native void dumpMemory(boolean var0);
  32.  
  33.    static native void dumpMemorySummary();
  34.  
  35.    static native void checkpointMemory();
  36.  
  37.    static native void dumpApplicationHeaps();
  38.  
  39.    static native void debugWrite(String var0);
  40.  
  41.    void reset() {
  42.       this.frame.reset();
  43.    }
  44.  
  45.    void show() {
  46.       if (!this.frame.isVisible()) {
  47.          this.frame.show();
  48.          MozillaAppletContext.setConsoleState(1);
  49.       }
  50.  
  51.    }
  52.  
  53.    void hide() {
  54.       if (this.frame.isVisible()) {
  55.          this.frame.hide();
  56.          MozillaAppletContext.setConsoleState(0);
  57.       }
  58.  
  59.    }
  60. }
  61.