|
||||||||||
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.text.JTextComponent
javax.swing.JEditorPane
javax.swing.JTextPane
org.freehep.jas.plugin.console.Console
public class Console
A TextArea that supports terminal like functionality.
Nested Class Summary | |
---|---|
static class |
Console.AutoShow
|
Nested classes/interfaces inherited from class javax.swing.JEditorPane |
---|
JEditorPane.AccessibleJEditorPane, JEditorPane.AccessibleJEditorPaneHTML, JEditorPane.JEditorPaneAccessibleHypertextSupport |
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
---|
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBinding |
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 |
---|
Fields inherited from class javax.swing.JEditorPane |
---|
HONOR_DISPLAY_PROPERTIES, W3C_LENGTH_UNITS |
Fields inherited from class javax.swing.text.JTextComponent |
---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
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 | |
---|---|
Console()
Create a new Console |
Method Summary | |
---|---|
void |
addInterruptListener(ActionListener l)
Adds a listener for CTRL^C events |
void |
addNotify()
|
protected void |
autoShow()
A method to be called to request that the console "pop up". |
void |
clear()
Clears any output from the Console |
void |
close()
A method to be called to request that the console be closed. |
void |
dispose()
Cleans up resources associated with this console. |
protected void |
fireInterruptAction()
Called when CTRL^C is detected. |
Console.AutoShow |
getAutoShow()
|
MutableAttributeSet |
getInputAttributes()
|
ConsoleInputStream |
getInputStream()
Create an input stream for reading user input from the console. |
ConsoleInputStream |
getInputStream(String initialPrompt)
Create an input stream for reading user input from the console. |
OutputStream |
getLogStream()
Get the current log stream |
int |
getMaxScrollback()
|
ConsoleOutputStream |
getOutputStream(AttributeSet set)
|
ConsoleOutputStream |
getOutputStream(AttributeSet set,
boolean autoShow)
Get an output stream for writing to the console. |
Color |
getPromptColor()
Getter for property promptColor. |
void |
insertTextAsIfTypedByUser(String text)
Insert text (command(s)) as if it were typed by the user. |
boolean |
isLoggingEnabled()
Test if logging is currently enabled |
void |
paste()
|
void |
removeInterruptListener(ActionListener l)
Remove a listener for CTRL^C events. |
void |
setAutoShow(Console.AutoShow autoShow)
|
void |
setLoggingEnabled(boolean log)
Temporarily disables/enables logging. |
void |
setLogStream(OutputStream out)
Sets a stream to use for writing logging output. |
void |
setMaxScrollback(int maxLines)
|
void |
setPromptColor(Color promptColor)
Setter for property promptColor. |
Methods inherited from class javax.swing.JTextPane |
---|
addStyle, createDefaultEditorKit, getCharacterAttributes, getLogicalStyle, getParagraphAttributes, getStyle, getStyledDocument, getStyledEditorKit, getUIClassID, insertComponent, insertIcon, paramString, removeStyle, replaceSelection, setCharacterAttributes, setDocument, setEditorKit, setLogicalStyle, setParagraphAttributes, setStyledDocument |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Console()
Method Detail |
---|
public ConsoleInputStream getInputStream()
public ConsoleInputStream getInputStream(String initialPrompt)
initialPrompt
- The prompt to use for user input
public void setLogStream(OutputStream out)
out
- The output stream to use, or null
to turn off
logging.public OutputStream getLogStream()
null
if no current streampublic void setLoggingEnabled(boolean log)
log
- true
to enable logging.public boolean isLoggingEnabled()
true
if logging enabled.public ConsoleOutputStream getOutputStream(AttributeSet set, boolean autoShow)
set
- The attributes for text created by this output stream, * or null
for the default attributes.autoShow
- If true the console will "pop to the front" when new
output is written.
public ConsoleOutputStream getOutputStream(AttributeSet set)
public void addInterruptListener(ActionListener l)
l
- The listener to add.public void dispose()
public void insertTextAsIfTypedByUser(String text)
text
- text to sendpublic void paste()
paste
in class JTextComponent
public void close()
protected void autoShow()
public void removeInterruptListener(ActionListener l)
l
- The listener to removeprotected void fireInterruptAction()
public void clear()
public MutableAttributeSet getInputAttributes()
getInputAttributes
in class JTextPane
public Color getPromptColor()
public void setPromptColor(Color promptColor)
promptColor
- New value of property promptColor.public int getMaxScrollback()
public void setMaxScrollback(int maxLines)
public Console.AutoShow getAutoShow()
public void setAutoShow(Console.AutoShow autoShow)
public void addNotify()
addNotify
in class JComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |