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 classAbstractRemoteFlowCommandAction.FlowListResponseHandlerCustom handler for intercepting the responses from a remote command operating on remote flows.
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PORTthe default port to use for refreshing flows.protected com.googlecode.lanterna.gui2.Buttonm_ButtonKillAdamsthe button for killing the ADAMS isntance.protected com.googlecode.lanterna.gui2.Buttonm_ButtonPauseFlowthe button for pausing the flow.protected com.googlecode.lanterna.gui2.Buttonm_ButtonRefreshthe button for refreshing the flows.protected com.googlecode.lanterna.gui2.Buttonm_ButtonResumeFlowthe button for resuming the flow.protected com.googlecode.lanterna.gui2.Buttonm_ButtonStopAdamsthe button for stopping the ADAMS instance.protected com.googlecode.lanterna.gui2.Buttonm_ButtonStopFlowthe button for stopping the flow.protected com.googlecode.lanterna.gui2.Panelm_PanelBottomthe bottom panel for additional content.protected com.googlecode.lanterna.gui2.Panelm_PanelFlowsthe panel for the connection/table.protected com.googlecode.lanterna.gui2.table.Table<String>m_TableFlowsthe table with the remote flows.protected com.googlecode.lanterna.gui2.TextBoxm_TextLocalthe local machine.protected com.googlecode.lanterna.gui2.TextBoxm_TextRemotethe remote machine.static StringNO_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.DefaultScriptingEngineconfigureEngine(adams.scripting.responsehandler.ResponseHandler responseHandler)Returns new instance of a configured scripting engine.protected com.googlecode.lanterna.gui2.PanelcreatePanel()Creates the panel to display.com.googlecode.lanterna.gui2.table.TablegetFlowsTable()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 voidkillAdams()Kills the ADAMS instance.protected voidpauseFlow()Pauses the selected flow(s).protected voidrefreshFlows()Refreshes the list of flows.protected voidresumeFlow()Resumes the selected flow(s).voidsendCommand(adams.scripting.command.RemoteCommand cmd)Sends the specified command, not waiting for a response.voidsendCommandWithReponse(adams.scripting.command.RemoteCommandWithResponse cmd)Sends the specified command.voidsendCommandWithReponse(adams.scripting.command.RemoteCommandWithResponse cmd, adams.scripting.responsehandler.ResponseHandler responseHandler)Sends the specified command and the response handler for intercepting the result.protected voidstopAdams()Stops the ADAMS instance.protected voidstopFlow()Stops the selected flow(s).protected voidupdateButtons()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:
createPanelin 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.
-
-