|
CS 1705 Library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Window
cs1705.web.Window
cs1705.web.RobotViewer
public class RobotViewer
A component that presents the viewable contents of a robot task on a web page. It can be given a robot, or a task, or a class name, and will run any that it is given.
A <robot-viewer> tag supports the following properties:
task - The task to monitor. It can be any Java
expression, or any EL expression (i.e., ${...}), but may not be a
bound data value (no @{...}). The viewer will monitor the output
of the robot returned by the task's getRobot() method.taskClass - Instead of a task object, you can provide a
Java class name. The viewer will create its own instance of this
class and then monitor it.robot - Instead of a task, You can provide a robot object
directly. To do anything useful, the robot should implement its own
WebBot.run() method. this property can be any Java
expression, or any EL expression (i.e., ${...}), but may not be a
bound data value (no @{...}).robotClass - Finally, instead of providing a robot object,
you can even provide a Java class name. The viewer will create its own
instance of this class and then monitor its output.robotUrl - If you provide a robotClass,
you can use this optional property to specify a URL parameter to pass to
the robot's constructor. The viewer will use then use this URL when
creating its own instance of your robot class. If you do not specify
a robotClass, this property is ignored.interactive - If you provide a true value for this
optional property, the viewer will continue to listen to the robot's
output channel and update its display, even after the robot task (or
robot) completes. The default is false, which means the viewer will
stop refreshing itself with any output updates as soon as the task (or
robot) finishes.Examples:
<!-- With your class name -->
<robot-viewer taskClass="MySuperRobotTask"/>
<!-- With a custom robot -->
<robot-viewer robot="new MySuperRobot(200, "http://localhost/")"/>
<!-- A longer version, so you don't have to escape the quotes. -->
<robot-viewer>
<attribute name="robot">
new MySuperRobot(200, "http://very.cool.com/a/very/long/url")
</attribute>
</variable>
| Field Summary |
|---|
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Constructor Summary | |
|---|---|
RobotViewer()
Create a RobotViewer component. |
|
RobotViewer(String title,
String border,
boolean closable)
Create a RobotViewer component. |
|
| Method Summary | |
|---|---|
void |
afterCompose()
Creates the robot and/or task if necessary, starts it running, and creates the output widgets. |
boolean |
getInteractive()
Accessor for the interactive property. |
WebBot |
getRobot()
Accessor for the robot property. |
String |
getRobotClass()
Accessor for the robotClass property. |
String |
getRobotUrl()
Accessor for the robotUrl property. |
RobotTask |
getTask()
Accessor for the task property. |
String |
getTaskClass()
Accessor for the taskClass property. |
void |
setInteractive(boolean value)
Mutator for the interactive property. |
void |
setRobot(String bot)
Mutator for the robot property. |
void |
setRobot(WebBot bot)
Mutator for the robot property. |
void |
setRobotClass(String className)
Mutator for the robotClass property. |
void |
setRobotUrl(String url)
Mutator for the robotUrl property. |
void |
setTask(RobotTask task)
Mutator for the task property. |
void |
setTask(String task)
Mutator for the task property. |
void |
setTaskClass(String className)
Mutator for the taskClass property. |
void |
updateRobotMsg()
Update the text output with the current output history of the robot. |
| Methods inherited from class cs1705.web.Window |
|---|
insertBefore, setBorder, setTitle |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
|---|
getAction, getContext, getCtrlKeys, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
focus, getDraggable, getDroppable, getHeight, getLeft, getMoldSclass, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZindex, getZIndex, redraw, setClass, setDroppable, setFocus, setHeight, setLeft, setMoldSclass, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.zkoss.zk.ui.IdSpace |
|---|
getFellow, getFellowIfAny, getFellows, hasFellow |
| Methods inherited from interface org.zkoss.zul.impl.api.XulElement |
|---|
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent |
|---|
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZindex, getZIndex, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Constructor Detail |
|---|
public RobotViewer()
public RobotViewer(String title,
String border,
boolean closable)
title - the window title to useborder - either "normal" or "none"closable - is this window closable?| Method Detail |
|---|
public WebBot getRobot()
robot property.
public void setRobot(WebBot bot)
robot property.
bot - The new valuepublic void setRobot(String bot)
robot property.
bot - The new value as a string of Java code to be interpretedpublic RobotTask getTask()
task property.
public void setTask(RobotTask task)
task property.
task - The new valuepublic void setTask(String task)
task property.
task - The new value as a string of Java code to be interpretedpublic String getRobotClass()
robotClass property.
public void setRobotClass(String className)
robotClass property.
className - The new valuepublic String getTaskClass()
taskClass property.
public void setTaskClass(String className)
taskClass property.
className - The new valuepublic String getRobotUrl()
robotUrl property.
public void setRobotUrl(String url)
robotUrl property.
url - The new valuepublic boolean getInteractive()
interactive property.
public void setInteractive(boolean value)
interactive property.
value - The new valuepublic void afterCompose()
afterCompose in interface AfterComposepublic void updateRobotMsg()
|
Last updated: Wed, Apr 1, 2009 12:29 AM EDT | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||