Class AppConsole.ConsoleDocument
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.DefaultStyledDocument
org.openscience.jmol.app.jmolpanel.console.AppConsole.ConsoleDocument
- All Implemented Interfaces:
Serializable,Document,StyledDocument
- Enclosing class:
- AppConsole
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.text.DefaultStyledDocument
DefaultStyledDocument.AttributeUndoableEdit, DefaultStyledDocument.ElementBuffer, DefaultStyledDocument.ElementSpec, DefaultStyledDocument.SectionElementNested classes/interfaces inherited from class javax.swing.text.AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement -
Field Summary
FieldsModifier and TypeFieldDescription(package private) SimpleAttributeSet(package private) SimpleAttributeSet(package private) SimpleAttributeSet(package private) SimpleAttributeSet(package private) SimpleAttributeSetprivate AppConsole.ConsoleTextPaneprivate intprivate Positionprivate PositionFields inherited from class javax.swing.text.DefaultStyledDocument
buffer, BUFFER_SIZE_DEFAULTFields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementNameFields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void(package private) voidRemoves all content of the script window, and add a new prompt.(package private) void(package private) StringvoidinsertString(int offs, String str, AttributeSet a) (package private) booleanisAtEnd()(package private) voidoutputBeforePrompt(String str, SimpleAttributeSet attribute) (package private) voidoutputEcho(String strEcho) (package private) voidoutputError(String strError) (package private) voidoutputErrorForeground(String strError) (package private) voidoutputStatus(String strStatus) voidremove(int offs, int len) voidreplace(int offs, int length, String str, AttributeSet attrs) (package private) voidreplaceCommand(String newCommand, boolean isError) Replaces current command on script.private voidsetCaretPosition(int p) (package private) voidsetConsoleTextPane(AppConsole.ConsoleTextPane consoleTextPane) (package private) void(package private) void(package private) voidMethods inherited from class javax.swing.text.DefaultStyledDocument
addDocumentListener, addStyle, create, createDefaultRoot, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, insert, insertUpdate, removeDocumentListener, removeElement, removeStyle, removeUpdate, setCharacterAttributes, setLogicalStyle, setParagraphAttributes, styleChangedMethods inherited from class javax.swing.text.AbstractDocument
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, writeUnlockMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.swing.text.Document
addUndoableEditListener, createPosition, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, removeUndoableEditListener, render
-
Field Details
-
consoleTextPane
-
attError
SimpleAttributeSet attError -
attEcho
SimpleAttributeSet attEcho -
attPrompt
SimpleAttributeSet attPrompt -
attUserInput
SimpleAttributeSet attUserInput -
attStatus
SimpleAttributeSet attStatus -
positionBeforePrompt
-
positionAfterPrompt
-
offsetAfterPrompt
private int offsetAfterPrompt
-
-
Constructor Details
-
ConsoleDocument
ConsoleDocument()
-
-
Method Details
-
setConsoleTextPane
-
isAtEnd
boolean isAtEnd() -
clearContent
void clearContent()Removes all content of the script window, and add a new prompt. -
setPrompt
void setPrompt() -
setOffsetPositions
void setOffsetPositions() -
setNoPrompt
void setNoPrompt() -
outputBeforePrompt
-
outputError
-
outputErrorForeground
-
outputEcho
-
outputStatus
-
appendNewline
void appendNewline() -
insertString
- Specified by:
insertStringin interfaceDocument- Overrides:
insertStringin classAbstractDocument- Throws:
BadLocationException
-
setCaretPosition
private void setCaretPosition(int p) -
getCommandString
String getCommandString() -
remove
- Specified by:
removein interfaceDocument- Overrides:
removein classAbstractDocument- Throws:
BadLocationException
-
replace
public void replace(int offs, int length, String str, AttributeSet attrs) throws BadLocationException - Overrides:
replacein classAbstractDocument- Throws:
BadLocationException
-
replaceCommand
Replaces current command on script.- Parameters:
newCommand- new command valueisError- true to set error color ends with #??- Throws:
BadLocationException
-
colorCommand
-