|
||||||||||
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
edu.rice.cs.drjava.ui.TabbedPanel
edu.rice.cs.drjava.ui.AbortablePanel
edu.rice.cs.drjava.ui.ExternalProcessPanel
public class ExternalProcessPanel
Panel for displaying some component with buttons, one of which is an "Abort" button. This should be used to display the output of an external process. This class is a swing class that should only be accessed from the event thread.
Nested Class Summary |
---|
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 | |
---|---|
protected CompletionMonitor |
_abortMonitor
|
protected int |
_changeCount
|
protected Thread |
_deathThread
|
protected InputStreamReader |
_erris
|
protected InputStreamReader |
_is
|
protected Process |
_p
|
protected ProcessCreator |
_pc
|
protected Thread |
_readThread
|
protected JButton |
_runAgainButton
|
protected StringBuilder |
_sb
|
protected JTextArea |
_textArea
|
protected JButton |
_updateNowButton
|
protected Thread |
_updateThread
|
int |
BUFFER_READS_PER_TIMER
Number of buffer reads before the event thread is allowed to do something else. |
int |
BUFFER_SIZE
Size of the buffer read at once. |
Fields inherited from class edu.rice.cs.drjava.ui.AbortablePanel |
---|
_abortButton, _buttonPanel, _frame, _leftPane, _model, _scrollPane, _title |
Fields inherited from class edu.rice.cs.drjava.ui.TabbedPanel |
---|
_closeButton, _closePanel, _displayed, _mainPanel |
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 | |
---|---|
ExternalProcessPanel(MainFrame frame,
String title,
ProcessCreator pc)
Constructs a new "process" panel to watch process output. |
Method Summary | |
---|---|
protected void |
abortActionPerformed(ActionEvent e)
Abort action was performed. |
void |
doubleClicked(MouseEvent e)
Gets called when the user double-clicks on the text pane. |
protected void |
initThread(ProcessCreator pc)
|
protected JComponent[] |
makeButtons()
Creates the buttons for controlling the regions. |
protected Component |
makeLeftPanel()
Setup left panel. |
protected void |
readText(boolean finish)
Read new text from the stream. |
protected void |
runAgainActionPerformed(ActionEvent e)
Run Again action was performed |
protected void |
updateButtons()
Update button state and text. |
protected void |
updateText()
Update the text area with the text that was read. |
Methods inherited from class edu.rice.cs.drjava.ui.AbortablePanel |
---|
_close, _setColors |
Methods inherited from class edu.rice.cs.drjava.ui.TabbedPanel |
---|
addCloseListener, dragEnter, dragExit, dragOver, drop, dropActionChanged, getName, isDisplayed, requestFocusInWindow, setDisplayed, setVisible |
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 |
Field Detail |
---|
public final int BUFFER_SIZE
public final int BUFFER_READS_PER_TIMER
protected JTextArea _textArea
protected ProcessCreator _pc
protected Process _p
protected InputStreamReader _is
protected InputStreamReader _erris
protected JButton _updateNowButton
protected JButton _runAgainButton
protected Thread _updateThread
protected Thread _readThread
protected Thread _deathThread
protected StringBuilder _sb
protected volatile int _changeCount
protected CompletionMonitor _abortMonitor
Constructor Detail |
---|
public ExternalProcessPanel(MainFrame frame, String title, ProcessCreator pc)
frame
- the MainFrametitle
- title of the panepc
- the process creator to useMethod Detail |
---|
protected void initThread(ProcessCreator pc)
protected Component makeLeftPanel()
makeLeftPanel
in class AbortablePanel
protected void abortActionPerformed(ActionEvent e)
abortActionPerformed
in class AbortablePanel
e
- action event performed by user, or null if aborted due to problemprotected void runAgainActionPerformed(ActionEvent e)
e
- action event performed by user, or null if initiated programmaticallypublic void doubleClicked(MouseEvent e)
protected void updateButtons()
updateButtons
in class AbortablePanel
protected JComponent[] makeButtons()
makeButtons
in class AbortablePanel
protected void readText(boolean finish)
finish
- whether to read the entire restprotected void updateText()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |