public class TextAreaReadline
extends java.lang.Object
implements java.awt.event.KeyListener
| Modifier and Type | Class and Description |
|---|---|
static class |
TextAreaReadline.Channel |
private class |
TextAreaReadline.Input |
private static class |
TextAreaReadline.InputBuffer |
private class |
TextAreaReadline.Output |
private static class |
TextAreaReadline.ReadRequest |
| Modifier and Type | Field and Description |
|---|---|
private javax.swing.text.JTextComponent |
area |
private javax.swing.JComboBox |
completeCombo |
private javax.swing.plaf.basic.BasicComboPopup |
completePopup |
private java.lang.String |
currentLine |
private static java.lang.String |
EMPTY_LINE |
private int |
end |
private static Join.Spec |
INPUT_SPEC |
private Join |
inputJoin |
private java.io.InputStream |
inputStream |
javax.swing.text.MutableAttributeSet |
inputStyle |
private static int |
MAX_DOC_SIZE |
private java.io.OutputStream |
outputStream |
javax.swing.text.MutableAttributeSet |
outputStyle |
javax.swing.text.MutableAttributeSet |
promptStyle |
javax.swing.text.MutableAttributeSet |
resultStyle |
private Ruby |
runtime |
private int |
start |
private int |
startPos |
| Constructor and Description |
|---|
TextAreaReadline(javax.swing.text.JTextComponent area) |
TextAreaReadline(javax.swing.text.JTextComponent area,
java.lang.String message) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
append(java.lang.String toAppend,
javax.swing.text.AttributeSet style)
Output methods
|
protected void |
backAction(java.awt.event.KeyEvent event) |
protected void |
completeAction(java.awt.event.KeyEvent event) |
protected void |
downAction(java.awt.event.KeyEvent event) |
protected void |
enterAction(java.awt.event.KeyEvent event) |
java.io.InputStream |
getInputStream() |
protected java.lang.String |
getLine() |
java.io.OutputStream |
getOutputStream() |
void |
hookIntoRuntime(Ruby runtime)
Hooks this
TextAreaReadline instance into the
runtime, redefining the Readline module so that
it uses this object. |
void |
hookIntoRuntimeWithStreams(Ruby runtime)
Hooks this
TextAreaReadline instance into the
runtime, redefining the Readline module so that
it uses this object. |
void |
keyPressed(java.awt.event.KeyEvent event) |
void |
keyReleased(java.awt.event.KeyEvent arg0) |
void |
keyTyped(java.awt.event.KeyEvent arg0) |
java.lang.String |
readLine(java.lang.String prompt) |
protected void |
replaceText(int start,
int end,
java.lang.String replacement) |
void |
shutdown() |
protected void |
upAction(java.awt.event.KeyEvent event) |
private void |
writeLine(java.lang.String line) |
private void |
writeLineUnsafe(java.lang.String line) |
private static final java.lang.String EMPTY_LINE
private javax.swing.text.JTextComponent area
private volatile int startPos
private java.lang.String currentLine
public volatile javax.swing.text.MutableAttributeSet promptStyle
public volatile javax.swing.text.MutableAttributeSet inputStyle
public volatile javax.swing.text.MutableAttributeSet outputStyle
public volatile javax.swing.text.MutableAttributeSet resultStyle
private javax.swing.JComboBox completeCombo
private javax.swing.plaf.basic.BasicComboPopup completePopup
private int start
private int end
private final java.io.InputStream inputStream
private final java.io.OutputStream outputStream
private static final Join.Spec INPUT_SPEC
private static final int MAX_DOC_SIZE
private final Join inputJoin
private Ruby runtime
public TextAreaReadline(javax.swing.text.JTextComponent area)
public TextAreaReadline(javax.swing.text.JTextComponent area,
java.lang.String message)
public java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
public void hookIntoRuntime(Ruby runtime)
TextAreaReadline instance into the
runtime, redefining the Readline module so that
it uses this object. This method does not redefine the standard
input-output streams. If you need that, use
hookIntoRuntimeWithStreams(Ruby).runtime - The runtime.hookIntoRuntimeWithStreams(Ruby)public void hookIntoRuntimeWithStreams(Ruby runtime)
TextAreaReadline instance into the
runtime, redefining the Readline module so that
it uses this object. This method also redefines the standard
input-output streams accordingly.runtime - The runtime.hookIntoRuntime(Ruby)protected void completeAction(java.awt.event.KeyEvent event)
protected void backAction(java.awt.event.KeyEvent event)
protected void upAction(java.awt.event.KeyEvent event)
protected void downAction(java.awt.event.KeyEvent event)
protected void replaceText(int start,
int end,
java.lang.String replacement)
protected java.lang.String getLine()
protected void enterAction(java.awt.event.KeyEvent event)
public java.lang.String readLine(java.lang.String prompt)
public void keyPressed(java.awt.event.KeyEvent event)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent arg0)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent arg0)
keyTyped in interface java.awt.event.KeyListenerpublic void shutdown()
protected void append(java.lang.String toAppend,
javax.swing.text.AttributeSet style)
private void writeLineUnsafe(java.lang.String line)
private void writeLine(java.lang.String line)