|
|||||||||||
| 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
org.jpop.gui.ProcessConsole
Displays a process's (by default bash) out, err and in streams in different text areas. The input is a normal JTextArea, and out and err are displayed using OutputTextPanes
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
static int |
STDERR
Indicates the respective tab to be selected |
static int |
STDOUT
Indicates the respective tab to be selected |
| 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 | |
ProcessConsole()
Constructor for BufferConsole |
|
| Method Summary | |
void |
addTool(java.awt.Component c)
Adds a tool to the ProcessConsole object |
void |
appendToStderr(java.lang.String s)
Appends a string to the stderr text area |
void |
appendToStdin(java.lang.String s)
Appends a string to the stdin text area |
void |
appendToStdout(java.lang.String s)
Appends a string to the stdout text area |
void |
close()
Closes the object |
abstract void |
debug(java.lang.String msg)
Adds debugging capabilities to this object |
void |
execBufferedReader(java.io.BufferedReader br)
Executes input from a buffered reader |
void |
execFile(java.io.File f)
Sends the contents of File f to the running process |
java.awt.Dimension |
getInputPanelSize()
Gets the input panel size attribute of the ProcessConsole object |
java.awt.Dimension |
getInputPanePreferredSize()
Gets the input pane preferred size attribute of the ProcessConsole object |
IOControl |
getIOControl()
Gets the IO control attribute of the ProcessConsole object |
java.awt.Dimension |
getOutputTabsPreferredSize()
Gets the output tabs preferred size attribute of the ProcessConsole object |
java.awt.Dimension |
getOutputTabsSize()
Gets the input panel size attribute of the ProcessConsole object |
java.io.PrintStream |
getPrinter()
Gets the printer attribute of the ProcessConsole object |
java.lang.String |
getProcessName()
Gets the process name attribute of the ProcessConsole object |
java.awt.Color |
getStderrColor()
Gets the stderr color attribute of the ProcessConsole object |
java.lang.String |
getStderrText()
Gets the stderr text attribute of the ProcessConsole object |
java.awt.Color |
getStdinColor()
Gets the stdin color attribute of the ProcessConsole object |
java.lang.String |
getStdinText()
Gets the stdin text attribute of the ProcessConsole object |
java.awt.Color |
getStdoutColor()
Gets the stdout color attribute of the ProcessConsole object |
java.lang.String |
getStdoutText()
Gets the stdout text attribute of the ProcessConsole object |
boolean |
isRespawnable()
Gets the respawnable attribute of the ProcessConsole object |
boolean |
isRunning()
Gets the running attribute of the ProcessConsole object |
boolean |
isVerticalSplit()
Gets the vertical split attribute of the ProcessConsole object |
void |
kill()
Kills the process regardless of its respawnable flag. |
static void |
main(java.lang.String[] args)
The main program for the ProcessConsole class. |
protected void |
makeOutputPanes()
Makes and sets the output tabs. |
abstract void |
processKilled()
This happens when the process stops running for whatever reason. |
abstract void |
processStarted()
This happens when the process starts running for whatever reason. |
void |
removeTool(java.awt.Component c)
removes a tool from the ProcessConsole object |
void |
respawn()
Restarts the process regardless of whether the process is respawnable or not. |
void |
setInputPanePreferredSize(java.awt.Dimension d)
Sets the input pane preferred size attribute of the ProcessConsole object |
void |
setOutputTabsPreferredSize(java.awt.Dimension d)
Sets the output tabs preferred size attribute of the ProcessConsole object |
void |
setProcessName(java.lang.String processName)
Sets the process name attribute of the ProcessConsole object |
void |
setRespawnable(boolean respawnable)
Sets the respawnable attribute of the ProcessConsole object. |
void |
setSelectedTab(int tab)
sets the selected tab in the tabbed pane |
void |
setStderrColor(java.awt.Color stderrColor)
Sets the stderr color attribute of the ProcessConsole object. |
void |
setStderrReader(java.io.BufferedReader br)
Sets the stderr reader value of the ProcessConsole object |
void |
setStderrText(java.lang.String s)
Sets the stderr text attribute of the ProcessConsole object |
void |
setStdinColor(java.awt.Color stdinColor)
Sets the stdin color attribute of the ProcessConsole object. |
void |
setStdinText(java.lang.String s)
Sets the stdin text attribute of the ProcessConsole object |
void |
setStdoutColor(java.awt.Color stdoutColor)
Sets the stdout color attribute of the ProcessConsole object. |
void |
setStdoutReader(java.io.BufferedReader br)
Sets the stdout reader value of the ProcessConsole object |
void |
setStdoutText(java.lang.String s)
Sets the stdout text attribute of the ProcessConsole object |
void |
setVerticalSplit(boolean verticalSplit)
Sets the vertical split attribute of the ProcessConsole object |
void |
spawn()
Spawns the native process |
void |
stderrPaneRequestFocus()
calls requestFocus() |
abstract void |
stderrTextChanged()
this method is called when the text in stderr is changed by a method, like appendToStderr() or setStderrText(). |
void |
stdinPaneRequestFocus()
calls requestFocus() |
abstract void |
stdinTextChanged()
this method is called when the text in stdin is changed by a method, like appendToStdin() or setStdinText(). |
void |
stdoutPaneRequestFocus()
calls requestFocus() |
abstract void |
stdoutTextChanged()
this method is called when the text in stdout is changed by a method, like appendToStdout() or setStdoutText(). |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int STDOUT
public static final int STDERR
| Constructor Detail |
public ProcessConsole()
BufferConsole
| Method Detail |
public static void main(java.lang.String[] args)
ProcessConsole class. Just for testing.
args - The command line argumentspublic final void kill()
public final void respawn()
public final void spawn()
public void setInputPanePreferredSize(java.awt.Dimension d)
ProcessConsole object
d - The new inputPanePreferredSize valuepublic void setOutputTabsPreferredSize(java.awt.Dimension d)
ProcessConsole object
d - The new outputTabsPreferredSize valuepublic void setProcessName(java.lang.String processName)
ProcessConsole object
processName - The new processName valuepublic void setRespawnable(boolean respawnable)
ProcessConsole object. When the process
dies, if this flag is true, the process respawns instead, otherwise nothing happens. By
default true.
respawnable - The new respawnable valuepublic void setSelectedTab(int tab)
tab - the index of the tab to select (one of STDOUT or STDERR)public void setStderrColor(java.awt.Color stderrColor)
ProcessConsole object. By default red
stderrColor - The new stderrColor valuepublic void setStderrReader(java.io.BufferedReader br)
br - The new stderrReader valuepublic void setStderrText(java.lang.String s)
ProcessConsole object
s - The new stderrText valuepublic void setStdinColor(java.awt.Color stdinColor)
ProcessConsole object. By default blue
stdinColor - The new stdinColor valuepublic void setStdinText(java.lang.String s)
ProcessConsole object
s - The new stdinText valuepublic void setStdoutColor(java.awt.Color stdoutColor)
ProcessConsole object. By default black
stdoutColor - The new stdoutColor valuepublic void setStdoutReader(java.io.BufferedReader br)
br - The new stdoutReader valuepublic void setStdoutText(java.lang.String s)
ProcessConsole object
s - The new stdoutText valuepublic void setVerticalSplit(boolean verticalSplit)
ProcessConsole object
verticalSplit - The new verticalSplit valuepublic IOControl getIOControl()
ProcessConsole object
iOControl valuepublic java.awt.Dimension getInputPanePreferredSize()
ProcessConsole object
inputPanePreferredSize valuepublic java.awt.Dimension getInputPanelSize()
ProcessConsole object
inputPanelSize valuepublic java.awt.Dimension getOutputTabsPreferredSize()
ProcessConsole object
outputTabsPreferredSize valuepublic java.awt.Dimension getOutputTabsSize()
ProcessConsole object
outputTabsSize valuepublic java.io.PrintStream getPrinter()
ProcessConsole object
printer valuepublic java.lang.String getProcessName()
ProcessConsole object
processName valuepublic java.awt.Color getStderrColor()
ProcessConsole object
stderrColor valuepublic java.lang.String getStderrText()
ProcessConsole object
stderrText valuepublic java.awt.Color getStdinColor()
ProcessConsole object
stdinColor valuepublic java.lang.String getStdinText()
ProcessConsole object
stdinText valuepublic java.awt.Color getStdoutColor()
ProcessConsole object
stdoutColor valuepublic java.lang.String getStdoutText()
ProcessConsole object
stdoutText valuepublic boolean isRespawnable()
ProcessConsole object
respawnable valuepublic boolean isRunning()
ProcessConsole object
running valuepublic boolean isVerticalSplit()
ProcessConsole object
verticalSplit valuepublic void addTool(java.awt.Component c)
ProcessConsole object
c - The feature to be added to the toolBarpublic void appendToStderr(java.lang.String s)
s - The String to appendpublic void appendToStdin(java.lang.String s)
s - The String to appendpublic void appendToStdout(java.lang.String s)
s - The String to append
public void close()
throws java.io.IOException
java.io.IOException - When the process can't be destroyedpublic abstract void debug(java.lang.String msg)
msg - The message
public void execBufferedReader(java.io.BufferedReader br)
throws java.io.IOException
br -
java.io.IOExceptionpublic void execFile(java.io.File f)
f - The file to read and send to the processpublic abstract void processKilled()
public abstract void processStarted()
public void removeTool(java.awt.Component c)
ProcessConsole object
c - The feature to be removed from the toolBarpublic void stderrPaneRequestFocus()
public abstract void stderrTextChanged()
public void stdinPaneRequestFocus()
public abstract void stdinTextChanged()
public void stdoutPaneRequestFocus()
public abstract void stdoutTextChanged()
protected void makeOutputPanes()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||