Package com.rs.seagull.emulator.api
Interface Session
- All Superinterfaces:
BareSession
,Defined
A Session expands on the more basic BareSession, adding named screens and named user-defined fields and
'controls'.
- Version:
- $Id$
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.rs.seagull.emulator.api.BareSession
BareSession.Capability, BareSession.Capture
-
Method Summary
Modifier and TypeMethodDescriptionReturns the cursor for the current screen.Returns the user-defined field with the given name from the current screen.Returns a list of all the user-defined fields on the current screen.Returns the currently visible screen.Returns the name of the currently visible screen.Returns the user-defined table with the given name from the current screen.Returns the text content of the given field.void
Position the cursor to the given user-defined field, then send a key to the host.void
Position the cursor to the given user-defined field, then send a key to the host.void
Set the text content of the given named field.Methods inherited from interface com.rs.seagull.emulator.api.BareSession
addStartupInformationListener, changeBlackBoxCapacity, completeConnect, connect, connectAsync, disconnect, disconnectAsync, executeJavaScript, executeJavaScript, executeJavaScript, getCapability, getCursorPosition, getHostConnection, getId, getKeyboard, getScreenList, getScreenSize, getStartupInformation, getText, getText, getText, getTextAtRowColumn, getTextLine, getTextLines, getTextLines, hasCapability, hideViewer, isConnected, isCursorVisible, isOperatorError, produceTroubleshootLog, removeStartupInformationListener, sendBytes, sendKey, sendKeyAndCapture, sendText, setDebugDelaySendKey, setDebugDelaySendText, showViewer, toOffset, toPoint, waitFor
-
Method Details
-
getScreen
Screen getScreen()Returns the currently visible screen.- Specified by:
getScreen
in interfaceBareSession
- Returns:
- the currently visible screen.
-
getScreenName
String getScreenName()Returns the name of the currently visible screen.- Returns:
- the name of the currently visible screen.
-
sendKey
Position the cursor to the given user-defined field, then send a key to the host. The list of possible keys is inKeys
, specificallyKeys.Ibm5250
,Keys.Ibm3270
, andKeys.AnsiVT
.- Parameters:
fieldName
- the field to position the cursor in before sending the key.key
- the key to send to the host. SeeKeys
.- Throws:
NoSuchFieldException
- if the field does not exist.
-
sendKey
Position the cursor to the given user-defined field, then send a key to the host. The list of possible keys is inKeys
, specificallyKeys.Ibm5250
,Keys.Ibm3270
, andKeys.AnsiVT
. For multi-part fields, e.g. continued or column, position to the index'th part (zero-based indexing).- Parameters:
fieldName
- the field to position the cursor in before sending the key.index
- the index'th part of the field, zero-based.key
- the key to send to the host. SeeKeys
.- Throws:
NoSuchFieldException
- if the field does not exist.
-
getField
Returns the user-defined field with the given name from the current screen. Note that this does not return the contents of a field, but rather the field itself. To get the contents of a field, @see getText.- Parameters:
fieldName
- The name of the field.- Returns:
- the user-defined field with the given name.
- Throws:
NoSuchFieldException
- if the field does not exist.
-
getFields
Returns a list of all the user-defined fields on the current screen.- Returns:
- a list of all the user-defined fields on the current screen.
-
getText
Returns the text content of the given field. This is a convenience method for session.getField(fieldName).getText();- Parameters:
fieldName
- The name of the field.- Returns:
- the text content of the field.
- Throws:
NoSuchFieldException
- if the field does not exist.
-
setText
void setText(String fieldName, String fieldValue) throws FieldValidationException, NoSuchFieldException Set the text content of the given named field. This is a convenience for session.getField(fieldName).setText(fieldValue);- Parameters:
fieldName
- The name of the field.fieldValue
- The text content to place into the field. If null or empty, the field is cleared.- Throws:
NoSuchFieldException
- if the field does not exist.FieldValidationException
- if the text is not valid for this field.
-
getCursor
Cursor getCursor()Returns the cursor for the current screen. Same as getScreen().getCursor().- Specified by:
getCursor
in interfaceBareSession
- Returns:
- the current cursor.
-
getTable
Returns the user-defined table with the given name from the current screen.- Parameters:
tableName
- The name of the table.- Returns:
- the user-defined table with the given name.
- Throws:
NoSuchFieldException
- if the table does not exist.
-