|
||||||||||
| 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
edu.rice.cs.drjava.ui.AbstractDJPane
edu.rice.cs.drjava.ui.InteractionsPane
public abstract class InteractionsPane
The view component for repl interaction.
| Nested Class Summary | |
|---|---|
private class |
InteractionsPane.AntiAliasOptionListener
The OptionListener for TEXT_ANTIALIAS. |
private class |
InteractionsPane.leftUndoBreak
listens for a left click by mouse and ends a compound edit for the undo/redo funationality means that when someone clicks to change position in text, starts typing at the new location, the undo will only get rid of the added text |
class |
InteractionsPane.RedoAction
Redo action. |
class |
InteractionsPane.UndoAction
The undo action. |
| 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 | |
|---|---|
private boolean |
_antiAliasText
Whether to draw text as antialiased. |
protected Runnable |
_beep
A runnable object that causes the editor to beep. |
private int |
_compoundEditKey
|
private InteractionsDJDocument |
_doc
|
boolean |
_inCompoundEdit
|
protected Keymap |
_keymap
The custom keymap for the interactions pane. |
private InteractionsPane.RedoAction |
_redoAction
|
private InteractionsPane.UndoAction |
_undoAction
fields for use in undo/redo functionality |
private UndoableEditListener |
_undoListener
Listens to any undoable events in the document, and adds them to the undo manager. |
private boolean |
deleteCEBool
|
(package private) static StyledEditorKit |
EDITOR_KIT
|
static Log |
LOG
|
| Fields inherited from class edu.rice.cs.drjava.ui.AbstractDJPane |
|---|
_highlightManager, _matchHighlight, _matchListener, dropTarget, ERROR_PAINTER, MATCH_PAINTER, NULL_DOCUMENT |
| 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 | |
|---|---|
InteractionsPane(InteractionsDJDocument doc)
Creates an InteractionsPane with the given document. |
|
InteractionsPane(String keymapName,
InteractionsDJDocument doc)
Creates an InteractionsPane with the given document. |
|
| Method Summary | |
|---|---|
void |
_resetUndo()
Reset the document Undo list. |
void |
addActionForKeyStroke(KeyStroke stroke,
Action action)
Assigns the given keystroke to the given action in this pane. |
void |
addActionForKeyStroke(Vector<KeyStroke> stroke,
Action action)
Assigns the given keystroke to the given action in this pane. |
protected EditorKit |
createDefaultEditorKit()
Overriding this method ensures that all new documents created in this editor pane use our editor kit (and thus our model). |
void |
discardUndoEdits()
discards edits and resets undoManager |
void |
endCompoundEdit()
Ends a compound edit. |
Runnable |
getBeep()
Returns a runnable object that beeps to the user. |
DJDocument |
getDJDocument()
Returns the DJDocument held by the pane. |
abstract int |
getPromptPos()
Gets the current prompt position |
InteractionsPane.RedoAction |
getRedoAction()
|
InteractionsPane.UndoAction |
getUndoAction()
|
void |
highlightError(int offset,
int length)
Highlights the given text with error highlight. |
protected void |
indentLines(int selStart,
int selEnd,
Indenter.IndentReason reason,
ProgressMonitor pm)
Indent the given selection, for the given reason, in the current document. |
void |
lostOwnership(Clipboard clipboard,
Transferable contents)
We lost ownership of what we put in the clipboard. |
protected void |
matchUpdate(int offset,
boolean opening)
Updates match highlights. |
protected void |
paintComponent(Graphics g)
Enable anti-aliased text by overriding paintComponent. |
void |
processKeyEvent(KeyEvent e)
Widens the visibilitly of the processKeyEvent method; it is protected in the superclass. |
private void |
resetUndo()
resets undo manager |
void |
setBeep(Runnable beep)
Sets this pane's beep to be a different runnable object. |
protected boolean |
shouldIndent(int selStart,
int selEnd)
Returns true if the indent is to be performed. |
protected void |
updateStatusField()
Updates status fields in the main frame (title bar, selected file name) when document is modified. |
| Methods inherited from class edu.rice.cs.drjava.ui.AbstractDJPane |
|---|
_addHighlight, _removePreviousHighlight, disableAltCntlMetaChars, dragEnter, dragExit, dragOver, drop, dropActionChanged, getScrollableUnitIncrement, indent, indent, setCaretPos |
| Methods inherited from class javax.swing.JTextPane |
|---|
addStyle, getCharacterAttributes, getInputAttributes, 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 |
| Field Detail |
|---|
public static Log LOG
private volatile InteractionsPane.UndoAction _undoAction
private volatile InteractionsPane.RedoAction _redoAction
public volatile boolean _inCompoundEdit
private volatile int _compoundEditKey
private volatile boolean deleteCEBool
protected final Keymap _keymap
private boolean _antiAliasText
static StyledEditorKit EDITOR_KIT
protected Runnable _beep
private final InteractionsDJDocument _doc
private final UndoableEditListener _undoListener
| Constructor Detail |
|---|
public InteractionsPane(InteractionsDJDocument doc)
doc - StyledDocument containing the interactions history.
public InteractionsPane(String keymapName,
InteractionsDJDocument doc)
keymapName - the name of the keymap for this panedoc - StyledDocument containing the interactions history.| Method Detail |
|---|
public Runnable getBeep()
public void lostOwnership(Clipboard clipboard,
Transferable contents)
lostOwnership in interface ClipboardOwnerpublic void processKeyEvent(KeyEvent e)
processKeyEvent in class JComponent
public void addActionForKeyStroke(KeyStroke stroke,
Action action)
stroke - keystroke that triggers the actionaction - Action to perform
public void addActionForKeyStroke(Vector<KeyStroke> stroke,
Action action)
stroke - keystroke that triggers the actionaction - Action to performpublic void setBeep(Runnable beep)
beep - Runnable command to notify the user
public void highlightError(int offset,
int length)
offset - the offset in the textlength - the length of the error to highlightprotected EditorKit createDefaultEditorKit()
createDefaultEditorKit in class JTextPaneprotected void paintComponent(Graphics g)
paintComponent in class JComponentpublic DJDocument getDJDocument()
getDJDocument in class AbstractDJPane
protected void matchUpdate(int offset,
boolean opening)
matchUpdate in class AbstractDJPaneoffset - caret position immediately following some form of brace; hence offset > 0.opening - true if the the preceding brace is "opening"protected void updateStatusField()
updateStatusField in class AbstractDJPane
protected void indentLines(int selStart,
int selEnd,
Indenter.IndentReason reason,
ProgressMonitor pm)
indentLines in class AbstractDJPaneselStart - - the selection startselEnd - - the selection endreason - - the reason for the indentpm - - the ProgressMonitor used by the indenter
protected boolean shouldIndent(int selStart,
int selEnd)
shouldIndent in class AbstractDJPaneselStart - - the selection startselEnd - - the selection endpublic abstract int getPromptPos()
public void endCompoundEdit()
public InteractionsPane.UndoAction getUndoAction()
public InteractionsPane.RedoAction getRedoAction()
private void resetUndo()
public void discardUndoEdits()
public void _resetUndo()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||