public class TextAreaReadline extends Object implements KeyListener
Modifier and Type | Class and Description |
---|---|
static class |
TextAreaReadline.Channel |
Modifier and Type | Field and Description |
---|---|
MutableAttributeSet |
inputStyle |
MutableAttributeSet |
outputStyle |
MutableAttributeSet |
promptStyle |
MutableAttributeSet |
resultStyle |
Constructor and Description |
---|
TextAreaReadline(JTextComponent area) |
TextAreaReadline(JTextComponent area,
String message) |
Modifier and Type | Method and Description |
---|---|
protected void |
append(String toAppend,
AttributeSet style)
Output methods
|
protected void |
backAction(KeyEvent event) |
protected void |
completeAction(KeyEvent event) |
protected void |
downAction(KeyEvent event) |
protected void |
enterAction(KeyEvent event) |
InputStream |
getInputStream() |
protected String |
getLine() |
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(KeyEvent event) |
void |
keyReleased(KeyEvent arg0) |
void |
keyTyped(KeyEvent arg0) |
String |
readLine(String prompt) |
protected void |
replaceText(int start,
int end,
String replacement) |
void |
shutdown() |
protected void |
upAction(KeyEvent event) |
public volatile MutableAttributeSet promptStyle
public volatile MutableAttributeSet inputStyle
public volatile MutableAttributeSet outputStyle
public volatile MutableAttributeSet resultStyle
public TextAreaReadline(JTextComponent area)
public TextAreaReadline(JTextComponent area, String message)
public InputStream getInputStream()
public 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(KeyEvent event)
protected void backAction(KeyEvent event)
protected void upAction(KeyEvent event)
protected void downAction(KeyEvent event)
protected void replaceText(int start, int end, String replacement)
protected String getLine()
protected void enterAction(KeyEvent event)
public void keyPressed(KeyEvent event)
keyPressed
in interface KeyListener
public void keyReleased(KeyEvent arg0)
keyReleased
in interface KeyListener
public void keyTyped(KeyEvent arg0)
keyTyped
in interface KeyListener
public void shutdown()
protected void append(String toAppend, AttributeSet style)
Copyright © 2001–2016 JRuby. All rights reserved.