Class AbstractRemoteFlowCommandAction
- java.lang.Object
-
- adams.terminal.menu.remotecommand.AbstractRemoteCommandAction
-
- adams.terminal.menu.remotecommand.AbstractRemoteCommandActionWithGUI
-
- adams.terminal.menu.remotecommand.AbstractRemoteFlowCommandAction
-
- All Implemented Interfaces:
adams.scripting.processor.RemoteCommandProcessorHandler
,Comparable<AbstractRemoteCommandAction>
- Direct Known Subclasses:
Rats
,RemoteFlowCommands
public abstract class AbstractRemoteFlowCommandAction extends AbstractRemoteCommandActionWithGUI
Ancestor for actions that work on remote flows.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractRemoteFlowCommandAction.FlowListResponseHandler
Custom handler for intercepting the responses from a remote command operating on remote flows.
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PORT
the default port to use for refreshing flows.protected com.googlecode.lanterna.gui2.Button
m_ButtonKillAdams
the button for killing the ADAMS isntance.protected com.googlecode.lanterna.gui2.Button
m_ButtonPauseFlow
the button for pausing the flow.protected com.googlecode.lanterna.gui2.Button
m_ButtonRefresh
the button for refreshing the flows.protected com.googlecode.lanterna.gui2.Button
m_ButtonResumeFlow
the button for resuming the flow.protected com.googlecode.lanterna.gui2.Button
m_ButtonStopAdams
the button for stopping the ADAMS instance.protected com.googlecode.lanterna.gui2.Button
m_ButtonStopFlow
the button for stopping the flow.protected com.googlecode.lanterna.gui2.Panel
m_PanelBottom
the bottom panel for additional content.protected com.googlecode.lanterna.gui2.Panel
m_PanelFlows
the panel for the connection/table.protected com.googlecode.lanterna.gui2.table.Table<String>
m_TableFlows
the table with the remote flows.protected com.googlecode.lanterna.gui2.TextBox
m_TextLocal
the local machine.protected com.googlecode.lanterna.gui2.TextBox
m_TextRemote
the remote machine.static String
NO_DATA
-
Fields inherited from class adams.terminal.menu.remotecommand.AbstractRemoteCommandAction
m_CommandProcessor, m_Owner
-
-
Constructor Summary
Constructors Constructor Description AbstractRemoteFlowCommandAction()
Initializes the action with no owner.AbstractRemoteFlowCommandAction(adams.terminal.application.AbstractTerminalApplication owner)
Initializes the action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected adams.scripting.engine.DefaultScriptingEngine
configureEngine(adams.scripting.responsehandler.ResponseHandler responseHandler)
Returns new instance of a configured scripting engine.protected com.googlecode.lanterna.gui2.Panel
createPanel()
Creates the panel to display.com.googlecode.lanterna.gui2.table.Table
getFlowsTable()
Returns the underlying table for the flows.protected int[]
getSelectedFlowIDs()
Returns an ID array of the currently selected flows.protected int[]
getSelectedRows()
Returns an ID array of the currently selected flows.protected void
killAdams()
Kills the ADAMS instance.protected void
pauseFlow()
Pauses the selected flow(s).protected void
refreshFlows()
Refreshes the list of flows.protected void
resumeFlow()
Resumes the selected flow(s).void
sendCommand(adams.scripting.command.RemoteCommand cmd)
Sends the specified command, not waiting for a response.void
sendCommandWithReponse(adams.scripting.command.RemoteCommandWithResponse cmd)
Sends the specified command.void
sendCommandWithReponse(adams.scripting.command.RemoteCommandWithResponse cmd, adams.scripting.responsehandler.ResponseHandler responseHandler)
Sends the specified command and the response handler for intercepting the result.protected void
stopAdams()
Stops the ADAMS instance.protected void
stopFlow()
Stops the selected flow(s).protected void
updateButtons()
Updates the state of the buttons.-
Methods inherited from class adams.terminal.menu.remotecommand.AbstractRemoteCommandActionWithGUI
doRun
-
Methods inherited from class adams.terminal.menu.remotecommand.AbstractRemoteCommandAction
compareTo, configureEngine, equals, getCommandProcessor, getLogTextBox, getOwner, getRunnable, getTitle, initialize, logError, logError, logMessage, postRun, preRun, sendCommand, sendCommandWithReponse, setCommandProcessor, setOwner
-
-
-
-
Field Detail
-
DEFAULT_PORT
public static final int DEFAULT_PORT
the default port to use for refreshing flows.- See Also:
- Constant Field Values
-
NO_DATA
public static final String NO_DATA
- See Also:
- Constant Field Values
-
m_PanelFlows
protected com.googlecode.lanterna.gui2.Panel m_PanelFlows
the panel for the connection/table.
-
m_PanelBottom
protected com.googlecode.lanterna.gui2.Panel m_PanelBottom
the bottom panel for additional content.
-
m_TextRemote
protected com.googlecode.lanterna.gui2.TextBox m_TextRemote
the remote machine.
-
m_TextLocal
protected com.googlecode.lanterna.gui2.TextBox m_TextLocal
the local machine.
-
m_ButtonRefresh
protected com.googlecode.lanterna.gui2.Button m_ButtonRefresh
the button for refreshing the flows.
-
m_TableFlows
protected com.googlecode.lanterna.gui2.table.Table<String> m_TableFlows
the table with the remote flows.
-
m_ButtonPauseFlow
protected com.googlecode.lanterna.gui2.Button m_ButtonPauseFlow
the button for pausing the flow.
-
m_ButtonResumeFlow
protected com.googlecode.lanterna.gui2.Button m_ButtonResumeFlow
the button for resuming the flow.
-
m_ButtonStopFlow
protected com.googlecode.lanterna.gui2.Button m_ButtonStopFlow
the button for stopping the flow.
-
m_ButtonStopAdams
protected com.googlecode.lanterna.gui2.Button m_ButtonStopAdams
the button for stopping the ADAMS instance.
-
m_ButtonKillAdams
protected com.googlecode.lanterna.gui2.Button m_ButtonKillAdams
the button for killing the ADAMS isntance.
-
-
Constructor Detail
-
AbstractRemoteFlowCommandAction
public AbstractRemoteFlowCommandAction()
Initializes the action with no owner.
-
AbstractRemoteFlowCommandAction
public AbstractRemoteFlowCommandAction(adams.terminal.application.AbstractTerminalApplication owner)
Initializes the action.- Parameters:
owner
- the owning application
-
-
Method Detail
-
createPanel
protected com.googlecode.lanterna.gui2.Panel createPanel()
Creates the panel to display.- Specified by:
createPanel
in classAbstractRemoteCommandActionWithGUI
- Returns:
- the panel
-
configureEngine
protected adams.scripting.engine.DefaultScriptingEngine configureEngine(adams.scripting.responsehandler.ResponseHandler responseHandler)
Returns new instance of a configured scripting engine.- Parameters:
responseHandler
- the handler to use for intercepting the result, can be null- Returns:
- the engine
-
sendCommand
public void sendCommand(adams.scripting.command.RemoteCommand cmd)
Sends the specified command, not waiting for a response.- Parameters:
cmd
- the command to send
-
sendCommandWithReponse
public void sendCommandWithReponse(adams.scripting.command.RemoteCommandWithResponse cmd)
Sends the specified command. Uses a default response handler for intercepting the result.- Parameters:
cmd
- the command to send
-
sendCommandWithReponse
public void sendCommandWithReponse(adams.scripting.command.RemoteCommandWithResponse cmd, adams.scripting.responsehandler.ResponseHandler responseHandler)
Sends the specified command and the response handler for intercepting the result.- Parameters:
cmd
- the command to sendresponseHandler
- the response handler for intercepting the result, can be null
-
refreshFlows
protected void refreshFlows()
Refreshes the list of flows.
-
getSelectedRows
protected int[] getSelectedRows()
Returns an ID array of the currently selected flows.- Returns:
- the flow IDs
-
getSelectedFlowIDs
protected int[] getSelectedFlowIDs()
Returns an ID array of the currently selected flows.- Returns:
- the flow IDs
-
pauseFlow
protected void pauseFlow()
Pauses the selected flow(s).
-
resumeFlow
protected void resumeFlow()
Resumes the selected flow(s).
-
stopFlow
protected void stopFlow()
Stops the selected flow(s).
-
stopAdams
protected void stopAdams()
Stops the ADAMS instance.
-
killAdams
protected void killAdams()
Kills the ADAMS instance.
-
getFlowsTable
public com.googlecode.lanterna.gui2.table.Table getFlowsTable()
Returns the underlying table for the flows.- Returns:
- the table
-
updateButtons
protected void updateButtons()
Updates the state of the buttons.
-
-