Class TargetProxy
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class TargetProxy *Beta API*

public class netscape.constructor.TargetProxy
    extends java.lang.Object
    implements netscape.application.Target,
               netscape.util.Codable
{
    /* Fields
     */
    public final static int APPLICATION_TYPE;
    public final static int CUSTOM_TYPE;
    public final static int TARGET_CHAIN_TYPE;

    /* Constructors
     */
    public TargetProxy();

    /* Methods
     */
    public Vector commands();
    public String name();
    public void performCommand(String, Object);
    public void setName(String);
    public void setType(int);
    public int type();
}
A TargetProxy is an object that in stored in a Constructor document that represents a real application object. The TargetProxy object can have commands added to it's description while in Constructor. This allows you to define arbitrary commands for the object and connect these commands to specific events in the application. Additionally, like all Constructor objects, they can be named. The purpose of these TargetProxies is to represent some actual application object that responds to these commands. When a .plan file is loaded, a Hashtable containing the real application objects is passed into the Plan constructor. During unarchiving, the TargetProxies are replaced with the real application objects, based on matching the object names. Any objects that would have sent a command to the TargetProxy, instead send the command to the real application object.

There are two standard objects that you are normally interested in, the Application.application() object and the TargetChain.applicationChain() object. These two objects are handled specially by the Plan object. A TargetProxy with the name "__APPLICATION__" will always stand for the application object. A TargetProxy with the name "__TARGETCHAIN__" will always stand for the applicationChain object. These two objects are always replaced when the Plan object loads. You do not have to include them in the TargetProxies hashtable that you pass in on the Plan constructors. The TargetProxy also maintains a type value, indicating if it is the application or the TargetChain proxy. By setting the type to CUSTOM_TYPE you can set the proxyName value to any string, allowing you to replace the proxy with your own custom object.

You normally will not need to create a TargetProxy outside of Constructor.
See Also:
Plan

Fields

APPLICATION_TYPE

  public final static int APPLICATION_TYPE
type value indicating Application object.

TARGET_CHAIN_TYPE

  public final static int TARGET_CHAIN_TYPE
type value indicating TargetChain object.

CUSTOM_TYPE

  public final static int CUSTOM_TYPE
type value indicating a Custom object.

Constructors

TargetProxy

  public TargetProxy()
Creates a CUSTOM_TYPE TargetProxy

Methods

commands

  public Vector commands()
Returns the commands that this TargetProxy is supposed to be able to perform.

name

  public String name()
This is the name used to find the real object from the Hashtable passed into the Plan object constructor.

setName

  public void setName(String value)
You can only change the name of CUSTOM_TYPE TargetProxy.

type

  public int type()

setType

  public void setType(int value)
Sets the type of this object.

performCommand

  public void performCommand(String command,
                             Object anObject)
This object does not actually implement any action here. It will print to System.err a message, if it is ever called.

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 Apr 1997