Class AbstractCommand
This class encapsulates a static method invoked through Java reflection.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JButtonThe target method parameters.A map of key/value pairs passed to the command.The label that appears on the button associated with the command.protected JTextFieldprotected booleanFlag to control behaviour on a FAIL response.The static method's class.The method to call. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the text field.static ObjectCalls a static method by Java reflection.static ObjectCalls a static method by Java reflection.abstract voidgo()Parses, calls and handles reponses for a command.voidRegisters the button that executes the command.voidsetStatusTextField(JTextField statusTF) Registers a text field used to display messages.static StringInvokes an OS shell script.static StringInvokes an OS shell script.
-
Field Details
-
label
The label that appears on the button associated with the command.
-
targetMethod
The method to call.
-
targetClass
The static method's class.
-
stopOnFail
protected boolean stopOnFailFlag to control behaviour on a FAIL response.
-
data
The target method parameters.
-
dataMap
-
statusTF
-
button
-
-
Constructor Details
-
AbstractCommand
public AbstractCommand()
-
-
Method Details
-
go
-
exec
-
exec
-
shell
Invokes an OS shell script.
Creates a process whose stdout is connected to an input channel.
Process completion is signalled by the process sending a completion response message. This method blocks until it receives the completion response message therefore the process should not write anything other than its completion response to its stdout or this method will return prematurely.
- Parameters:
args- {0=script-path,1...=command-parameters}- Returns:
- The command response.
-
shell2
Invokes an OS shell script.
Creates a process whose stdout is connected to an input channel.
Process completion is signalled by the process sending a completion response message. This method blocks until it receives the completion response message therefore the process should not write anything other than its completion response to its stdout or this method will return prematurely.
- Parameters:
args- {0=script-path,1...=command-parameters}- Returns:
- The command response.
-
setStatusTextField
Registers a text field used to display messages.
- Parameters:
statusTF- The text field.
-
setButton
Registers the button that executes the command.
- Parameters:
button- The button.
-
clearStatus
public void clearStatus()Clears the text field.
-