org.jruby.demo
Class TextAreaReadline
java.lang.Object
org.jruby.demo.TextAreaReadline
- All Implemented Interfaces:
- java.awt.event.KeyListener, java.util.EventListener
public class TextAreaReadline
- extends java.lang.Object
- implements java.awt.event.KeyListener
Method Summary |
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
promptStyle
public volatile javax.swing.text.MutableAttributeSet promptStyle
inputStyle
public volatile javax.swing.text.MutableAttributeSet inputStyle
outputStyle
public volatile javax.swing.text.MutableAttributeSet outputStyle
resultStyle
public volatile javax.swing.text.MutableAttributeSet resultStyle
TextAreaReadline
public TextAreaReadline(javax.swing.text.JTextComponent area)
TextAreaReadline
public TextAreaReadline(javax.swing.text.JTextComponent area,
java.lang.String message)
getInputStream
public java.io.InputStream getInputStream()
getOutputStream
public java.io.OutputStream getOutputStream()
hookIntoRuntime
public void hookIntoRuntime(Ruby runtime)
- Hooks this
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)
.
- Parameters:
runtime
- The runtime.- See Also:
hookIntoRuntimeWithStreams(Ruby)
hookIntoRuntimeWithStreams
public void hookIntoRuntimeWithStreams(Ruby runtime)
- Hooks this
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.
- Parameters:
runtime
- The runtime.- See Also:
hookIntoRuntime(Ruby)
completeAction
protected void completeAction(java.awt.event.KeyEvent event)
backAction
protected void backAction(java.awt.event.KeyEvent event)
upAction
protected void upAction(java.awt.event.KeyEvent event)
downAction
protected void downAction(java.awt.event.KeyEvent event)
replaceText
protected void replaceText(int start,
int end,
java.lang.String replacement)
getLine
protected java.lang.String getLine()
enterAction
protected void enterAction(java.awt.event.KeyEvent event)
readLine
public java.lang.String readLine(java.lang.String prompt)
keyPressed
public void keyPressed(java.awt.event.KeyEvent event)
- Specified by:
keyPressed
in interface java.awt.event.KeyListener
keyReleased
public void keyReleased(java.awt.event.KeyEvent arg0)
- Specified by:
keyReleased
in interface java.awt.event.KeyListener
keyTyped
public void keyTyped(java.awt.event.KeyEvent arg0)
- Specified by:
keyTyped
in interface java.awt.event.KeyListener
shutdown
public void shutdown()
append
protected void append(java.lang.String toAppend,
javax.swing.text.AttributeSet style)
- Output methods
Copyright © 2002-2007 JRuby Team. All Rights Reserved.