FileDocCategorySizeDatePackage
Hello_World.javaAPI DocExample3043Tue Dec 08 01:21:00 GMT 1998oisoft.togetherx.scripts

Hello_World

public class Hello_World extends Object implements oisoft.togetherx.scriptapi.Script, oisoft.togetherx.scriptapi.ScriptResources
Simple example for Script - write "Hello World!" to output stream
version
2.1.02 28.04.1998
author
Andrei Ivanov

Fields Summary
private boolean
myWriteToStream
private String
myMessage
Constructors Summary
Methods Summary
public voiddoIt(oisoft.togetherx.scriptapi.APIManager apiManager)

      try {
        if (!apiManager.customize(this, "Hello World")) return;

        if (myWriteToStream) {
          String outputStreamName =  apiManager.getOutputStream(".txt");
          if (outputStreamName == null) return;
          PrintWriter outputStream =
            new PrintWriter( new FileOutputStream(outputStreamName));
          outputStream.println(myMessage);
          outputStream.close();
          apiManager.openExternalViewer(outputStreamName);
        }
        else {
           System.out.println(myMessage);
        }
      }
      catch (Exception e) {
        e.printStackTrace();
      }
    
public java.lang.StringgetMenuItem()

       return "Hello World...|E";
    
public java.lang.StringgetMessage()

      return myMessage;
    
public booleanisWriteToStream()

      return myWriteToStream;
    
public voidsetMessage(java.lang.String value)

      myMessage = value;
    
public voidsetWriteToStream(boolean value)

      myWriteToStream = value;