Extension SDK

oracle.ide.runner
Class SimpleProcess

java.lang.Object
  extended byoracle.ide.runner.SimpleProcess

public class SimpleProcess
extends java.lang.Object

The SimpleProcess class contains methods to start a process and redirect the process's output to the log window.


Constructor Summary
SimpleProcess(java.lang.String[] cmd)
          Creates an instance that can be used to start a subprocess.
 
Method Summary
 void exec()
          Executes a separate subprocess.
 int execAndWait()
          Executes a separate subprocess and waits for the subprocess to finish.
 java.lang.Exception getExecException()
           
 void setAddToProcessesFolder(boolean addToProcessesFolder)
          Specifies whether to add the subprocess to the processes folder of the run manager.
 void setAddToTerminateMenu(boolean addToTerminateMenu)
          Specifies whether to list the subprocess in the Terminate submenu of the Run menu.
 void setAllowInput(boolean allowInput)
          Sets whether the subprocess will allow input, which will be read through some UI in the log window.
 void setCommandStringForLog(java.lang.String commandStringForLog)
          Specifies the command string that should be logged.
 void setIcon(javax.swing.Icon icon)
          Sets the icon that will appear with the subprocess in the processes folder of the run manager.
 void setLabel(java.lang.String label)
          Sets the label that will appear with the subprocess in the processes folder of the run manager.
 void setLogCommandString(boolean logCommandString)
          Specifies whether to show the command string itself in the log window.
 void setLogPage(LogPage logPageOverride)
          Sets the log page where the subprocess's output will be displayed.
 void setRunProcessListener(RunProcessListener runProcessListener)
          Specifies that a callback method should be called after the subprocess has finished executing and all of the subprocess's output has been sent to the log page.
 void setShowStartStatus(boolean showStartStatus)
          Specifies whether to show the start message in the status bar.
 void setWorkingDirectory(java.io.File dir)
          Sets the working directory for the subprocess.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleProcess

public SimpleProcess(java.lang.String[] cmd)
Creates an instance that can be used to start a subprocess.

The subprocess inherits the working directory of the current process, unless overridden by the setWorkingDirectory(java.io.File) method.

The label that will appear with the subprocess in the processes folder of the run manager will be the zero-th argument of the command array passed to the exec() or execAndWait() method, unless overridden by the setLabel(java.lang.String) method.

The Swing default icon will appear with the subprocess in the processes folder of the run manager, unless overridden by the setIcon(javax.swing.Icon) method.

A new log page will be created to display the subprocess's output, unless overridden by the setLogPage(oracle.ide.log.LogPage) method.

The command string itself will be logged, unless overridden by the setLogCommandString(boolean) method.

To adjust or manipulate the command string that is logged, use the setCommandStringForLog(java.lang.String) method.

A start message will be shown in the status bar, unless overridden by the setShowStartStatus(boolean) method.

The subprocess will be added to the processes folder of the run manager, unless overridden by the setAddToProcessesFolder(boolean) method.

The subprocess will be listed in the Terminate submenu of the Run menu, unless overridden by the setAddToTerminateMenu(boolean) method.

Parameters:
cmd - array containing the command to call and its arguments.
Method Detail

setAllowInput

public void setAllowInput(boolean allowInput)
Sets whether the subprocess will allow input, which will be read through some UI in the log window.

Parameters:
allowInput - if true, input will be read, otherwise, input will not be read. Default value is false.

setWorkingDirectory

public void setWorkingDirectory(java.io.File dir)
Sets the working directory for the subprocess.

Parameters:
dir - the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.

setLabel

public void setLabel(java.lang.String label)
Sets the label that will appear with the subprocess in the processes folder of the run manager. The label will also appear on the log page, unless the log page is overridden using the setLogPage(oracle.ide.log.LogPage) method.

Parameters:
label - the label

setIcon

public void setIcon(javax.swing.Icon icon)
Sets the icon that will appear with the subprocess in the processes folder of the run manager. The icon will also appear on the tab of the log page, unless the log page is overridden using the setLogPage(oracle.ide.log.LogPage) method.

Parameters:
icon - the icon

setLogPage

public void setLogPage(LogPage logPageOverride)
Sets the log page where the subprocess's output will be displayed.


setLogCommandString

public void setLogCommandString(boolean logCommandString)
Specifies whether to show the command string itself in the log window.


setCommandStringForLog

public void setCommandStringForLog(java.lang.String commandStringForLog)
Specifies the command string that should be logged.


setShowStartStatus

public void setShowStartStatus(boolean showStartStatus)
Specifies whether to show the start message in the status bar.


setAddToProcessesFolder

public void setAddToProcessesFolder(boolean addToProcessesFolder)
Specifies whether to add the subprocess to the processes folder of the run manager.


setAddToTerminateMenu

public void setAddToTerminateMenu(boolean addToTerminateMenu)
Specifies whether to list the subprocess in the Terminate submenu of the Run menu.


setRunProcessListener

public void setRunProcessListener(RunProcessListener runProcessListener)
Specifies that a callback method should be called after the subprocess has finished executing and all of the subprocess's output has been sent to the log page.

Parameters:
runProcessListener - the run process listener

exec

public void exec()
Executes a separate subprocess.

The standard output and error output streams are redirected to a page in the log window.


execAndWait

public int execAndWait()
Executes a separate subprocess and waits for the subprocess to finish.

The standard output and error output streams are redirected to a page in the log window.

Returns:
the exit value of the subprocess. By convention, 0 indicates normal termination.

getExecException

public java.lang.Exception getExecException()

Extension SDK

 

Copyright ©1997, 2003, Oracle. All rights reserved.