abbot.script
Class Appletviewer

java.lang.Object
  extended by abbot.script.Step
      extended by abbot.script.Call
          extended by abbot.script.Launch
              extended by abbot.script.Appletviewer
All Implemented Interfaces:
UIContext, XMLConstants, XMLifiable, Serializable

public class Appletviewer
extends Launch

Provides applet launch capability. Usage:

<applet code="..." [codebase="..."] [params="..."] [archive="..."]>

The attributes are equivalent to those provided in the HTML applet tag. The params attribute is a comma-separated list of name=value pairs, which will be passed to the applet within the applet tag as param elements.

WARNING: Closing the appletviewer window from the window manager close button will result applet-spawned event dispatch threads being left running. To avoid this situation, always use the appletviewer Quit menu item or use the terminate() method of this class.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class abbot.script.Launch
Launch.ThreadedLaunchListener
 
Field Summary
 
Fields inherited from interface abbot.script.XMLConstants
TAG_ACTION, TAG_APPLETVIEWER, TAG_ARCHIVE, TAG_ARGS, TAG_ASSERT, TAG_AWT, TAG_AWTTESTSCRIPT, TAG_BORDER_TITLE, TAG_CALL, TAG_CLASS, TAG_CLASSPATH, TAG_CODE, TAG_CODEBASE, TAG_COMMENT, TAG_COMPONENT, TAG_COUNT, TAG_DELEGATE, TAG_DESC, TAG_DOCBASE, TAG_EVENT, TAG_EXPR, TAG_FILENAME, TAG_FIXTURE, TAG_FORKED, TAG_HEIGHT, TAG_HORDER, TAG_ICON, TAG_ID, TAG_INDEX, TAG_INVERT, TAG_INVOKER, TAG_KEYCHAR, TAG_KEYCODE, TAG_KIND, TAG_LABEL, TAG_LAUNCH, TAG_METHOD, TAG_MODIFIERS, TAG_NAME, TAG_PARAMS, TAG_PARENT, TAG_POLL_INTERVAL, TAG_PROPERTY, TAG_ROOT, TAG_SAMPLE, TAG_SCRIPT, TAG_SEQUENCE, TAG_SLOW, TAG_STOP_ON_ERROR, TAG_STOP_ON_FAILURE, TAG_TAG, TAG_TERMINATE, TAG_TEXT, TAG_THREADED, TAG_TIMEOUT, TAG_TITLE, TAG_TRIGGER, TAG_TYPE, TAG_VALUE, TAG_VMARGS, TAG_VORDER, TAG_WAIT, TAG_WEIGHTED, TAG_WIDTH, TAG_WINDOW, TAG_X, TAG_Y
 
Constructor Summary
Appletviewer(Resolver resolver, Map attributes)
          Create an applet-launching step.
Appletviewer(Resolver resolver, String description, String code, Map params, String codebase, String archive, String classpath)
          Create an applet-launching step.
 
Method Summary
protected  String generateHTML()
          Generate HTML suitable for launching this applet.
 String getArchive()
           
 Map getAttributes()
          Attributes to save in script.
 String getCode()
           
 String getCodebase()
           
 ClassLoader getContextClassLoader()
          Returns the applet class loader.
 String getDefaultDescription()
          Return a reasonable default description for this script step.
protected  Frame getFrame()
           
 String getHeight()
           
 Map getParams()
           
 String[] getParamsAsArray()
           
 String getParamsAttribute()
           
 String getUsage()
          Provide a usage String for this step.
 String getWidth()
           
 String getXMLTag()
          Define the XML tag to use for this script step.
protected  void install()
          Install the class loader context for the code being launched.
protected  Map parseParams(String attribute)
           
protected  void quitApplet(Frame frame)
           
protected  boolean removeSMOnExit()
           
 void runStep()
          Run this step.
 void setArchive(String archive)
           
 void setCode(String code)
           
 void setCodebase(String codebase)
           
 void setHeight(String height)
           
 void setMethodName(String name)
           
 void setParams(Map params)
           
 void setTargetClassName(String name)
           
 void setWidth(String width)
           
 void terminate()
          To properly terminate, we need to invoke AppletViewer's appletQuit() method (protected, but accessible).
 
Methods inherited from class abbot.script.Launch
createClassLoader, equivalent, getClasspath, getHierarchy, getMethod, getTarget, getTargetClass, isLaunched, isThreaded, launch, resolveClass, setClasspath, setThreaded, setThreadedLaunchListener, synchronizedRunStep
 
Methods inherited from class abbot.script.Call
disambiguateMethod, evaluateParameter, evaluateParameters, getArgs, getArguments, getArgumentsDescription, getEncodedArguments, getMethodName, getMethods, getTargetClassName, invoke, resolveMethod, resolveMethods, setArguments, setArguments
 
Methods inherited from class abbot.script.Step
addAttributes, addContent, createAttributeMap, createStep, createStep, getDescription, getResolver, parseStepAttributes, resolveTester, run, setDescription, setScriptError, simpleClassName, toEditableString, toString, toXML, toXMLString, usage, usage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Appletviewer

public Appletviewer(Resolver resolver,
                    Map attributes)
Create an applet-launching step.


Appletviewer

public Appletviewer(Resolver resolver,
                    String description,
                    String code,
                    Map params,
                    String codebase,
                    String archive,
                    String classpath)
Create an applet-launching step.

Method Detail

quitApplet

protected void quitApplet(Frame frame)

runStep

public void runStep()
             throws Throwable
Run this step. Causes the appropriate HTML file to be written for use by appletviewer and its path used as the sole argument.

Overrides:
runStep in class Launch
Throws:
Throwable

generateHTML

protected String generateHTML()
Generate HTML suitable for launching this applet.


setTargetClassName

public void setTargetClassName(String name)
Overrides:
setTargetClassName in class Call

setMethodName

public void setMethodName(String name)
Overrides:
setMethodName in class Call

setCode

public void setCode(String code)

getCode

public String getCode()

setCodebase

public void setCodebase(String codebase)

getCodebase

public String getCodebase()

setArchive

public void setArchive(String archive)

getArchive

public String getArchive()

getWidth

public String getWidth()

setWidth

public void setWidth(String width)

getHeight

public String getHeight()

setHeight

public void setHeight(String height)

getParams

public Map getParams()

setParams

public void setParams(Map params)

parseParams

protected Map parseParams(String attribute)

getParamsAsArray

public String[] getParamsAsArray()

getParamsAttribute

public String getParamsAttribute()

getAttributes

public Map getAttributes()
Description copied from class: Call
Attributes to save in script.

Overrides:
getAttributes in class Launch

getDefaultDescription

public String getDefaultDescription()
Description copied from class: Step
Return a reasonable default description for this script step. This value is used in the absence of an explicit description.

Overrides:
getDefaultDescription in class Launch

getUsage

public String getUsage()
Description copied from class: Step
Provide a usage String for this step.

Overrides:
getUsage in class Launch

getXMLTag

public String getXMLTag()
Description copied from class: Step
Define the XML tag to use for this script step.

Overrides:
getXMLTag in class Launch

getContextClassLoader

public ClassLoader getContextClassLoader()
Returns the applet class loader.

Specified by:
getContextClassLoader in interface UIContext
Overrides:
getContextClassLoader in class Launch
Returns:
A ClassLoader providing access to classes in this context.

install

protected void install()
Description copied from class: Launch
Install the class loader context for the code being launched. The context class loader for the current thread is modified.

Overrides:
install in class Launch

removeSMOnExit

protected boolean removeSMOnExit()

getFrame

protected Frame getFrame()

terminate

public void terminate()
To properly terminate, we need to invoke AppletViewer's appletQuit() method (protected, but accessible).

Specified by:
terminate in interface UIContext
Overrides:
terminate in class Launch


Copyright © 2002-2008 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge