home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 May / PCO_5_97.ISO / FilesBBS / OS2 / CSIME.ARJ / CSIME.ZIP / csime / HTMLSourceCommand.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-02-09  |  1.5 KB  |  45 lines

  1. import java.awt.Window;
  2. import java.io.ByteArrayOutputStream;
  3. import java.io.IOException;
  4. import java.io.OutputStream;
  5. import mug.app.Command;
  6. import mug.ui.TextAreaDialog;
  7.  
  8. public class HTMLSourceCommand extends Command {
  9.    private MainShell _app;
  10.  
  11.    public HTMLSourceCommand(MainShell var1) {
  12.       this._app = var1;
  13.    }
  14.  
  15.    public void execute() {
  16.       label37: {
  17.          try {
  18.             this._app.setBusy(true);
  19.             ImageMap var3 = (ImageMap)this._app.getDocument();
  20.             ByteArrayOutputStream var4 = new ByteArrayOutputStream();
  21.             var3.doSave(var4);
  22.             TextAreaDialog var5 = new TextAreaDialog(this._app, "HTML Source", false, 16, 64);
  23.             var5.setEditable(false);
  24.             var5.setText(var4.toString());
  25.             ((Window)var5).show();
  26.             ((OutputStream)var4).close();
  27.             break label37;
  28.          } catch (IOException var8) {
  29.             this.log(var8);
  30.          } finally {
  31.             this._app.setBusy(false);
  32.          }
  33.  
  34.          return;
  35.       }
  36.  
  37.       ((Command)this).executeNext();
  38.    }
  39.  
  40.    private void log(Exception var1) {
  41.       System.out.println("Caught an exception: " + ((Throwable)var1).getMessage());
  42.       ((Throwable)var1).printStackTrace();
  43.    }
  44. }
  45.