|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
de.mospace.swing.IOPane
de.mospace.swing.ProcessIOPane
public class ProcessIOPane
A JComponent that provides a command line system shell. System processes are started by entering commands in the input field of this IOPane. Error and output streams of the system processes thus started are redirected to the output area of this IOPane. The commands are executed one after the other unless they end with an '&' character. ProcessIOPanes have a command line history but otherwise dispose of only very limited built-in capabilities ('cd' and 'clear', process interruption with CTRL-C, no I/O redirection). Run your operating system shell (e.g. bash) inside the ProcessIOPane if you need a fully-featured shell.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class de.mospace.swing.IOPane |
|---|
IOPane.History, IOPane.VectorHistory |
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class de.mospace.swing.IOPane |
|---|
echoAL, prependPrompt |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ProcessIOPane(int rows,
int cols)
Creates a new ProcessIOPane. |
|
| Method Summary | |
|---|---|
protected boolean |
builtin(String s)
Checks whether s is a built-in command and if so
executes it. |
void |
enqueue(ProcessRunnable command)
Enqueues and executes the specified job as if it had been started from the input field of this ProcessIOPane. |
Action[] |
getControlActions()
Returns the control actions for this ProcessIOPane. |
OutputStream |
getOutputStream()
returns a new OutputStream that writes to the output area |
protected Preferences |
getPref()
|
RunnableQueue |
getRunnableQueue()
Returns the RunnableQueue in which this ProcessIOPane stores jobs awaiting execution. |
String |
getSystemShell()
|
Action |
getSystemShellAction()
|
String |
getWorkingDirectory()
|
static String |
guessSystemShell()
|
void |
interrupt()
Interrupts the currently running process and deletes all jobs awaiting execution. |
String |
querySystemShell()
|
void |
runInCallerThread(ProcessRunnable command)
Runs the specified job in the calling thread. |
void |
setSystemShell(String command)
|
void |
setWorkingDirectory(String path)
Sets the working directory of new processes started from this IOPane. |
| Methods inherited from class de.mospace.swing.IOPane |
|---|
addActionListener, append, getActionListeners, getDocument, getHistory, getInput, getMaxLines, getOutputArea, getPrompt, getScrollPane, removeActionListener, setBackground, setMaxLines |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ProcessIOPane(int rows,
int cols)
rows - number of text rows >= 0cols - number of text columns >= 0 in a row
IllegalArgumentException - if the rows or columns arguments are negative.| Method Detail |
|---|
public void setSystemShell(String command)
public String getSystemShell()
public String querySystemShell()
public static String guessSystemShell()
public Action[] getControlActions()
interrupt()
in the body of its acionPerformed method. The second element
removes all output from the output area of this IOPane.
public Action getSystemShellAction()
public RunnableQueue getRunnableQueue()
enqueue(de.mospace.lang.ProcessRunnable)public void enqueue(ProcessRunnable command)
command.getWorkingDirectory() == null
the working directory of the command will be set to the working directory
of this ProcessIOPane.
command - the job to enqueue and executegetRunnableQueue(),
RunnableQueue.enqueue(de.mospace.lang.RunnableQueue.Job)public void runInCallerThread(ProcessRunnable command)
public void setWorkingDirectory(String path)
public String getWorkingDirectory()
public OutputStream getOutputStream()
protected boolean builtin(String s)
s is a built-in command and if so
executes it.
protected Preferences getPref()
public void interrupt()
|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||