com.github.fracpete.processoutput4j.core.StreamingProcessOwner, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessiblepublic class JShellPanel
extends nz.ac.waikato.cms.gui.core.BasePanel
implements com.github.fracpete.processoutput4j.core.StreamingProcessOwner
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategyjava.awt.Container.AccessibleAWTContainer| Modifier and Type | Field | Description |
|---|---|---|
protected java.lang.Boolean |
m_Available |
whether scripting is available.
|
protected javax.swing.JButton |
m_ButtonOutputClear |
the button for clearing the output.
|
protected javax.swing.JButton |
m_ButtonOutputSave |
the button for saving the output.
|
protected javax.swing.JButton |
m_ButtonScriptLoad |
the button for loading a script.
|
protected javax.swing.JButton |
m_ButtonScriptRun |
the button for executing a script.
|
protected javax.swing.JButton |
m_ButtonScriptSave |
the button for saving as script.
|
protected javax.swing.JButton |
m_ButtonScriptStop |
the button for stopping a script.
|
protected com.github.fracpete.processoutput4j.output.StreamingProcessOutput |
m_Execution |
executes the script.
|
protected nz.ac.waikato.cms.gui.core.BaseFileChooser |
m_FileChooserOutput |
the filechooser for the output.
|
protected nz.ac.waikato.cms.gui.core.BaseFileChooser |
m_FileChooserScript |
the filechooser for scripts.
|
protected java.util.Set<JShellListener> |
m_JShellListeners |
the listeners that listen for changes.
|
protected javax.swing.JSplitPane |
m_SplitPane |
for splitting code and output.
|
protected org.fife.ui.rsyntaxtextarea.RSyntaxTextArea |
m_TextCode |
the text area for the script.
|
protected javax.swing.JTextArea |
m_TextOutput |
for the jshell output.
|
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor | Description |
|---|---|
JShellPanel() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addJShellListener(JShellListener l) |
Adds the listener to the internal list.
|
void |
clearScriptOutput() |
Clears the output of the script.
|
protected void |
finishInit() |
Finishes the initialization.
|
java.lang.String |
getCode() |
Returns the current code.
|
java.lang.String |
getExecutable() |
Returns the jshell executable.
|
java.lang.String |
getOutput() |
Returns the current output.
|
com.github.fracpete.processoutput4j.core.StreamingProcessOutputType |
getOutputType() |
Returns what output from the process to forward.
|
protected void |
initGUI() |
Initializes the widgets.
|
protected void |
initialize() |
Initializes the members.
|
boolean |
isAvailable() |
Checks whether jshell executable is available.
|
boolean |
isRunning() |
Returns whether a script is currently running.
|
void |
loadScript() |
Lets the user select a script to load.
|
void |
loadScript(java.io.File script) |
Loads the specified file.
|
static void |
main(java.lang.String[] args) |
For testing only.
|
protected void |
notifyJShellListeners(JShellEvent e) |
Notifies all the listeners with the specified event.
|
void |
processOutput(java.lang.String line,
boolean stdout) |
Processes the incoming line.
|
void |
removeJShellListener(JShellListener l) |
Removes the listener to the internal list.
|
void |
runScript() |
Executes the script.
|
void |
saveScript() |
Lets the user save the script to a file.
|
void |
saveScriptOutput() |
Lets the user save the script output to a file.
|
void |
stopScript() |
Stops a running script.
|
protected void |
updateButtons() |
Updates the state of the buttons.
|
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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateprotected java.lang.Boolean m_Available
protected javax.swing.JSplitPane m_SplitPane
protected org.fife.ui.rsyntaxtextarea.RSyntaxTextArea m_TextCode
protected nz.ac.waikato.cms.gui.core.BaseFileChooser m_FileChooserScript
protected javax.swing.JButton m_ButtonScriptLoad
protected javax.swing.JButton m_ButtonScriptSave
protected javax.swing.JButton m_ButtonScriptRun
protected javax.swing.JButton m_ButtonScriptStop
protected nz.ac.waikato.cms.gui.core.BaseFileChooser m_FileChooserOutput
protected javax.swing.JButton m_ButtonOutputClear
protected javax.swing.JButton m_ButtonOutputSave
protected javax.swing.JTextArea m_TextOutput
protected transient com.github.fracpete.processoutput4j.output.StreamingProcessOutput m_Execution
protected java.util.Set<JShellListener> m_JShellListeners
protected void initialize()
initialize in class nz.ac.waikato.cms.gui.core.BasePanelprotected void initGUI()
initGUI in class nz.ac.waikato.cms.gui.core.BasePanelprotected void finishInit()
finishInit in class nz.ac.waikato.cms.gui.core.BasePanelpublic boolean isRunning()
protected void updateButtons()
public void loadScript()
public void loadScript(java.io.File script)
script - the script to loadpublic void saveScript()
public void runScript()
public void stopScript()
public void clearScriptOutput()
public void saveScriptOutput()
public java.lang.String getCode()
public java.lang.String getOutput()
public java.lang.String getExecutable()
public boolean isAvailable()
public com.github.fracpete.processoutput4j.core.StreamingProcessOutputType getOutputType()
getOutputType in interface com.github.fracpete.processoutput4j.core.StreamingProcessOwnerpublic void processOutput(java.lang.String line,
boolean stdout)
processOutput in interface com.github.fracpete.processoutput4j.core.StreamingProcessOwnerline - the line to processstdout - whether stdout or stderrpublic void addJShellListener(JShellListener l)
l - the listener to addpublic void removeJShellListener(JShellListener l)
l - the listener to removeprotected void notifyJShellListeners(JShellEvent e)
e - the event to sendpublic static void main(java.lang.String[] args)
args - first argument is interpreted as scriptCopyright © 2018. All Rights Reserved.