|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wrq.vhi.script.api.EntityEventHandler
writeattributes.AddressEdit
public class AddressEdit
Entity event listener.
This event handler implements the Write Attributes event. The purpose of this event is to allow an event handler with special knowledge of how to move around the screen to choose the order in which attributes are written.
In this case the attributes are sorted into the order they have on the
screen using a priority queue
. The event handler iterates through
the set of attributes to be written, binds each attribute name with its
position on the screen in an AddressEdit
object, and tells the
priority queue
to add the attribute in tab order. Then the
writeAttributes
handler compares the
current cursor position with the first and last attributes to be written,
chooses the closest one, and uses an iterator
to write the attributes in tab order.
This kind of an optimization is illustrated here only to show that doing this kind of ordering complicates the event handler a bit: it is worth the effort only when it speeds host access considerably.
Nested Class Summary | |
---|---|
private class |
AddressEdit.AttributeRegion
Pair binding an attribute name to its position on the screen. |
private class |
AddressEdit.PriorityQueue
Priority queue used to order the writing of attributes. |
Field Summary | |
---|---|
static java.lang.String |
description
|
static int |
entityArrivalTimeout
Timeout in seconds for the entityArrival() event. |
static int |
entityDepartureTimeout
Timeout in seconds for the entityDeparture() event. |
private static int |
errWaitForHostDataTimeout
Event timeout error code. |
static int |
moveCursorTimeout
Timeout in seconds for the moveCursor() event. |
static int |
writeAttributesTimeout
Timeout in seconds for the writeAttributes() event. |
Fields inherited from interface com.wrq.vhi.script.api.EventHandler |
---|
DEFAULT_TIMEOUT |
Constructor Summary | |
---|---|
AddressEdit()
|
Method Summary | |
---|---|
void |
writeAttributes(com.wrq.vhi.script.api.WriteAttributesEvent event)
Write one or more attributes to the terminal screen in optimal order. |
Methods inherited from class com.wrq.vhi.script.api.EntityEventHandler |
---|
entityArrival, entityDeparture, moveCursor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String description
private static final int errWaitForHostDataTimeout
public static final int entityArrivalTimeout
public static final int entityDepartureTimeout
public static final int moveCursorTimeout
public static final int writeAttributesTimeout
Constructor Detail |
---|
public AddressEdit()
Method Detail |
---|
public void writeAttributes(com.wrq.vhi.script.api.WriteAttributesEvent event) throws com.wrq.apptrieve.agent.ApptrieveException
writeAttributes
in class com.wrq.vhi.script.api.EntityEventHandler
event
- the event instance
com.wrq.apptrieve.agent.ApptrieveException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |