org.eclipse.rse.subsystems.shells.core.model
Class RemoteCommandShellOperation
java.lang.Object
org.eclipse.rse.subsystems.shells.core.model.RemoteCommandShellOperation
-
All Implemented Interfaces:
-
EventListener,
ISystemResourceChangeListener,
ISystemShellProvider
-
public abstract class RemoteCommandShellOperation
- extends
Object
- implements
ISystemResourceChangeListener,
ISystemShellProvider
Base class for command shell wrappers that use echo markers to parse command finish.
This abstract class can be extended to provide a command shell wrapper. When
running a shell, commands can be piped to the shell via the sendCommand()
method. Echo commands are used to determine when each command is complete.
Whenever a command completes, the handleCommandFinished() method is called.
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
_cmdSubSystem
protected
IRemoteCmdSubSystem _cmdSubSystem
_pwd
protected
IRemoteFile _pwd
_shell
protected
Shell _shell
_remoteCmdShell
protected
IRemoteCommandShell _remoteCmdShell
RemoteCommandShellOperation
public RemoteCommandShellOperation(
Shell shell,
IRemoteCmdSubSystem cmdSubSystem,
IRemoteFile pwd)
- Constructor
setWorkingDirectory
public void setWorkingDirectory(
IRemoteFile pwd)
-
-
run
public
IRemoteCommandShell run()
- Launches a new remote shell
-
-
getRemoteCommandShell
public
IRemoteCommandShell getRemoteCommandShell()
-
-
associateProject
public void associateProject(
IProject project)
-
-
finish
public void finish()
- Called when a shell is complete.
-
-
getCurrentCommand
public
String getCurrentCommand()
-
-
sendCommand
public void sendCommand(
String cmd)
- Send a command to the running command shell.
-
-
-
Parameters:
-
cmd
- the command to run in the shell
sendInput
public void sendInput(
String input)
- Send input to the running command shell. The input is treated as input to
a running program - rather than a new command. As such, no echos are used
and it's not logged for completion.
-
-
-
Parameters:
-
input
- the input to send to the running program
getShell
public
Shell getShell()
-
Description copied from interface:
ISystemShellProvider
- This method will be called to return the shell for your viewer.
-
-
Specified by:
-
getShell
in interface
ISystemShellProvider
-
-
Returns:
- the shell for your viewer.
isActive
public boolean isActive()
- Indicates whether the command shell is active or not
-
-
-
Returns:
- true if the command shell is running
systemResourceChanged
public void systemResourceChanged(
ISystemResourceChangeEvent event)
-
Description copied from interface:
ISystemResourceChangeListener
- This is the method in your class that will be called when a
system resource changes.
-
-
Specified by:
-
systemResourceChanged
in interface
ISystemResourceChangeListener
-
-
See Also:
-
ISystemResourceChangeEvent
outputUpdated
public void outputUpdated()
- Called (on the main Thread) whenever output is retrieved from the host
-
-
commandMatches
protected boolean commandMatches(
String outputEcho,
RemoteCommandShellOperation.CommandAlias firstCommand)
-
-
handleShellFinished
public void handleShellFinished()
- Called (on the main Thread) when the shell is complete
-
-
handleCommandFinished
public abstract void handleCommandFinished(
String cmd)
- Called (on the main Thread) when the specified command is complete
-
-
-
Parameters:
-
cmd
- the completed command
handleOutputChanged
public abstract void handleOutputChanged(
String command,
Object output)
- Called (on the main Thread) whenever output has changed
-
-
-
Parameters:
-
command
- the current command -
output
- the new output object
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.