|
T-Plan Robot Enterprise 3.2 Build No. 3.2-20121217.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.tplan.robot.scripting.commands.AbstractCommandHandler
com.tplan.robot.scripting.commands.impl.PressCommand
com.tplan.robot.scripting.commands.impl.TypeCommand
com.tplan.robot.scripting.commands.impl.TypeLineCommand
public class TypeLineCommand
Handler implementing functionality of the TypeLine command.
T-Plan Robot Enterprise, (C) 2009-2012 T-Plan Limited. All rights reserved.
| Field Summary |
|---|
| Fields inherited from class com.tplan.robot.scripting.commands.impl.PressCommand |
|---|
fakeShiftPreference, PARAM_DELAY, PARAM_LOCATION, PARAM_LOCATION_LEFT, PARAM_LOCATION_NUMPAD, PARAM_LOCATION_RIGHT, PARAM_LOCATION_STANDARD, PARAM_RELEASE |
| Fields inherited from class com.tplan.robot.scripting.commands.AbstractCommandHandler |
|---|
ALT, CONTEXT_COMMAND_CALL_PARAMETER_MAP, CONTEXT_COMPILE_SINGLE_COMMAND_MODE, CONTEXT_LAST_WAIT_FACTOR, CONTEXT_WAIT_FACTOR_ERR_MSG_SHOWN, CTRL, PARAM_COUNT, PARAM_ONFAIL, PARAM_ONPASS, PARAM_WAIT, SHIFT, WINDOWS |
| Fields inherited from interface com.tplan.robot.scripting.commands.EditorFriendlyCommandHandler |
|---|
CATEGORY_ADMIN, CATEGORY_DESKTOP, CATEGORY_IMAGE_OPS, CATEGORY_IO, CATEGORY_REPORTING, CATEGORY_UNKNOWN |
| Constructor Summary | |
|---|---|
TypeLineCommand()
|
|
| Method Summary | |
|---|---|
int |
execute(List args,
Map values,
ScriptingContext context)
Execute the command. |
String[] |
getCommandNames()
Get command names. |
KeyStroke |
getContextShortcut()
Get preferred hot key for the GUI command wizard. |
List |
getPreferences()
Get metadata of displayable/editable configurable parameters. |
String |
getShortDescription(Map<String,String> parameters,
TestScriptInterpret interpret)
Get short description (up to 50 chars) of what the command does. |
List |
getStablePopupMenuItems()
Get a list of stable actions. |
List<Preference> |
getVisualParameters(LinkedHashMap<String,Object> parameters,
TestScriptInterpret interpret)
Get the list of visual parameters for construction of a dynamic command editor window. |
void |
validate(List args,
Map values,
Map variableContainer,
ScriptingContext context)
Validate if the command complies with the command syntax.The command is already pre-parsed to a list of parameter names and a map of [name, value] pairs. |
| Methods inherited from class com.tplan.robot.scripting.commands.impl.TypeCommand |
|---|
checkVisualParameters, configurationChanged, getCategory, getContextArgument, getContextAttributes, getVisualParameters, handleTypeEvent, hasCustomParameterComponent, hasCustomPropertyDialog, hasFixedArgument, validatePress |
| Methods inherited from class com.tplan.robot.scripting.commands.impl.PressCommand |
|---|
getArguments, getParameters, getParameterValues, handlePressEvent, sendKeyEvent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.tplan.robot.scripting.commands.CommandHandler |
|---|
addCommandListener, canRunWithoutConnection, isGlobalPrerequisity, removeCommandListener |
| Constructor Detail |
|---|
public TypeLineCommand()
| Method Detail |
|---|
public void validate(List args,
Map values,
Map variableContainer,
ScriptingContext context)
throws SyntaxErrorException
CommandHandler
validate in interface CommandHandlervalidate in class TypeCommandargs - a list of parameters.values - a map of [param, value] pairs resulted from parsing of the command.variableContainer - output map for values.context - execution context.
SyntaxErrorException - when the command doesn't meet the required syntax.public String[] getCommandNames()
CommandHandlerGet command names. A command name is the first word in a script line, e.g. "Type" or "Press". Though most commands have just one name, you may use this method to define any number of command aliases. You may even use one class to implement more commands if you want. In such a case you need to define more command names and implement a different behavior for each command.
Please note that command name parsing is NOT case sensitive. You don't have to define the names as e.g. { "MyCommand", "mycommand" }. Script parser will always parse the command name in a script and convert it to upper case using the String.toUpperCase(). Such a command name will be then used to look for a command implementation in the command table.
getCommandNames in interface CommandHandlergetCommandNames in class TypeCommand
public int execute(List args,
Map values,
ScriptingContext context)
throws SyntaxErrorException,
IOException
CommandHandlerExecute the command.
Argument context will contain all necessary objects that the command may possibly use,
for example the com.tplan.robot.gui.FrameBufferPanel and com.tplan.robot.api.rfb.RfbModule instances etc. If the command e.g. needs to send
some key events to the RFB server, you should save the reference to the RfbModuleImpl instance and use
its methods to fire the required key events.
execute in interface CommandHandlerexecute in class TypeCommandargs - a list of parameters.values - a map of [param, value] pairs resulted from parsing of the command.context - execution context.
SyntaxErrorException - when the command doesn't meet the required syntax.
IOException - an instance of I/O exception may be thrown if an error occurs
in communication with the underlying desktop client.public List getPreferences()
Configurable
getPreferences in interface ConfigurablegetPreferences in class TypeCommandpublic List getStablePopupMenuItems()
CommandHandler
getStablePopupMenuItems in interface CommandHandlergetStablePopupMenuItems in class AbstractCommandHandlerpublic KeyStroke getContextShortcut()
CommandHandler
getContextShortcut in interface CommandHandlergetContextShortcut in class TypeCommand
public List<Preference> getVisualParameters(LinkedHashMap<String,Object> parameters,
TestScriptInterpret interpret)
EditorFriendlyCommandHandlerGet the list of visual parameters for construction of a dynamic command editor window.
This method will be called only after the EditorFriendlyCommandHandler.hasCustomPropertyDialog(java.util.LinkedHashMap, com.tplan.robot.scripting.interpret.TestScriptInterpret, int, javax.swing.Action[])
and EditorFriendlyCommandHandler.hasCustomParameterComponent(java.util.LinkedHashMap, com.tplan.robot.scripting.interpret.TestScriptInterpret, com.tplan.robot.gui.preferences.PreferencePanel[]) methods
return false.
getVisualParameters in interface EditorFriendlyCommandHandlergetVisualParameters in class TypeCommandparameters - input parameters parsed from the already existing command
or preselected through the Command Wizard menu.interpret - test script interpret owning the edited script.
EditorFriendlyCommandHandler.hasCustomPropertyDialog(java.util.LinkedHashMap, com.tplan.robot.scripting.interpret.TestScriptInterpret, int, javax.swing.Action[])
and EditorFriendlyCommandHandler.hasCustomParameterComponent(java.util.LinkedHashMap, com.tplan.robot.scripting.interpret.TestScriptInterpret, com.tplan.robot.gui.preferences.PreferencePanel[]) methods,
it will be considered as not editable through the GUI.
public String getShortDescription(Map<String,String> parameters,
TestScriptInterpret interpret)
EditorFriendlyCommandHandler
getShortDescription in interface EditorFriendlyCommandHandlergetShortDescription in class TypeCommandparameters - map of parameters and their values. All values are
in the format recognized by token parser (TokenParserImpl.getParser())
which may be used to convert them to native Java objects such as Number, Point,
Rectangle etc.interpret - test script interpret owning the edited script.
|
T-Plan Robot Enterprise 3.2 Build No. 3.2-20121217.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||