class AppConsole.ConsoleDocument extends DefaultStyledDocument
DefaultStyledDocument.AttributeUndoableEdit, DefaultStyledDocument.ElementBuffer, DefaultStyledDocument.ElementSpec, DefaultStyledDocument.SectionElement
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
Modifier and Type | Field and Description |
---|---|
(package private) SimpleAttributeSet |
attEcho |
(package private) SimpleAttributeSet |
attError |
(package private) SimpleAttributeSet |
attPrompt |
(package private) SimpleAttributeSet |
attStatus |
(package private) SimpleAttributeSet |
attUserInput |
private AppConsole.ConsoleTextPane |
consoleTextPane |
private int |
offsetAfterPrompt |
private Position |
positionAfterPrompt |
private Position |
positionBeforePrompt |
buffer, BUFFER_SIZE_DEFAULT
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
StreamDescriptionProperty, TitleProperty
Constructor and Description |
---|
ConsoleDocument() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
appendNewline() |
(package private) void |
clearContent()
Removes all content of the script window, and add a new prompt.
|
(package private) void |
colorCommand(SimpleAttributeSet att) |
(package private) String |
getCommandString() |
void |
insertString(int offs,
String str,
AttributeSet a) |
(package private) boolean |
isAtEnd() |
(package private) void |
outputBeforePrompt(String str,
SimpleAttributeSet attribute) |
(package private) void |
outputEcho(String strEcho) |
(package private) void |
outputError(String strError) |
(package private) void |
outputErrorForeground(String strError) |
(package private) void |
outputStatus(String strStatus) |
void |
remove(int offs,
int len) |
void |
replace(int offs,
int length,
String str,
AttributeSet attrs) |
(package private) void |
replaceCommand(String newCommand,
boolean isError)
Replaces current command on script.
|
(package private) void |
setConsoleTextPane(AppConsole.ConsoleTextPane consoleTextPane) |
(package private) void |
setNoPrompt() |
(package private) void |
setOffsetPositions() |
(package private) void |
setPrompt() |
addDocumentListener, addStyle, create, createDefaultRoot, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, insert, insertUpdate, removeDocumentListener, removeElement, removeStyle, removeUpdate, setCharacterAttributes, setLogicalStyle, setParagraphAttributes, styleChanged
addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, removeUndoableEditListener, render, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addUndoableEditListener, createPosition, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, removeUndoableEditListener, render
private AppConsole.ConsoleTextPane consoleTextPane
SimpleAttributeSet attError
SimpleAttributeSet attEcho
SimpleAttributeSet attPrompt
SimpleAttributeSet attUserInput
SimpleAttributeSet attStatus
private Position positionBeforePrompt
private Position positionAfterPrompt
private int offsetAfterPrompt
void setConsoleTextPane(AppConsole.ConsoleTextPane consoleTextPane)
boolean isAtEnd()
void clearContent()
void setPrompt()
void setOffsetPositions()
void setNoPrompt()
void outputBeforePrompt(String str, SimpleAttributeSet attribute)
void outputError(String strError)
void outputErrorForeground(String strError)
void outputEcho(String strEcho)
void outputStatus(String strStatus)
void appendNewline()
public void insertString(int offs, String str, AttributeSet a) throws BadLocationException
insertString
in interface Document
insertString
in class AbstractDocument
BadLocationException
String getCommandString()
public void remove(int offs, int len) throws BadLocationException
remove
in interface Document
remove
in class AbstractDocument
BadLocationException
public void replace(int offs, int length, String str, AttributeSet attrs) throws BadLocationException
replace
in class AbstractDocument
BadLocationException
void replaceCommand(String newCommand, boolean isError) throws BadLocationException
newCommand
- new command valueisError
- true to set error color ends with #??BadLocationException
void colorCommand(SimpleAttributeSet att)