Package com.rs.seagull.emulator.api
Interface Session
-
- All Superinterfaces:
BareSession
,Defined
public interface Session extends 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Cursor
getCursor()
Returns the cursor for the current screen.Field
getField(String fieldName)
Returns the user-defined field with the given name from the current screen.List<Field>
getFields()
Returns a list of all the user-defined fields on the current screen.Screen
getScreen()
Returns the currently visible screen.String
getScreenName()
Returns the name of the currently visible screen.Table
getTable(String tableName)
Returns the user-defined table with the given name from the current screen.String
getText(String fieldName)
Returns the text content of the given field.void
sendKey(String fieldName, int index, String key)
Position the cursor to the given user-defined field, then send a key to the host.void
sendKey(String fieldName, String key)
Position the cursor to the given user-defined field, then send a key to the host.void
setText(String fieldName, String fieldValue)
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 Detail
-
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
void sendKey(String fieldName, String key) throws NoSuchFieldException
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
void sendKey(String fieldName, int index, String key) throws NoSuchFieldException
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
Field getField(String fieldName) throws NoSuchFieldException
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
List<Field> 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
String getText(String fieldName) throws NoSuchFieldException
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
Table getTable(String tableName) throws NoSuchFieldException
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.
-
-