Class Script
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Script

public class netscape.constructor.Script
    extends java.lang.Object
    implements netscape.application.Target,
               netscape.util.Codable
{
    /* Fields
     */
    public final static String RUN_COMMAND;

    /* Constructors
     */
    public Script();
    public Script(String);

    /* Methods
     */
    public String command();
    public synchronized boolean isRunning();
    public Hashtable namedObjects();
    public void performCommand(String, Object);
    public void run();
    public String scriptText();
    public void setCommand(String);
    public void setNamedObjects(Hashtable);
    public void setScriptText(String);
    public void setTarget(Target);
    public Target target();
}
Object representing a JavaScript script. The JavaScript code can be set through setScriptText() and the code can be executed by calling run() or through the performCommand() method. When the script is run, any Constructor named objects will be published to the window's JavaScript scope. This allows you to reference any named component in the .plan file from the JavaScript code. Note that this only works under Netscape Navigator. When the script finishes executing, the names are removed from the window's scope.

Fields

RUN_COMMAND

  public final static String RUN_COMMAND
Command to execute the Script contained in this Script.

Constructors

.Script

  public Script()

.Script

  public Script(String scriptText)

Methods

.setScriptText

  public void setScriptText(String scriptText)
Sets the JavaScript code.

.scriptText

  public String scriptText()

.setTarget

  public void setTarget(Target aTarget)
Sets the object to notified when the Script finishes execution.

.target

  public Target target()

.setCommand

  public void setCommand(String command)
Sets the command to send to target when the Script finishes execution.

.command

  public String command()

.namedObjects

  public Hashtable namedObjects()
The Hashtable of names to be placed in the JavaScript scope before execution.

.setNamedObjects

  public void setNamedObjects(Hashtable names)
This will shallow copy the names hashtable into an internal hashtable.

.isRunning

  public synchronized boolean isRunning()
Returns true if the JavaScript is currently executing.

.run

  public void run()
Executes the JavaScript.

.performCommand

  public void performCommand(String command,
                             Object anObject)

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Copyright © 1997 Netscape Communications Corporation. All rights reserved
Please send any comments or corrections to ifcfeedback@netscape.com
HTML generated on 21 Oct 1997