|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.text.AbstractDocument
javax.swing.text.DefaultStyledDocument
edu.rice.cs.util.text.SwingDocument
edu.rice.cs.drjava.model.AbstractDJDocument
edu.rice.cs.drjava.model.repl.InteractionsDJDocument
public class InteractionsDJDocument
Represents a Swing-based InteractionsDocument. Extends AbstractDJDocument which contains code shared by the Swing interactions and definitions documents.
| Nested Class Summary | |
|---|---|
private static class |
InteractionsDJDocument.CommandUndoableEdit
Appending any information for the reduced model from each undo command |
| Nested classes/interfaces inherited from class edu.rice.cs.drjava.model.AbstractDJDocument |
|---|
AbstractDJDocument.CharInsertCommand, AbstractDJDocument.InsertCommand, AbstractDJDocument.RemoveCommand, AbstractDJDocument.UninsertCommand, AbstractDJDocument.UnremoveCommand |
| Nested classes/interfaces inherited from class javax.swing.text.DefaultStyledDocument |
|---|
DefaultStyledDocument.AttributeUndoableEdit, DefaultStyledDocument.ElementBuffer, DefaultStyledDocument.ElementSpec, DefaultStyledDocument.SectionElement |
| Nested 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 | |
|---|---|
private boolean |
_hasPrompt
Whether the document currently has a prompt and is ready to accept input. |
private boolean |
_isModifiedSinceSave
|
private GlobalEventNotifier |
_notifier
|
private List<Pair<Pair<Integer,Integer>,String>> |
_stylesList
A list of styles and their locations augmenting this document. |
private boolean |
_toClear
A flag indicating that the interpreter was recently reset, and to reset the styles list the next time a style is added. |
private CompoundUndoManager |
_undoManager
|
private static int |
UNDO_LIMIT
|
| Fields inherited from class edu.rice.cs.drjava.model.AbstractDJDocument |
|---|
_currentLocation, _indent, _keywords, _normEndings, _primTypes, _reduced, CLOSING_BRACES, delimiters, newline, POS_THRESHOLD |
| Fields inherited from class edu.rice.cs.util.text.SwingDocument |
|---|
_condition, _styles |
| Fields inherited from class javax.swing.text.DefaultStyledDocument |
|---|
buffer, BUFFER_SIZE_DEFAULT |
| Fields inherited from class javax.swing.text.AbstractDocument |
|---|
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName |
| Fields inherited from interface javax.swing.text.Document |
|---|
StreamDescriptionProperty, TitleProperty |
| Constructor Summary | |
|---|---|
InteractionsDJDocument()
Standard constructor. |
|
InteractionsDJDocument(GlobalEventNotifier notifier)
|
|
| Method Summary | |
|---|---|
boolean |
_inBlockComment()
|
private void |
_setModifiedSinceSave()
Sets the modification state of this document to true and updates the state of the associated _odd. |
protected void |
_styleChanged()
Fire event that styles changed from current location to the end. |
void |
addColoring(int start,
int end,
String style)
Adds the given coloring style to the styles list. |
protected void |
addUndoRedo(AbstractDocument.DefaultDocumentEvent chng,
Runnable undoCommand,
Runnable doCommand)
|
void |
appendExceptionResult(String message,
String styleName)
Inserts the given exception data into the document with the given style. |
void |
clearColoring()
Called when the Interactions pane is reset. |
void |
documentSaved()
Informs this document's undo manager that the document has been saved. |
protected void |
endCompoundEdit(int key)
|
protected void |
endLastCompoundEdit()
|
UndoableEdit |
getNextRedo()
Public accessor for the next undo action. |
UndoableEdit |
getNextUndo()
Public accessor for the next undo action. |
Pair<Pair<Integer,Integer>,String>[] |
getStyles()
Accessor method used to copy contents of _stylesList to an array. |
CompoundUndoManager |
getUndoManager()
Getter method for CompoundUndoManager |
boolean |
hasPrompt()
|
boolean |
isModifiedSinceSave()
Determines if the document has been modified since the last save. |
protected Indenter |
makeNewIndenter(int indentLevel)
Returns a new indenter. |
void |
resetModification()
Resets the modification state of this document. |
void |
resetUndoManager()
Resets the undo manager. |
void |
setBoldFonts(int point,
Graphics g)
Attempts to set the font on the graphics context based upon the styles held in the styles list. |
boolean |
setColoring(int point,
Graphics g)
Attempts to set the coloring on the graphics based upon the content of the styles list returns false if the point is not in the list. |
void |
setHasPrompt(boolean val)
Sets the _hasPrompt property. |
protected int |
startCompoundEdit()
|
boolean |
undoManagerCanRedo()
|
boolean |
undoManagerCanUndo()
|
void |
updateModifiedSinceSave()
|
| Methods inherited from class edu.rice.cs.util.text.SwingDocument |
|---|
_getText, append, append, append, createUnwrappedPosition, forceInsertText, forceRemoveText, getDefaultStyle, getDocStyle, getDocText, getEditCondition, getPageable, getText, insertString, insertText, print, remove, removeText, setDocStyle, setEditCondition |
| Methods inherited from class javax.swing.text.DefaultStyledDocument |
|---|
addDocumentListener, addStyle, create, createDefaultRoot, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, insert, removeDocumentListener, removeStyle, setCharacterAttributes, setLogicalStyle, setParagraphAttributes, styleChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface edu.rice.cs.util.text.EditDocumentInterface |
|---|
append, forceInsertText, forceRemoveText, getDefaultStyle, getDocText, getEditCondition, getLength, getPageable, insertText, print, removeText, setEditCondition |
| Methods inherited from interface edu.rice.cs.drjava.model.DJDocument |
|---|
getText, insertString, remove |
| Methods inherited from interface edu.rice.cs.util.text.AbstractDocumentInterface |
|---|
append, createPosition, getLength, getText |
| Methods inherited from interface javax.swing.text.StyledDocument |
|---|
addStyle, getBackground, getCharacterElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, removeStyle, setCharacterAttributes, setLogicalStyle, setParagraphAttributes |
| Methods inherited from interface javax.swing.text.Document |
|---|
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, removeDocumentListener, removeUndoableEditListener, render |
| Field Detail |
|---|
private volatile boolean _hasPrompt
private volatile boolean _toClear
private static final int UNDO_LIMIT
private volatile CompoundUndoManager _undoManager
private volatile boolean _isModifiedSinceSave
private volatile GlobalEventNotifier _notifier
private List<Pair<Pair<Integer,Integer>,String>> _stylesList
| Constructor Detail |
|---|
public InteractionsDJDocument()
public InteractionsDJDocument(GlobalEventNotifier notifier)
| Method Detail |
|---|
public boolean hasPrompt()
hasPrompt in interface ConsoleDocumentInterfacepublic void setHasPrompt(boolean val)
setHasPrompt in interface ConsoleDocumentInterfaceval - new boolean value for _hasPrompt.protected void _styleChanged()
AbstractDJDocument
_styleChanged in class AbstractDJDocumentpublic CompoundUndoManager getUndoManager()
public void resetUndoManager()
public UndoableEdit getNextUndo()
public UndoableEdit getNextRedo()
public void documentSaved()
protected int startCompoundEdit()
startCompoundEdit in class AbstractDJDocumentprotected void endCompoundEdit(int key)
endCompoundEdit in class AbstractDJDocumentprotected void endLastCompoundEdit()
endLastCompoundEdit in class AbstractDJDocument
protected void addUndoRedo(AbstractDocument.DefaultDocumentEvent chng,
Runnable undoCommand,
Runnable doCommand)
addUndoRedo in class AbstractDJDocumentpublic boolean undoManagerCanUndo()
public boolean undoManagerCanRedo()
public void updateModifiedSinceSave()
private void _setModifiedSinceSave()
public void resetModification()
public boolean isModifiedSinceSave()
protected Indenter makeNewIndenter(int indentLevel)
public void addColoring(int start,
int end,
String style)
addColoring in class SwingDocumentpublic Pair<Pair<Integer,Integer>,String>[] getStyles()
public boolean setColoring(int point,
Graphics g)
public void setBoldFonts(int point,
Graphics g)
public void clearColoring()
public boolean _inBlockComment()
public void appendExceptionResult(String message,
String styleName)
message - Message contained in the exceptionstyleName - name of the style for formatting the exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||